Package org.apache.uima.collection.metadata

Examples of org.apache.uima.collection.metadata.CpeIntegratedCasProcessor


    // Remove all CAS processors
    cpeDesc.setCpeCasProcessors(null);

    if (aDesc.isPrimitive()) {
      // For a primitive AE we just add it.
      CpeIntegratedCasProcessor proc = createProcessor("delegate", aDesc);
      cpeDesc.addCasProcessor(proc);
    } else {
      // For an aggregate AE we dive into the first aggregation level and add each of the
      // contained AEs separately, thus allowing us to control their properties separately

      Map<String, ResourceSpecifier> delegates = aDesc.getDelegateAnalysisEngineSpecifiers();
      FixedFlow flow = (FixedFlow) aDesc.getAnalysisEngineMetaData().getFlowConstraints();
      for (String key : flow.getFixedFlow()) {
        AnalysisEngineDescription aeDesc = (AnalysisEngineDescription) delegates.get(key);
        // boolean multi = aeDesc.getAnalysisEngineMetaData().getOperationalProperties()
        // .isMultipleDeploymentAllowed();
        // log.info("["+key+"] runs "+ (multi ? "multi-threaded" : "single-threaded"));
        CpeIntegratedCasProcessor proc = createProcessor(key, aeDesc);
        cpeDesc.addCasProcessor(proc);
      }
    }
  }
View Full Code Here


    cpeInclude.set(descUrl.toString());

    CpeComponentDescriptor ccd = getResourceSpecifierFactory().createDescriptor();
    ccd.setInclude(cpeInclude);

    CpeIntegratedCasProcessor proc = produceCasProcessor(key);
    proc.setCpeComponentDescriptor(ccd);
    proc.setAttributeValue(CpeDefaultValues.PROCESSING_UNIT_THREAD_COUNT, 1);
    proc.setActionOnMaxError(ACTION_ON_MAX_ERROR);
    proc.setMaxErrorCount(0);

    return proc;
  }
