jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [5/6] jena git commit: JENA-923: Move Timer class to oaj.atlas.lib
Date Tue, 28 Apr 2015 11:35:07 GMT
JENA-923: Move Timer class to oaj.atlas.lib


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/6790a64f
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/6790a64f
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/6790a64f

Branch: refs/heads/master
Commit: 6790a64f2127eb4f115bf7f7e1ad938468dc2294
Parents: d93f238
Author: Andy Seaborne <andy@apache.org>
Authored: Tue Apr 28 11:51:26 2015 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Tue Apr 28 11:52:36 2015 +0100

----------------------------------------------------------------------
 jena-arq/src/main/java/arq/cmdline/ModTime.java |  2 +-
 .../java/org/apache/jena/atlas/lib/Timer.java   | 72 ++++++++++++++++++++
 .../jena/atlas/logging/ProgressLogger.java      |  2 +-
 .../engine/iterator/QueryIteratorTiming.java    |  2 +-
 .../java/org/apache/jena/sparql/util/Timer.java | 71 -------------------
 .../sparql/util/graph/GraphLoadMonitor.java     |  2 +-
 jena-arq/src/main/java/riotcmd/CmdTokens.java   |  2 +-
 .../java/org/apache/jena/tdb/TDBLoader.java     |  2 +-
 .../org/apache/jena/tdb/store/SinkProgress.java |  2 +-
 .../BuilderSecondaryIndexesInterleaved.java     |  2 +-
 .../BuilderSecondaryIndexesParallel.java        |  2 +-
 .../BuilderSecondaryIndexesSequential.java      |  2 +-
 .../jena/tdb/store/bulkloader/LoadMonitor.java  |  2 +-
 13 files changed, 83 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-arq/src/main/java/arq/cmdline/ModTime.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/arq/cmdline/ModTime.java b/jena-arq/src/main/java/arq/cmdline/ModTime.java
index d570676..4811cd3 100644
--- a/jena-arq/src/main/java/arq/cmdline/ModTime.java
+++ b/jena-arq/src/main/java/arq/cmdline/ModTime.java
@@ -18,7 +18,7 @@
 
 package arq.cmdline;
 
