Java Code Examples for org.apache.uima.UIMAFramework#getDefaultPerformanceTuningProperties()

The following examples show how to use org.apache.uima.UIMAFramework#getDefaultPerformanceTuningProperties() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CollectionProcessingEngine_implTest.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
public void testPerformanceTuningSettings() throws Exception {
  try {
    Properties newProps = UIMAFramework.getDefaultPerformanceTuningProperties();
    newProps.setProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE, "100000");
    HashMap params = new HashMap();
    params.put(Resource.PARAM_PERFORMANCE_TUNING_SETTINGS, newProps);

    CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(
 new XMLInputSource(JUnitExtension
     .getFile("CollectionProcessingEngineImplTest/performanceTuningSettingsTestCpe.xml")));
    CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc,
 params);
    cpe.process();
    // Need to give CPE time to do its work. The following should work, but
    // doesn't
    // while (cpe.isProcessing())
    // {
    // Thread.sleep(1000);
    // }
    Thread.sleep(3000);
  } catch (Exception e) {
    JUnitExtension.handleException(e);
  }
}
 
Example 2
Source File: ProcessTrace_impl.java    From uima-uimaj with Apache License 2.0 4 votes vote down vote up
/**
 * Create a ProcessTrace_impl using the framework's default timer.
 */
public ProcessTrace_impl() {
  this(UIMAFramework.getDefaultPerformanceTuningProperties());
}
 
Example 3
Source File: ProcessTrace_impl.java    From uima-uimaj with Apache License 2.0 3 votes vote down vote up
/**
 * Create a ProcessTrace_impl with a custom timer.
 * 
 * @param aTimer
 *          the timer to use for collecting performance stats
 * @param aPerformanceTuningSettings
 *          performance tuning settings. One of the settings allows the ProcessTrace to be
 *          disabled.
 */
public ProcessTrace_impl(UimaTimer aTimer, Properties aPerformanceTuningSettings) {
  mTimer = aTimer;
  if (aPerformanceTuningSettings == null) {
    aPerformanceTuningSettings = UIMAFramework.getDefaultPerformanceTuningProperties();
  }
  mEnabled = "true".equalsIgnoreCase(aPerformanceTuningSettings
          .getProperty(UIMAFramework.PROCESS_TRACE_ENABLED));
}
 
Example 4
Source File: BaseCPMImpl.java    From uima-uimaj with Apache License 2.0 2 votes vote down vote up
/**
 * Instantiates and initializes CPE Factory with a given CPE Descriptor and defaults.
 * 
 * @param aDescriptor -
 *          parsed CPE descriptor
 * @throws Exception -
 */
public BaseCPMImpl(CpeDescription aDescriptor) throws Exception {
  this(aDescriptor, null, true, UIMAFramework.getDefaultPerformanceTuningProperties());
  cpmThreadGroup = new CPMThreadGroup("CPM Thread Group");
}
 
Example 5
Source File: ProcessTrace_impl.java    From uima-uimaj with Apache License 2.0 2 votes vote down vote up
/**
 * Create a ProcessTrace_impl with a custom timer.
 * 
 * @param aTimer
 *          the timer to use for collecting performance stats
 */
public ProcessTrace_impl(UimaTimer aTimer) {
  this(aTimer, UIMAFramework.getDefaultPerformanceTuningProperties());
}