View Full Code Here

    return processors;
  }

  // Default deployment=integrated
  public static CpeIntegratedCasProcessor produceCasProcessor(String aName) {
    CpeIntegratedCasProcessor processor = new CpeIntegratedCasProcessorImpl();
    try {
      processor.setName(aName);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return processor;
  }
View Full Code Here

      // secondly, create the cpm based on the descriptors
      cpeDesc = CpeDescriptorFactory.produceDescriptor();

      // managing the default behaviour of this client
      CpeIntegratedCasProcessor integratedProcessor = CpeDescriptorFactory
              .produceCasProcessor("ErrorTestAnnotator");
      integratedProcessor.setDescriptor(taeDesc);
      integratedProcessor.setActionOnMaxError("terminate");

      CpeIntegratedCasProcessor casConsumer = CpeDescriptorFactory
              .produceCasProcessor("ErrorTest CasConsumer");
      casConsumer.setDescriptor(casConsumerDesc);

      // - add all descriptors
      cpeDesc.addCollectionReader(colReaderDesc);
      cpeDesc.addCasProcessor(integratedProcessor);
      cpeDesc.addCasProcessor(casConsumer);
View Full Code Here

    localProcessor.setMaxRestartCount(3);
    localProcessor.setActionOnMaxRestart("continue");
    localProcessor.setTimeout(5000);
    processors.addCpeCasProcessor(localProcessor);

    CpeIntegratedCasProcessor integratedProcessor = CpeDescriptorFactory
            .produceCasProcessor("WF Writer");
    integratedProcessor.setDescriptor(confLocation + "consumers/wf/store/descriptor.xml");
    integratedProcessor.setBatchSize(100);
    processors.addCpeCasProcessor(integratedProcessor);

    CpeConfiguration config = CpeDescriptorFactory.produceCpeConfiguration(cpe);
    CpeCheckpoint checkpoint = CpeDescriptorFactory.produceCpeCheckpoint();
    checkpoint.setBatchSize(10);
View Full Code Here

   * @throws Exception
   */
  public void testAddIntegratedCasProcessor() throws Exception {
    CpeCasProcessors processors = cpe.getCpeCasProcessors();

    CpeIntegratedCasProcessor integratedProcessor = CpeDescriptorFactory
            .produceCasProcessor("WF Writer_X");
    assertEquals("name", "WF Writer_X", integratedProcessor.getName());
    integratedProcessor.setDescriptor(confLocation + "consumers/bla.xml");
    integratedProcessor.setBatchSize(99);
    assertEquals("BatchSize", 99, integratedProcessor.getBatchSize());
    integratedProcessor.addDeployParam("testversion", "V1.0");
    integratedProcessor.setActionOnMaxError("terminate");
    integratedProcessor.setActionOnMaxRestart("continue");
    integratedProcessor.setBatchSize(25);
    integratedProcessor.setCasProcessorFilter("some filter");
    integratedProcessor.setMaxErrorCount(300);
    integratedProcessor.setMaxErrorSampleSize(100);
    integratedProcessor.setMaxRestartCount(5);
    integratedProcessor.setTimeout(6000);
    integratedProcessor.setName("special name");
    processors.addCpeCasProcessor(integratedProcessor);

    assertEquals("name", "special name", integratedProcessor.getName());
    assertEquals("Descriptor()", confLocation + "consumers/bla.xml", integratedProcessor
            .getDescriptor());
    assertEquals("DeploymentParam", "V1.0", ((integratedProcessor.getDeploymentParams())
            .get("testversion")).getParameterValue());
    assertEquals("CasProcessorFilter", "some filter", integratedProcessor.getCasProcessorFilter());
    assertEquals("BatchSize", 25, integratedProcessor.getBatchSize());
    assertEquals("MaxErrorCount", 300, integratedProcessor.getMaxErrorCount());
    assertEquals("MaxErrorSampleSize", 100, integratedProcessor.getMaxErrorSampleSize());
    assertEquals("ActionOnMaxError", "terminate", integratedProcessor.getActionOnMaxError());
    assertEquals("MaxRestartCount", 5, integratedProcessor.getMaxRestartCount());
    assertEquals("ActionOnMaxRestart", "continue", integratedProcessor.getActionOnMaxRestart());
    assertEquals("Timeout", 6000, integratedProcessor.getTimeout());

  }
View Full Code Here

      // secondly, create the cpm based on the descriptors
      cpeDesc = CpeDescriptorFactory.produceDescriptor();

      // managing the default behaviour of this client
      CpeIntegratedCasProcessor integratedProcessor = CpeDescriptorFactory
              .produceCasProcessor("ErrorTestAnnotator");
      integratedProcessor.setDescriptor(taeDesc);

      CpeIntegratedCasProcessor casConsumer = CpeDescriptorFactory
              .produceCasProcessor("ErrorTest CasConsumer");
      casConsumer.setDescriptor(casConsumerDesc);

      // - add all descriptors
      cpeDesc.addCollectionReader(colReaderDesc);
      cpeDesc.addCasProcessor(integratedProcessor);
      cpeDesc.addCasProcessor(casConsumer);
View Full Code Here

    Object[] objs = setupConfigurableCpm(documentCount, exceptionName, exceptionSequence,
            functionName);

    CpeDescription cpeDesc = (CpeDescription) objs[0];
    cpeDesc.setProcessingUnitThreadCount(1);
    CpeIntegratedCasProcessor integratedProcessor = (CpeIntegratedCasProcessor) objs[1];
    integratedProcessor.setActionOnMaxError("terminate");
    CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc, null,
            null);

    // register a Status Callback Listener
    cpe.addStatusCallbackListener(listener);
View Full Code Here

    Object[] objs = setupConfigurableCpm(documentCount, exceptionName, exceptionSequence,
            functionName);

    CpeDescription cpeDesc = (CpeDescription) objs[0];
    cpeDesc.setProcessingUnitThreadCount(1);
    CpeIntegratedCasProcessor integratedProcessor = (CpeIntegratedCasProcessor) objs[1];
    integratedProcessor.setActionOnMaxError("terminate");
    integratedProcessor.setMaxErrorCount(5);
    CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc, null,
            null);

    // Create and register a Status Callback Listener
    // listener = new CollectionReaderStatusCallbackListener(cpe);
View Full Code Here

    Object[] objs = setupConfigurableCpm(documentCount, exceptionName, exceptionSequence,
            functionName);

    CpeDescription cpeDesc = (CpeDescription) objs[0];
    cpeDesc.setProcessingUnitThreadCount(1);
    CpeIntegratedCasProcessor integratedProcessor = (CpeIntegratedCasProcessor) objs[1];
    integratedProcessor.setActionOnMaxError("terminate");
    integratedProcessor.setMaxErrorCount(5);
    integratedProcessor.setMaxErrorSampleSize(10);
    CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc, null,
            null);

    // Create and register a Status Callback Listener
    // listener = new CollectionReaderStatusCallbackListener(cpe);
View Full Code Here

TOP

Related Classes of org.apache.uima.collection.metadata.CpeIntegratedCasProcessor

Copyright © 2018 www.massapicom. 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.