You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/12/11 00:03:18 UTC
[1/2] accumulo git commit: ACCUMULO-3399 Log the error and set the
exit value.
Repository: accumulo
Updated Branches:
refs/heads/master 524a81392 -> 67a426277
ACCUMULO-3399 Log the error and set the exit value.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/851583e0
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/851583e0
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/851583e0
Branch: refs/heads/master
Commit: 851583e0f66ccc7223dc211a68ee8d78261a5c9a
Parents: 524a813
Author: Josh Elser <el...@apache.org>
Authored: Wed Dec 10 16:06:18 2014 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Wed Dec 10 16:06:18 2014 -0500
----------------------------------------------------------------------
.../examples/simple/client/TracingExample.java | 23 ++++++++++++--------
1 file changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/851583e0/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/TracingExample.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/TracingExample.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/TracingExample.java
index 3a010a6..881819b 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/TracingExample.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/TracingExample.java
@@ -34,6 +34,7 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.trace.DistributedTrace;
+import org.apache.log4j.Logger;
import org.htrace.Sampler;
import org.htrace.Trace;
import org.htrace.TraceScope;
@@ -45,7 +46,7 @@ import com.beust.jcommander.Parameter;
*
*/
public class TracingExample {
-
+ private static final Logger log = Logger.getLogger(TracingExample.class);
private static final String DEFAULT_TABLE_NAME = "test";
static class Opts extends ClientOnDefaultTable {
@@ -130,14 +131,18 @@ public class TracingExample {
}
public static void main(String[] args) throws Exception {
-
- TracingExample tracingExample = new TracingExample();
- Opts opts = new Opts();
- ScannerOpts scannerOpts = new ScannerOpts();
- opts.parseArgs(TracingExample.class.getName(), args, scannerOpts);
-
- tracingExample.enableTracing(opts);
- tracingExample.execute(opts);
+ try {
+ TracingExample tracingExample = new TracingExample();
+ Opts opts = new Opts();
+ ScannerOpts scannerOpts = new ScannerOpts();
+ opts.parseArgs(TracingExample.class.getName(), args, scannerOpts);
+
+ tracingExample.enableTracing(opts);
+ tracingExample.execute(opts);
+ } catch (Exception e) {
+ log.error("Caught exception running TraceExample", e);
+ System.exit(1);
+ }
}
}
[2/2] accumulo git commit: ACCUMULO-3398 Set exit value for a quick
pass/fail assertion.
Posted by el...@apache.org.
ACCUMULO-3398 Set exit value for a quick pass/fail assertion.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/67a42627
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/67a42627
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/67a42627
Branch: refs/heads/master
Commit: 67a426277cec072cbbbec76bebb11a780559fcc0
Parents: 851583e
Author: Josh Elser <el...@apache.org>
Authored: Wed Dec 10 16:09:26 2014 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Wed Dec 10 16:09:26 2014 -0500
----------------------------------------------------------------------
.../test/replication/merkle/cli/CompareTables.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/67a42627/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/CompareTables.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/CompareTables.java b/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/CompareTables.java
index 5ac5b68..44a5a3b 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/CompareTables.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/CompareTables.java
@@ -157,8 +157,20 @@ public class CompareTables {
CompareTables compareTables = new CompareTables(opts);
Map<String,String> tableToHashes = compareTables.computeAllHashes();
+ boolean hashesEqual = true;
+ String previousHash = null;
for (Entry<String,String> entry : tableToHashes.entrySet()) {
+ // Set the previous hash if we dont' have one
+ if (null == previousHash) {
+ previousHash = entry.getValue();
+ } else if (hashesEqual) {
+ // If the hashes are still equal, check that the new hash is also equal
+ hashesEqual = previousHash.equals(entry.getValue());
+ }
+
System.out.println(entry.getKey() + " " + entry.getValue());
}
+
+ System.exit(hashesEqual ? 0 : 1);
}
}