-import org.apache.jena.sparql.util.Timer ;
+import org.apache.jena.atlas.lib.Timer ;
 
 
 public class ModTime implements ArgModuleGeneral

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-arq/src/main/java/org/apache/jena/atlas/lib/Timer.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/lib/Timer.java b/jena-arq/src/main/java/org/apache/jena/atlas/lib/Timer.java
new file mode 100644
index 0000000..304e086
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/lib/Timer.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.atlas.lib ;
+
+import org.apache.jena.atlas.AtlasException ;
+
+/** A Timer of operations */ 
+public class Timer {
+
+    protected long    timeFinish = -1 ;
+    protected boolean inTimer    = false ;
+    protected long    timeStart  = 0 ;
+
+    public Timer() {}
+
+    public void startTimer() {
+        if ( inTimer )
+            throw new AtlasException("Already in timer") ;
+
+        timeStart = System.currentTimeMillis() ;
+        timeFinish = -1 ;
+        inTimer = true ;
+    }
+
+    /** Return time in millisecods */
+    public long endTimer() {
+        if ( !inTimer )
+            throw new AtlasException("Not in timer") ;
+        timeFinish = System.currentTimeMillis() ;
+        inTimer = false ;
+        return getTimeInterval() ;
+    }
+
+    public long readTimer() {
+        if ( !inTimer )
+            throw new AtlasException("Not in timer") ;
+        return System.currentTimeMillis() - timeStart ;
+    }
+
+    public long getTimeInterval() {
+        if ( inTimer )
+            throw new AtlasException("Still timing") ;
+        if ( timeFinish == -1 )
+            throw new AtlasException("No valid interval") ;
+
+        return timeFinish - timeStart ;
+    }
+
+    static public String timeStr(long timeInterval) {
+        return String.format("%.3f", timeInterval / 1000.0) ;
+    }
+
+    protected String timeStr(long timePoint, long startTimePoint) {
+        return timeStr(timePoint - startTimePoint) ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-arq/src/main/java/org/apache/jena/atlas/logging/ProgressLogger.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/logging/ProgressLogger.java b/jena-arq/src/main/java/org/apache/jena/atlas/logging/ProgressLogger.java
index 070713e..8b92831 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/logging/ProgressLogger.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/logging/ProgressLogger.java
@@ -19,7 +19,7 @@
 package org.apache.jena.atlas.logging;
 
 import static org.apache.jena.sparql.util.Utils.nowAsString ;
-import org.apache.jena.sparql.util.Timer ;
+import org.apache.jena.atlas.lib.Timer ;
 import org.slf4j.Logger ;
 
 /** Progress monitor */

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIteratorTiming.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIteratorTiming.java
b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIteratorTiming.java
index 648341e..0e824ac 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIteratorTiming.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIteratorTiming.java
@@ -18,9 +18,9 @@
 
 package org.apache.jena.sparql.engine.iterator;
 
+import org.apache.jena.atlas.lib.Timer ;
 import org.apache.jena.sparql.engine.QueryIterator ;
 import org.apache.jena.sparql.engine.binding.Binding ;
-import org.apache.jena.sparql.util.Timer ;
 import org.slf4j.Logger ;
 import org.slf4j.LoggerFactory ;
 

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-arq/src/main/java/org/apache/jena/sparql/util/Timer.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/util/Timer.java b/jena-arq/src/main/java/org/apache/jena/sparql/util/Timer.java
deleted file mode 100644
index 4548080..0000000
--- a/jena-arq/src/main/java/org/apache/jena/sparql/util/Timer.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.sparql.util ;
-
-import org.apache.jena.sparql.ARQException ;
-
-public class Timer {
-
-    protected long    timeFinish = -1 ;
-    protected boolean inTimer    = false ;
-    protected long    timeStart  = 0 ;
-
-    public Timer() {}
-
-    public void startTimer() {
-        if ( inTimer )
-            throw new ARQException("Already in timer") ;
-
-        timeStart = System.currentTimeMillis() ;
-        timeFinish = -1 ;
-        inTimer = true ;
-    }
-
-    /** Return time in millisecods */
-    public long endTimer() {
-        if ( !inTimer )
-            throw new ARQException("Not in timer") ;
-        timeFinish = System.currentTimeMillis() ;
-        inTimer = false ;
-        return getTimeInterval() ;
-    }
-
-    public long readTimer() {
-        if ( !inTimer )
-            throw new ARQException("Not in timer") ;
-        return System.currentTimeMillis() - timeStart ;
-    }
-
-    public long getTimeInterval() {
-        if ( inTimer )
-            throw new ARQException("Still timing") ;
-        if ( timeFinish == -1 )
-            throw new ARQException("No valid interval") ;
-
-        return timeFinish - timeStart ;
-    }
-
-    static public String timeStr(long timeInterval) {
-        return String.format("%.3f", timeInterval / 1000.0) ;
-    }
-
-    protected String timeStr(long timePoint, long startTimePoint) {
-        return timeStr(timePoint - startTimePoint) ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-arq/src/main/java/org/apache/jena/sparql/util/graph/GraphLoadMonitor.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/util/graph/GraphLoadMonitor.java
b/jena-arq/src/main/java/org/apache/jena/sparql/util/graph/GraphLoadMonitor.java
index bd1c9dd..f0d924a 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/util/graph/GraphLoadMonitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/util/graph/GraphLoadMonitor.java
@@ -20,8 +20,8 @@ package org.apache.jena.sparql.util.graph;
 
 import java.util.Date ;
 
+import org.apache.jena.atlas.lib.Timer ;
 import org.apache.jena.sparql.util.StringUtils ;
-import org.apache.jena.sparql.util.Timer ;
 
 // To be retired.
 // Use a sink instead.

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-arq/src/main/java/riotcmd/CmdTokens.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/riotcmd/CmdTokens.java b/jena-arq/src/main/java/riotcmd/CmdTokens.java
index 2bc3e4e..d7c1340 100644
--- a/jena-arq/src/main/java/riotcmd/CmdTokens.java
+++ b/jena-arq/src/main/java/riotcmd/CmdTokens.java
@@ -21,10 +21,10 @@ package riotcmd;
 import java.io.InputStream ;
 
 import org.apache.jena.atlas.io.IO ;
+import org.apache.jena.atlas.lib.Timer ;
 import org.apache.jena.riot.tokens.Token ;
 import org.apache.jena.riot.tokens.Tokenizer ;
 import org.apache.jena.riot.tokens.TokenizerFactory ;
-import org.apache.jena.sparql.util.Timer ;
 
 public class CmdTokens
 {

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-tdb/src/main/java/org/apache/jena/tdb/TDBLoader.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/TDBLoader.java b/jena-tdb/src/main/java/org/apache/jena/tdb/TDBLoader.java
index 896a0ed..ab4668e 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/TDBLoader.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/TDBLoader.java
@@ -22,9 +22,9 @@ import java.io.InputStream ;
 import java.util.ArrayList ;
 import java.util.List ;
 
+import org.apache.jena.atlas.lib.Timer ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.rdf.model.Model ;
-import org.apache.jena.sparql.util.Timer ;
 import org.apache.jena.tdb.store.DatasetGraphTDB ;
 import org.apache.jena.tdb.store.GraphTDB ;
 import org.apache.jena.tdb.store.bulkloader.BulkLoader ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-tdb/src/main/java/org/apache/jena/tdb/store/SinkProgress.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/store/SinkProgress.java b/jena-tdb/src/main/java/org/apache/jena/tdb/store/SinkProgress.java
index 621e180..3237ecd 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/store/SinkProgress.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/store/SinkProgress.java
@@ -21,8 +21,8 @@ package org.apache.jena.tdb.store;
 import java.util.Date ;
 
 import org.apache.jena.atlas.lib.Sink ;
+import org.apache.jena.atlas.lib.Timer ;
 import org.apache.jena.sparql.util.StringUtils ;
-import org.apache.jena.sparql.util.Timer ;
 
 
 public class SinkProgress<X> implements Sink<X>

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesInterleaved.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesInterleaved.java
b/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesInterleaved.java
index f9fce31..f3133f1 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesInterleaved.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesInterleaved.java
@@ -18,7 +18,7 @@
 
 package org.apache.jena.tdb.store.bulkloader;
 
-import org.apache.jena.sparql.util.Timer ;
+import org.apache.jena.atlas.lib.Timer ;
 import org.apache.jena.tdb.store.tupletable.TupleIndex ;
 
 public class BuilderSecondaryIndexesInterleaved implements BuilderSecondaryIndexes

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesParallel.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesParallel.java
b/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesParallel.java
index e44c992..8d35277 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesParallel.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesParallel.java
@@ -20,7 +20,7 @@ package org.apache.jena.tdb.store.bulkloader;
 
 import java.util.concurrent.Semaphore ;
 
-import org.apache.jena.sparql.util.Timer ;
+import org.apache.jena.atlas.lib.Timer ;
 import org.apache.jena.tdb.store.tupletable.TupleIndex ;
 
 public class BuilderSecondaryIndexesParallel implements BuilderSecondaryIndexes

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesSequential.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesSequential.java
b/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesSequential.java
index ea189a3..9bf0357 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesSequential.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/BuilderSecondaryIndexesSequential.java
@@ -18,7 +18,7 @@
 
 package org.apache.jena.tdb.store.bulkloader;
 
-import org.apache.jena.sparql.util.Timer ;
+import org.apache.jena.atlas.lib.Timer ;
 import org.apache.jena.tdb.store.tupletable.TupleIndex ;
 
 public class BuilderSecondaryIndexesSequential implements BuilderSecondaryIndexes

http://git-wip-us.apache.org/repos/asf/jena/blob/6790a64f/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/LoadMonitor.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/LoadMonitor.java
b/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/LoadMonitor.java
index d580f39..660e65c 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/LoadMonitor.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/store/bulkloader/LoadMonitor.java
@@ -21,9 +21,9 @@ package org.apache.jena.tdb.store.bulkloader;
 import static org.apache.jena.sparql.util.Utils.nowAsString ;
 import org.apache.jena.atlas.event.Event ;
 import org.apache.jena.atlas.event.EventManager ;
+import org.apache.jena.atlas.lib.Timer ;
 import org.apache.jena.sparql.core.DatasetGraph ;
 import org.apache.jena.sparql.util.StringUtils ;
-import org.apache.jena.sparql.util.Timer ;
 import org.slf4j.Logger ;
 
 public final class LoadMonitor


Mime
View raw message