@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { monitor.trace("Starting: " + getClass().getSimpleName()); monitor.startFunction("process"); doProcess(aJCas); monitor.finishFunction("process"); monitor.persistCounts(); monitor.trace("Finished: " + getClass().getSimpleName()); }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { monitor.trace("Starting: " + getClass().getSimpleName()); monitor.startFunction("process"); doProcess(aJCas); monitor.finishFunction("process"); monitor.persistCounts(); monitor.trace("Finished: " + getClass().getSimpleName()); }
final String name = JsonJCas.normalizeFeatureName(f); if (f.getRange().isPrimitive()) { getMonitor().trace("Converting primitive feature to an object"); map.put(name, FeatureUtils.featureToObject(f, base)); && f.getRange().getComponentType() != null && f.getRange().getComponentType().isPrimitive()) { getMonitor().trace("Converting primitive feature to an array"); map.put(name, FeatureUtils.featureToList(f, base)); } else { .trace( "Feature is not a primitive type / array of primitives - will try to treat the feature as an annotation"); if (f.getRange().isArray()) { getMonitor() .trace("Feature is an array - attempting converstion to an array of annotations"); final FSArray fArr = (FSArray) base.getFeatureValue(f); if (fArr != null) { getMonitor().trace("Feature is singular - attempting conversion to a single annotation"); final FeatureStructure ent = base.getFeatureValue(f); if (ent == null) { map.put(JsonJCas.makeReference(name), ((BaleenAnnotation) ent).getInternalId()); } else { getMonitor().trace("Unable to persist feature {}", name);
private void convertFeature(Map<String, Object> map, Base base, Feature f) { if (f.getRange().isPrimitive()) { if (mapGeoJsonToObject && GEO_JSON.equals(f.getShortName())) { getMonitor().trace("Feature is GeoJSON - parsing to a database object"); putGeoJson(map, base.getFeatureValueAsString(f)); } else { getMonitor().trace("Converting primitive feature to an object"); map.put(ConsumerUtils.toCamelCase(f.getShortName()), FeatureUtils.featureToObject(f, base)); && f.getRange().getComponentType() != null && f.getRange().getComponentType().isPrimitive()) { getMonitor().trace("Converting primitive feature to an array"); map.put(ConsumerUtils.toCamelCase(f.getShortName()), FeatureUtils.featureToList(f, base)); } else { getMonitor() .trace("Feature is not a primitive type - will try to treat the feature as an entity"); if (f.getRange().isArray()) { getMonitor().trace("Feature is an array - attempting converstion to an array of entities"); FSArray fArr = (FSArray) base.getFeatureValue(f); if (fArr != null) { getMonitor().trace("Feature is singular - attempting conversion to a single entity"); FeatureStructure ent = base.getFeatureValue(f); if (ent == null) { map.put(ConsumerUtils.toCamelCase(f.getShortName()), ((Entity) ent).getExternalId()); } else { getMonitor().trace("Unable to persist feature {}", f.getShortName());
@Test public void testLogger() { UimaMonitor monitor = new UimaMonitor(PIPELINE, this.getClass()); monitor.trace("test"); monitor.debug("test"); monitor.info("test"); monitor.warn("test"); monitor.error("test"); } }