You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2014/01/09 20:22:57 UTC
git commit: ACCUMULO-2160 review fixes
Updated Branches:
refs/heads/1.6.0-SNAPSHOT a55ee6ebc -> 2d51e329e
ACCUMULO-2160 review fixes
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/2d51e329
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/2d51e329
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/2d51e329
Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 2d51e329e1784ccf18bd089dcc7bb4c932909581
Parents: a55ee6e
Author: Eric Newton <er...@gmail.com>
Authored: Thu Jan 9 14:21:30 2014 -0500
Committer: Eric Newton <er...@gmail.com>
Committed: Thu Jan 9 14:21:30 2014 -0500
----------------------------------------------------------------------
.../examples/simple/client/RandomBatchScanner.java | 7 +------
.../examples/simple/client/RandomBatchWriter.java | 5 +++--
.../java/org/apache/accumulo/test/IMMLGBenchmark.java | 13 +++++++------
.../org/apache/accumulo/test/ConditionalWriterIT.java | 13 +++++++------
4 files changed, 18 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/2d51e329/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
index 06e9ef7..29271ff 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
@@ -35,6 +35,7 @@ import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.hadoop.io.Text;
import org.apache.log4j.Logger;
+import static org.apache.accumulo.examples.simple.client.RandomBatchWriter.abs;
import com.beust.jcommander.Parameter;
@@ -111,12 +112,6 @@ public class RandomBatchScanner {
log.info("finished");
}
- private static long abs(long l) {
- if (l < 0)
- return -l;
- return l;
- }
-
/**
* Prints a count of the number of rows mapped to false.
*
http://git-wip-us.apache.org/repos/asf/accumulo/blob/2d51e329/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
index 6748797..4607fdb 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
@@ -110,9 +110,10 @@ public class RandomBatchWriter {
Long seed = null;
}
- private static long abs(long l) {
+ public static long abs(long l) {
+ l = Math.abs(l); // abs(Long.MIN_VALUE) == Long.MIN_VALUE...
if (l < 0)
- return -l;
+ return 0;
return l;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/2d51e329/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
index 8aa899b..f993ba1 100644
--- a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
+++ b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
@@ -136,12 +136,6 @@ public class IMMLGBenchmark {
}
- static long abs(long l) {
- if (l < 0)
- return -l;
- return l;
- }
-
private static long write(Connector conn, ArrayList<byte[]> cfset, String table) throws TableNotFoundException, MutationsRejectedException {
Random rand = new Random();
@@ -194,4 +188,11 @@ public class IMMLGBenchmark {
conn.tableOperations().online(table);
}
}
+
+ public static long abs(long l) {
+ l = Math.abs(l); // abs(Long.MIN_VALUE) == Long.MIN_VALUE...
+ if (l < 0)
+ return 0;
+ return l;
+ }
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/2d51e329/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
index 9dca7da..70b639a 100644
--- a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
@@ -89,6 +89,13 @@ import org.junit.Test;
*
*/
public class ConditionalWriterIT extends SimpleMacIT {
+
+ public static long abs(long l) {
+ l = Math.abs(l); // abs(Long.MIN_VALUE) == Long.MIN_VALUE...
+ if (l < 0)
+ return 0;
+ return l;
+ }
@Test(timeout = 60 * 1000)
public void testBasic() throws Exception {
@@ -578,12 +585,6 @@ public class ConditionalWriterIT extends SimpleMacIT {
cw.close();
}
- static long abs(long l) {
- if (l < 0)
- return -l;
- return l;
- }
-
@Test(timeout = 60 * 1000)
public void testBigBatch() throws Exception {