accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/6] git commit: ACCUMULO-2925 Don't recalculate the name multiple times.
Date Fri, 20 Jun 2014 01:25:20 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 61bf188ce -> 4d7e90aee


ACCUMULO-2925 Don't recalculate the name multiple times.


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

Branch: refs/heads/master
Commit: 4d6683a0e738250e732e74b19cae5f8575ddcb06
Parents: 61bf188
Author: Josh Elser <elserj@apache.org>
Authored: Thu Jun 19 13:42:17 2014 -0700
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Jun 19 13:42:17 2014 -0700

----------------------------------------------------------------------
 .../tserver/replication/AccumuloReplicaSystem.java   | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4d6683a0/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
index 099718b..977020b 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
@@ -39,6 +39,7 @@ import org.apache.accumulo.core.client.replication.ReplicaSystem;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.data.ColumnUpdate;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.file.rfile.RFile;
 import org.apache.accumulo.core.protobuf.ProtobufUtil;
@@ -56,6 +57,8 @@ import org.apache.accumulo.core.security.thrift.TCredentials;
 import org.apache.accumulo.core.util.UtilWaitThread;
 import org.apache.accumulo.server.client.HdfsZooInstance;
 import org.apache.accumulo.server.conf.ServerConfiguration;
+import org.apache.accumulo.server.data.ServerColumnUpdate;
+import org.apache.accumulo.server.data.ServerMutation;
 import org.apache.accumulo.server.fs.VolumeManager;
 import org.apache.accumulo.server.fs.VolumeManagerImpl;
 import org.apache.accumulo.trace.instrument.Span;
@@ -593,16 +596,16 @@ public class AccumuloReplicaSystem implements ReplicaSystem {
       log.debug("Removing {} mutations from WAL entry as they have already been replicated
to {}", mutationsRemoved, target.getPeerName());
     }
 
+    // Add our name, and send it
+    final String name = conf.get(Property.REPLICATION_NAME);
+    if (StringUtils.isBlank(name)) {
+      throw new IllegalArgumentException("Local system has no replication name configured");
+    }
+
     out.writeInt(mutationsToSend);
     for (Mutation m : value.mutations) {
       // If we haven't yet replicated to this peer
       if (!m.getReplicationSources().contains(target.getPeerName())) {
-        // Add our name, and send it
-        String name = conf.get(Property.REPLICATION_NAME);
-        if (StringUtils.isBlank(name)) {
-          throw new IllegalArgumentException("Local system has no replication name configured");
-        }
-
         m.addReplicationSource(name);
 
         m.write(out);


Mime
View raw message