Package org.apache.twill.filesystem

Examples of org.apache.twill.filesystem.Location.mkdirs()


    if (makeInstall.waitFor() != 0) {
      throw new RuntimeException("Failed to compile SQL Library. Make process exited with exit value " +
                                   makeInstall.exitValue());
    }
    Location target = new LocalLocationFactory().create(System.getProperty("user.dir") + "/tigon-sql/target");
    target.mkdirs();
    target.append("classes").mkdirs();
    ProcessBuilder createTarBuilder = new ProcessBuilder("tar",
                                                         "cvfz", "target/classes/" + Platform.libraryResource(),
                                                         "bin", "lib", "include", "cfg").redirectErrorStream(true);
    createTarBuilder.directory(new File(System.getProperty("user.dir") + "/tigon-sql/"));
View Full Code Here


    // Setup temporary directory structure
    tmpFolder = Files.createTempDir();
    LocationFactory locationFactory = new LocalLocationFactory(tmpFolder);

    Location baseDir = locationFactory.create("baseDir");
    baseDir.mkdirs();

    InputFlowletConfiguration inputFlowletConfiguration = new LocalInputFlowletConfiguration(baseDir, spec);
    Location binDir = inputFlowletConfiguration.createStreamEngineProcesses();

    healthInspector = new HealthInspector(this);
View Full Code Here

    copyResourceFileToDir(libFile, libZip);
    unzipFile(libZip);

    //Create directory structure to place the Stream Engine Config Files
    Location workDir = dir.append("work");
    workDir.mkdirs();
    Location queryDir = workDir.append("query");
    queryDir.mkdirs();
    File qDir = new File(queryDir.toURI().getPath());
    FileUtils.copyFileToDirectory(new File(dir.append("cfg").append("external_fcns.def").toURI().getPath()), qDir);
    FileUtils.copyFileToDirectory(new File(dir.append("cfg").append("internal_fcn.def").toURI().getPath()), qDir);
View Full Code Here

    //Create directory structure to place the Stream Engine Config Files
    Location workDir = dir.append("work");
    workDir.mkdirs();
    Location queryDir = workDir.append("query");
    queryDir.mkdirs();
    File qDir = new File(queryDir.toURI().getPath());
    FileUtils.copyFileToDirectory(new File(dir.append("cfg").append("external_fcns.def").toURI().getPath()), qDir);
    FileUtils.copyFileToDirectory(new File(dir.append("cfg").append("internal_fcn.def").toURI().getPath()), qDir);
    return queryDir;
  }
View Full Code Here

    // Make sure we have a directory to store the original artifact.
    Location outputDir = locationFactory.create(configuration.get(Constants.AppFabric.OUTPUT_DIR));
    final Location newOutputDir = outputDir.append(o.getApplicationId().getAccountId());

    // Check exists, create, check exists again to avoid failure due to race condition.
    if (!newOutputDir.exists() && !newOutputDir.mkdirs() && !newOutputDir.exists()) {
      throw new IOException("Failed to create directory");
    }

    // Now, we iterate through all ProgramSpecification and generate programs
    Iterable<ProgramSpecification> specifications = Iterables.concat(
View Full Code Here

          public Location call() throws Exception {
            ProgramType type = ProgramTypes.fromSpecification(spec);
            String name = String.format(Locale.ENGLISH, "%s/%s", type, applicationName);
            Location programDir = newOutputDir.append(name);
            if (!programDir.exists()) {
              programDir.mkdirs();
            }
            Location output = programDir.append(String.format("%s.jar", spec.getName()));
            return ProgramBundle.create(o.getApplicationId(), bundler, output, spec.getName(),
                                          spec.getClassName(), type, appSpec);
            }
View Full Code Here

      }

      Location partitionDirectory = StreamUtils.createPartitionLocation(streamLocation,
                                                                        partitionStart, partitionDuration);
      // Always try to create the directory
      partitionDirectory.mkdirs();

      // Try to find the file of this bucket with the highest sequence number.
      int maxSequence = -1;
      for (Location location : partitionDirectory.list()) {
        String fileName = location.getName();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.