Package org.apache.uima.collection.metadata

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


                          "<maxConsecutiveRestarts>", maxRestarts.getAction() })));
    }
    actionOnMaxRestarts = maxRestarts.getAction();

    // Setup Error rate Threshold in terms of (count)/(sample size) eg. 3/1000
    CasProcessorErrorRateThreshold errorRateThresholdType = casProcessorErrorHandling
            .getErrorRateThreshold();
    if (errorRateThresholdType == null) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
                  "errorRateThreshold", "CPE" },
              new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                          Thread.currentThread().getName(), name, "<errorRateThreshold>" })));
    }

    errorRate = errorRateThresholdType.getMaxErrorCount();
    errorSampleSize = errorRateThresholdType.getMaxErrorSampleSize();

    if (!validActionOnError(errorRateThresholdType.getAction())) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
                  "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
                      new Object[] { Thread.currentThread().getName(), name,
                          "<errorRateThreshold>", maxRestarts.getAction() })));

    }
    actionOnMaxError = errorRateThresholdType.getAction();

    CasProcessorTimeout timeoutType = casProcessorErrorHandling.getTimeout();
    timeOut = timeoutType.get();

  }
View Full Code Here


      maxRestart.setAction("terminate");
      errorHandling.setMaxConsecutiveRestarts(maxRestart);
      CasProcessorTimeout timeout = CpeDescriptorFactory.produceCasProcessorTimeout();
      timeout.set(100000);
      errorHandling.setTimeout(timeout);
      CasProcessorErrorRateThreshold errorThreshold = CpeDescriptorFactory
              .produceCasProcessorErrorRateThreshold();
      errorThreshold.setMaxErrorCount(100);
      errorThreshold.setMaxErrorSampleSize(1000);
      errorThreshold.setAction("terminate");
      errorHandling.setErrorRateThreshold(errorThreshold);
      setErrorHandling(errorHandling);
    }
    if (getCheckpoint() == null) {
      CpeCheckpoint checkpoint = CpeDescriptorFactory.produceCpeCheckpoint();
View Full Code Here

                          "<maxConsecutiveRestarts>", maxRestarts.getAction() })));
    }
    actionOnMaxRestarts = maxRestarts.getAction();

    // Setup Error rate Threshold in terms of (count)/(sample size) eg. 3/1000
    CasProcessorErrorRateThreshold errorRateThresholdType = casProcessorErrorHandling
            .getErrorRateThreshold();
    if (errorRateThresholdType == null) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
                  "errorRateThreshold", "CPE" },
              new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                          Thread.currentThread().getName(), name, "<errorRateThreshold>" })));
    }

    errorRate = errorRateThresholdType.getMaxErrorCount();
    errorSampleSize = errorRateThresholdType.getMaxErrorSampleSize();

    if (!validActionOnError(errorRateThresholdType.getAction())) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
                  "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
                      new Object[] { Thread.currentThread().getName(), name,
                          "<errorRateThreshold>", maxRestarts.getAction() })));

    }
    actionOnMaxError = errorRateThresholdType.getAction();

    CasProcessorTimeout timeoutType = casProcessorErrorHandling.getTimeout();
    timeOut = timeoutType.get();

  }
View Full Code Here

      maxRestart.setAction("terminate");
      errorHandling.setMaxConsecutiveRestarts(maxRestart);
      CasProcessorTimeout timeout = CpeDescriptorFactory.produceCasProcessorTimeout();
      timeout.set(100000);
      errorHandling.setTimeout(timeout);
      CasProcessorErrorRateThreshold errorThreshold = CpeDescriptorFactory
              .produceCasProcessorErrorRateThreshold();
      errorThreshold.setMaxErrorCount(100);
      errorThreshold.setMaxErrorSampleSize(1000);
      errorThreshold.setAction("terminate");
      errorHandling.setErrorRateThreshold(errorThreshold);
      setErrorHandling(errorHandling);
    }
    if (getCheckpoint() == null) {
      CpeCheckpoint checkpoint = CpeDescriptorFactory.produceCpeCheckpoint();
View Full Code Here

                          "<maxConsecutiveRestarts>", maxRestarts.getAction() })));
    }
    actionOnMaxRestarts = maxRestarts.getAction();

    // Setup Error rate Threshold in terms of (count)/(sample size) eg. 3/1000
    CasProcessorErrorRateThreshold errorRateThresholdType = casProcessorErrorHandling
            .getErrorRateThreshold();
    if (errorRateThresholdType == null) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
                  "errorRateThreshold", "CPE" },
              new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                      "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
                          Thread.currentThread().getName(), name, "<errorRateThreshold>" })));
    }

    errorRate = errorRateThresholdType.getMaxErrorCount();
    errorSampleSize = errorRateThresholdType.getMaxErrorSampleSize();

    if (!validActionOnError(errorRateThresholdType.getAction())) {
      throw new ResourceConfigurationException(
              ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
                  "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
                      CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
                      new Object[] { Thread.currentThread().getName(), name,
                          "<errorRateThreshold>", maxRestarts.getAction() })));

    }
    actionOnMaxError = errorRateThresholdType.getAction();

    CasProcessorTimeout timeoutType = casProcessorErrorHandling.getTimeout();
    timeOut = timeoutType.get();

  }
View Full Code Here

      maxRestart.setAction("terminate");
      errorHandling.setMaxConsecutiveRestarts(maxRestart);
      CasProcessorTimeout timeout = CpeDescriptorFactory.produceCasProcessorTimeout();
      timeout.set(100000);
      errorHandling.setTimeout(timeout);
      CasProcessorErrorRateThreshold errorThreshold = CpeDescriptorFactory
              .produceCasProcessorErrorRateThreshold();
      errorThreshold.setMaxErrorCount(100);
      errorThreshold.setMaxErrorSampleSize(1000);
      errorThreshold.setAction("terminate");
      errorHandling.setErrorRateThreshold(errorThreshold);
      setErrorHandling(errorHandling);
    }
    if (getCheckpoint() == null) {
      CpeCheckpoint checkpoint = CpeDescriptorFactory.produceCpeCheckpoint();
View Full Code Here

      maxRestart.setAction("terminate");
      errorHandling.setMaxConsecutiveRestarts(maxRestart);
      CasProcessorTimeout timeout = CpeDescriptorFactory.produceCasProcessorTimeout();
      timeout.set(100000);
      errorHandling.setTimeout(timeout);
      CasProcessorErrorRateThreshold errorThreshold = CpeDescriptorFactory
              .produceCasProcessorErrorRateThreshold();
      errorThreshold.setMaxErrorCount(100);
      errorThreshold.setMaxErrorSampleSize(1000);
      errorThreshold.setAction("terminate");
      errorHandling.setErrorRateThreshold(errorThreshold);
      setErrorHandling(errorHandling);
    }
    if (getCheckpoint() == null) {
      CpeCheckpoint checkpoint = CpeDescriptorFactory.produceCpeCheckpoint();
View Full Code Here

TOP

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

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.