cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/3] cassandra git commit: Round up time deltas lower than 1ms in BulkLoader
Date Mon, 19 Jan 2015 21:47:18 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk bea3a9703 -> a7a19215c


Round up time deltas lower than 1ms in BulkLoader

patch by Max Barnash; reviewed by Aleksey Yeschenko for CASSANDRA-8645


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

Branch: refs/heads/trunk
Commit: ae380da9e9d73a4c0243ae35aa60cfee57a9cdf3
Parents: ce207cb
Author: Max Barnash <i.am@anhero.ru>
Authored: Tue Jan 20 04:13:11 2015 +0700
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Tue Jan 20 00:36:36 2015 +0300

----------------------------------------------------------------------
 CHANGES.txt                                         | 4 ++++
 src/java/org/apache/cassandra/tools/BulkLoader.java | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ae380da9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 54a6096..6604783 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,7 @@
+2.0.13:
+ * Round up time deltas lower than 1ms in BulkLoader (CASSANDRA-8645)
+
+
 2.0.12:
  * Use more efficient slice size for querying internal secondary
    index tables (CASSANDRA-8550)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ae380da9/src/java/org/apache/cassandra/tools/BulkLoader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/BulkLoader.java b/src/java/org/apache/cassandra/tools/BulkLoader.java
index 4077722..8e9cfb3 100644
--- a/src/java/org/apache/cassandra/tools/BulkLoader.java
+++ b/src/java/org/apache/cassandra/tools/BulkLoader.java
@@ -188,7 +188,7 @@ public class BulkLoader
                     sb.append(" (").append(size == 0 ? 100L : current * 100L / size).append("%)]
");
                 }
                 long time = System.nanoTime();
-                long deltaTime = TimeUnit.NANOSECONDS.toMillis(time - lastTime);
+                long deltaTime = Math.max(1L, TimeUnit.NANOSECONDS.toMillis(time - lastTime));
                 lastTime = time;
                 long deltaProgress = totalProgress - lastProgress;
                 lastProgress = totalProgress;
@@ -204,7 +204,7 @@ public class BulkLoader
         private int mbPerSec(long bytes, long timeInMs)
         {
             double bytesPerMs = ((double)bytes) / timeInMs;
-            return (int)((bytesPerMs * 1000) / (1024 * 2024));
+            return (int)((bytesPerMs * 1000) / (1024 * 1024));
         }
     }
 


Mime
View raw message