Examples of LocationFactory


Examples of org.apache.twill.filesystem.LocationFactory

      dataIngestionPortsMap.put(Constants.TCP_INGESTION_PORT_PREFIX + inputName, tcpPort);
    }

    // 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();
View Full Code Here

Examples of org.apache.twill.filesystem.LocationFactory

   * that load classes from all the ProgramClassLoader and the URLClassLoader as described above.
   */
  public ClassLoader makeClassLoader(final ClassLoader parent)
    throws MalformedURLException {

    final LocationFactory lf = new LocalLocationFactory();
    final List<ClassLoader> classLoaders = Lists.newArrayList();
    final List<URL> urls = Lists.newArrayList();
    for (final String classPath : localClasspaths) {
      final URI uri = new File(classPath).toURI();
      if (classPath.endsWith(".jar")) {
        classLoaders.add(AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
          @Override
          public ClassLoader run() {
            try {
              File expandDir = Files.createTempDir();
              jarExpandDirs.add(expandDir);
              return ClassLoaders.newProgramClassLoader(
                BundleJarUtil.unpackProgramJar(lf.create(uri), expandDir),
                ApiResourceListHolder.getResourceList(), parent);
            } catch (IOException e) {
              throw Throwables.propagate(e);
            }
          }
View Full Code Here

Examples of org.apache.twill.filesystem.LocationFactory

  public int doMain(String[] args) {
    String jarFilename;
    File outputFile;
    String locationFactory;
    String id;
    LocationFactory lf;

    CommandLineParser parser = new GnuParser();
    Options options = new Options();
    options.addOption("i", "id", true, "Account ID");
    options.addOption("j", "jar", true, "Application JAR");
    options.addOption("f", "locfactory", true, "Location Factory (LOCAL or DISTRIBUTED)");
    options.addOption("o", "output", true, "Output");

    // Check all the options of command line
    try {
      CommandLine line = parser.parse(options, args);
      if (!line.hasOption("jar")) {
        LOG.error("Application JAR not specified.");
        return -1;
      }
      if (!line.hasOption("output")) {
        LOG.error("Output file not specified.");
        return -1;
      }
      if (!line.hasOption("id")) {
        LOG.error("Account id not specified.");
        return -1;
      }
      if (!line.hasOption("locfactory")) {
        LOG.error("Location factory not specified.");
        return -1;
      }

      jarFilename = line.getOptionValue("jar");
      outputFile = new File(line.getOptionValue("output"));
      id = line.getOptionValue("id");
      locationFactory = line.getOptionValue("locfactory");
    } catch (ParseException e) {
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("SandboxJVM", options);
      return -1;
    }

    // Load the JAR using the JAR class load and load the manifest file.
    File unpackedJarDir = Files.createTempDir();

    try {
      Application app;
      try {
        if ("LOCAL".equals(locationFactory)) {
          lf = new LocalLocationFactory();
        } else if ("DISTRIBUTED".equals(locationFactory)) {
          lf = new HDFSLocationFactory(new Configuration());
        } else {
          LOG.error("Unknown location factory specified");
          return -1;
        }

        Program archive = Programs.createWithUnpack(lf.create(jarFilename), unpackedJarDir);
        Object appMain = archive.getMainClass().newInstance();
        if (!(appMain instanceof Application)) {
          LOG.error(String.format("Application main class is of invalid type: %s",
                                  appMain.getClass().getName()));
          return -1;
View Full Code Here

Examples of org.apache.twill.filesystem.LocationFactory

   *
   * @param eventLocation Location for the event file.
   * @return Location of the index file.
   */
  private Location createIndexLocation(Location eventLocation) {
    LocationFactory factory = eventLocation.getLocationFactory();
    String eventPath = eventLocation.toURI().toString();
    int extLength = StreamFileType.EVENT.getSuffix().length();

    return factory.create(URI.create(String.format("%s%s",
                                                   eventPath.substring(0, eventPath.length() - extLength),
                                                   StreamFileType.INDEX.getSuffix())));
  }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.LocationFactory

      try
      {

         // final LocationFactory locationFactory = new
         // LocationFactory(this);
         final ValueFactoryImpl valueFactory = new ValueFactoryImpl(new LocationFactory(nsReg));
         BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE);
         BooleanQuery query = new BooleanQuery();

         final String prefix = nsReg.getNamespacePrefixByURI(uri);
         query.add(new WildcardQuery(new Term(FieldNames.LABEL, prefix + ":*")), Occur.SHOULD);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.LocationFactory

      DocumentReaderService extractor)
   {
      this.node = node;
      this.stateProvider = stateProvider;
      this.mappings = mappings;
      this.resolver = new LocationFactory(mappings);
      this.extractor = extractor;
      this.vFactory = new ValueFactoryImpl(this.resolver);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.LocationFactory

      DocumentReaderService extractor)
   {
      this.node = node;
      this.stateProvider = stateProvider;
      this.mappings = mappings;
      this.resolver = new LocationFactory(mappings);
      this.extractor = extractor;
      this.vFactory = new ValueFactoryImpl(this.resolver);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.LocationFactory

            nsMappings = new NSRegistryBasedNamespaceMappings(context.getNamespaceRegistry());
         }
      }

      scs = new SharedFieldSortComparator(FieldNames.PROPERTIES, context.getItemStateManager(), nsMappings);
      npResolver = new LocationFactory(nsMappings);

      indexingConfig = createIndexingConfiguration(nsMappings);
      analyzer.setIndexingConfig(indexingConfig);

      index = new MultiIndex(this, context.getIndexingTree(), modeHandler, getIndexInfos(), getIndexUpdateMonitor());
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.LocationFactory

      DocumentReaderService extractor)
   {
      this.node = node;
      this.stateProvider = stateProvider;
      this.mappings = mappings;
      this.resolver = new LocationFactory(mappings);
      this.extractor = extractor;
      this.vFactory = new ValueFactoryImpl(this.resolver);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.LocationFactory

      this.propRegistry = propReg;
      this.synonymProvider = synonymProvider;
      this.indexFormatVersion = indexFormatVersion;
      this.virtualTableResolver = virtualTableResolver;
      this.nodeTypeDataManager = session.getWorkspace().getNodeTypesHolder();
      this.resolver = new LocationFactory(nsMappings);
   }
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.