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 2015/05/27 04:12:22 UTC
[2/7] accumulo git commit: ACCUMULO-3852 Handle null table
configuration
ACCUMULO-3852 Handle null table configuration
If the configuration is null, that means it doesn't exist anymore.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/89d0fcbf
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/89d0fcbf
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/89d0fcbf
Branch: refs/heads/master
Commit: 89d0fcbfda91f2f629811ea9e7eff9f6e30ad336
Parents: ef902f2
Author: Josh Elser <jo...@gmail.com>
Authored: Tue May 26 17:30:43 2015 -0400
Committer: Josh Elser <jo...@gmail.com>
Committed: Tue May 26 18:42:00 2015 -0400
----------------------------------------------------------------------
.../org/apache/accumulo/server/replication/ReplicationUtil.java | 5 +++++
.../java/org/apache/accumulo/master/replication/WorkMaker.java | 5 +++++
2 files changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/89d0fcbf/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
index 943d211..a8e7b64 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
@@ -132,6 +132,11 @@ public class ReplicationUtil {
}
TableConfiguration tableConf = context.getServerConfigurationFactory().getTableConfiguration(localId);
+ if (null == tableConf) {
+ log.trace("Could not get configuration for table {} (it no longer exists)", table);
+ continue;
+ }
+
for (Entry<String,String> prop : tableConf.getAllPropertiesWithPrefix(Property.TABLE_REPLICATION_TARGET).entrySet()) {
String peerName = prop.getKey().substring(Property.TABLE_REPLICATION_TARGET.getKey().length());
String remoteIdentifier = prop.getValue();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/89d0fcbf/server/master/src/main/java/org/apache/accumulo/master/replication/WorkMaker.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/WorkMaker.java b/server/master/src/main/java/org/apache/accumulo/master/replication/WorkMaker.java
index 8532e1b..0333c5d 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/WorkMaker.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/WorkMaker.java
@@ -113,6 +113,11 @@ public class WorkMaker {
// Get the table configuration for the table specified by the status record
tableConf = context.getServerConfigurationFactory().getTableConfiguration(tableId.toString());
+ // getTableConfiguration(String) returns null if the table no longer exists
+ if (null == tableConf) {
+ continue;
+ }
+
// Pull the relevant replication targets
// TODO Cache this instead of pulling it every time
Map<String,String> replicationTargets = getReplicationTargets(tableConf);