Repository: accumulo
Updated Branches:
  refs/heads/ACCUMULO-378 e798d5008 -> 0f6b6d0fb


ACCUMULO-378 Need to turn on Trace for traces to be logged.


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

Branch: refs/heads/ACCUMULO-378
Commit: 4288bbe442394af8512cd0d801dbb98d76d10b46
Parents: e798d50
Author: Josh Elser <els...@apache.org>
Authored: Thu May 22 17:15:00 2014 -0400
Committer: Josh Elser <els...@apache.org>
Committed: Thu May 22 17:15:29 2014 -0400

----------------------------------------------------------------------
 .../accumulo/master/replication/ReplicationDriver.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4288bbe4/server/master/src/main/java/org/apache/accumulo/master/replication/ReplicationDriver.java
----------------------------------------------------------------------
diff --git 
a/server/master/src/main/java/org/apache/accumulo/master/replication/ReplicationDriver.java
 
b/server/master/src/main/java/org/apache/accumulo/master/replication/ReplicationDriver.java
index 3069c97..b340009 100644
--- 
a/server/master/src/main/java/org/apache/accumulo/master/replication/ReplicationDriver.java
+++ 
b/server/master/src/main/java/org/apache/accumulo/master/replication/ReplicationDriver.java
@@ -24,6 +24,9 @@ import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.util.Daemon;
 import org.apache.accumulo.fate.util.UtilWaitThread;
 import org.apache.accumulo.master.Master;
+import org.apache.accumulo.trace.instrument.CountSampler;
+import org.apache.accumulo.trace.instrument.Sampler;
+import org.apache.accumulo.trace.instrument.Trace;
 import org.apache.log4j.Logger;
 
 /**
@@ -50,6 +53,8 @@ public class ReplicationDriver extends Daemon {
 
   @Override
   public void run() {
+    Sampler sampler = new CountSampler(10);
+
     while (master.stillMaster()) {
       if (null == workMaker) {
         try {
@@ -67,6 +72,10 @@ public class ReplicationDriver extends Daemon {
         rcrr = new RemoveCompleteReplicationRecords(conn);
       }
 
+      if (sampler.next()) {
+        Trace.on("masterReplicationDriver");
+      }
+
       // Make status markers from replication records in metadata, removing 
entries in
       // metadata which are no longer needed (closed records)
       // This will end up creating the replication table too
@@ -83,6 +92,8 @@ public class ReplicationDriver extends Daemon {
       // So it's important that we run these sequentially and not concurrently
       rcrr.run();
 
+      Trace.offNoFlush();
+
       // Sleep for a bit
       
UtilWaitThread.sleep(conf.getTimeInMillis(Property.MASTER_REPLICATION_SCAN_INTERVAL));
     }

Reply via email to