Package org.apache.uima.collection.metadata

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


          "<casProcessor>", "<casProcessors>" }, new Exception(CpmLocalizedMessage
              .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING", new Object[] { Thread
                              .currentThread().getName() })));
    }
    CpeCheckpoint checkpoint = aCasProcessorConfig.getCheckpoint();
    if (checkpoint == null) {
      throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
          "<checkpoint>", "<casProcessor>" }, new Exception(CpmLocalizedMessage
              .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                          Thread.currentThread().getName(), aCasProcessorConfig.getName(),
                          "<checkpoint>" })));
    }

    try {
      if (checkpoint.getBatchSize() > 0) {
        batchSize = checkpoint.getBatchSize();
      }
    } catch (NumberFormatException e) {
      throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,
              new Object[] { "batch", "<checkpoint>" }, new Exception(CpmLocalizedMessage
                      .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
View Full Code Here


    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);
    checkpoint.setFilePath("c://cpm/data/checkpoint.dat");
    checkpoint.setFrequency(3000, true);
    config.setCheckpoint(checkpoint);
    CpeTimer cpeTimer = CpeDescriptorFactory.produceCpeTimer("java");
    config.setCpeTimer(cpeTimer);
    config.setDeployment("immediate");
    config.setNumToProcess(1000);
View Full Code Here

      errorThreshold.setAction("terminate");
      errorHandling.setErrorRateThreshold(errorThreshold);
      setErrorHandling(errorHandling);
    }
    if (getCheckpoint() == null) {
      CpeCheckpoint checkpoint = CpeDescriptorFactory.produceCpeCheckpoint();
      checkpoint.setBatchSize(1);
      checkpoint.setFilePath(CpeDefaultValues.PROCESSOR_CHECKPOINT_FILE);
      checkpoint.setFrequency(1000, true);
      setCheckpoint(checkpoint);
    }
  }
View Full Code Here

          "<casProcessor>", "<casProcessors>" }, new Exception(CpmLocalizedMessage
              .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING", new Object[] { Thread
                              .currentThread().getName() })));
    }
    CpeCheckpoint checkpoint = aCasProcessorConfig.getCheckpoint();
    if (checkpoint == null) {
      throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
          "<checkpoint>", "<casProcessor>" }, new Exception(CpmLocalizedMessage
              .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                          Thread.currentThread().getName(), aCasProcessorConfig.getName(),
                          "<checkpoint>" })));
    }

    try {
      if (checkpoint.getBatchSize() > 0) {
        batchSize = checkpoint.getBatchSize();
      }
    } catch (NumberFormatException e) {
      throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,
              new Object[] { "batch", "<checkpoint>" }, new Exception(CpmLocalizedMessage
                      .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
View Full Code Here

    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);
    checkpoint.setFilePath("c://cpm/data/checkpoint.dat");
    checkpoint.setFrequency(3000, true);
    config.setCheckpoint(checkpoint);
    CpeTimer cpeTimer = CpeDescriptorFactory.produceCpeTimer("java");
    config.setCpeTimer(cpeTimer);
    config.setDeployment("immediate");
    config.setNumToProcess(1000);
View Full Code Here

      errorThreshold.setAction("terminate");
      errorHandling.setErrorRateThreshold(errorThreshold);
      setErrorHandling(errorHandling);
    }
    if (getCheckpoint() == null) {
      CpeCheckpoint checkpoint = CpeDescriptorFactory.produceCpeCheckpoint();
      checkpoint.setBatchSize(1);
      checkpoint.setFilePath(CpeDefaultValues.PROCESSOR_CHECKPOINT_FILE);
      checkpoint.setFrequency(1000, true);
      setCheckpoint(checkpoint);
    }
  }
View Full Code Here

    // if no explicite settings in CPE Xml descriptor
    static public CpeCheckpoint getCpeDefaultCheckpoint ()
    {
        // CPE BUG!!! Need to call CpeDescriptorFactory.produceDescriptor();
//        CpeDescription cpeDesc = CpeDescriptorFactory.produceDescriptor();
        CpeCheckpoint c = CpeDescriptorFactory.produceCpeCheckpoint();
        // CPE BUG!!! Need to set some value before calling getFrequency()
        c.setFrequency(600000, true);
        return c;
    }
View Full Code Here

          "<casProcessor>", "<casProcessors>" }, new Exception(CpmLocalizedMessage
              .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING", new Object[] { Thread
                              .currentThread().getName() })));
    }
    CpeCheckpoint checkpoint = aCasProcessorConfig.getCheckpoint();
    if (checkpoint == null) {
      throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
          "<checkpoint>", "<casProcessor>" }, new Exception(CpmLocalizedMessage
              .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                          Thread.currentThread().getName(), aCasProcessorConfig.getName(),
                          "<checkpoint>" })));
    }

    try {
      if (checkpoint.getBatchSize() > 0) {
        batchSize = checkpoint.getBatchSize();
      }
    } catch (NumberFormatException e) {
      throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,
              new Object[] { "batch", "<checkpoint>" }, new Exception(CpmLocalizedMessage
                      .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
View Full Code Here

    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);
    checkpoint.setFilePath("c://cpm/data/checkpoint.dat");
    checkpoint.setFrequency(3000, true);
    config.setCheckpoint(checkpoint);
    CpeTimer cpeTimer = CpeDescriptorFactory.produceCpeTimer("java");
    config.setCpeTimer(cpeTimer);
    config.setDeployment("immediate");
    config.setNumToProcess(1000);
View Full Code Here

      errorThreshold.setAction("terminate");
      errorHandling.setErrorRateThreshold(errorThreshold);
      setErrorHandling(errorHandling);
    }
    if (getCheckpoint() == null) {
      CpeCheckpoint checkpoint = CpeDescriptorFactory.produceCpeCheckpoint();
      checkpoint.setBatchSize(1);
      checkpoint.setFilePath(CpeDefaultValues.PROCESSOR_CHECKPOINT_FILE);
      checkpoint.setFrequency(1000, true);
      setCheckpoint(checkpoint);
    }
  }
View Full Code Here

TOP

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

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.