You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2013/09/18 18:07:35 UTC
svn commit: r1524474 -
/uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceSummaryReader.java
Author: degenaro
Date: Wed Sep 18 16:07:34 2013
New Revision: 1524474
URL: http://svn.apache.org/r1524474
Log:
UIMA-3270 DUCC webserver (WS) support for logged-in userid based file access - import data for WorkItems and Performace via AlienFile when user is logged-in
Modified:
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceSummaryReader.java
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceSummaryReader.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceSummaryReader.java?rev=1524474&r1=1524473&r2=1524474&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceSummaryReader.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceSummaryReader.java Wed Sep 18 16:07:34 2013
@@ -51,6 +51,36 @@ public class PerformanceSummaryReader ex
return map;
}
+ public PerformanceMetricsSummaryMap readJsonGz(String userId) throws IOException, ClassNotFoundException {
+ PerformanceMetricsSummaryMap map = new PerformanceMetricsSummaryMap();
+ JobPerformanceSummaryData data = null;
+ if(data == null) {
+ try {
+ data = jsonGz.importData(userId);
+ }
+ catch(Exception e) {
+ }
+ }
+ if(data == null) {
+ try {
+ data = jsonGz.importData();
+ }
+ catch(Exception e) {
+ }
+ }
+ Integer casCount = data.getCasCount();
+ map.putCasCount(casCount);
+ ConcurrentSkipListMap<String, JobPerformanceSummary> gzMap = data.getMap();
+ Set<Entry<String, JobPerformanceSummary>> entries = gzMap.entrySet();
+ for(Entry<String, JobPerformanceSummary> entry : entries) {
+ String key = entry.getKey();
+ IJobPerformanceSummary jps = entry.getValue();
+ PerformanceMetricsSummaryItem value = new PerformanceMetricsSummaryItem(jps.getName(),jps.getUniqueName(),jps.getAnalysisTime(),jps.getNumProcessed(),jps.getAnalysisTimeMin(),jps.getAnalysisTimeMax());
+ map.putItem(key, value);
+ }
+ return map;
+ }
+
@Deprecated
private boolean legacy = true;
@@ -86,4 +116,19 @@ public class PerformanceSummaryReader ex
map = readSer();
return map;
}
+
+ public PerformanceMetricsSummaryMap readSummary(String userId) {
+ PerformanceMetricsSummaryMap map = null;
+ try {
+ map = readJsonGz(userId);
+ return map;
+ }
+ catch(Exception e) {
+ if(!legacy) {
+ e.printStackTrace();
+ }
+ }
+ map = readSer();
+ return map;
+ }
}