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/03/11 19:25:31 UTC
[22/23] git commit: ACCUMULO-2061 Don't use the default volume,
use one of the "real" volumes.
ACCUMULO-2061 Don't use the default volume, use one of the "real" volumes.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/9060185c
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/9060185c
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/9060185c
Branch: refs/heads/ACCUMULO-2061
Commit: 9060185c500b2ab17b99b09c1e1c3cd1791b1c6e
Parents: 039989a
Author: Josh Elser <el...@apache.org>
Authored: Tue Mar 11 14:00:06 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Tue Mar 11 14:00:06 2014 -0400
----------------------------------------------------------------------
.../java/org/apache/accumulo/server/Accumulo.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/9060185c/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java b/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
index fe1729c..48534f0 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
@@ -51,11 +51,12 @@ public class Accumulo {
private static final Logger log = Logger.getLogger(Accumulo.class);
public static synchronized void updateAccumuloVersion(VolumeManager fs) {
- Volume defaultVolume = fs.getDefaultVolume();
+ // TODO ACCUMULO-2451 Should update all volumes, not one
+ Volume volume = fs.getVolumes().iterator().next();
try {
if (getAccumuloPersistentVersion(fs) == ServerConstants.PREV_DATA_VERSION) {
- fs.create(new Path(ServerConstants.getDataVersionLocation(defaultVolume), Integer.toString(ServerConstants.DATA_VERSION)));
- fs.delete(new Path(ServerConstants.getDataVersionLocation(defaultVolume), Integer.toString(ServerConstants.PREV_DATA_VERSION)));
+ fs.create(new Path(ServerConstants.getDataVersionLocation(volume), Integer.toString(ServerConstants.DATA_VERSION)));
+ fs.delete(new Path(ServerConstants.getDataVersionLocation(volume), Integer.toString(ServerConstants.PREV_DATA_VERSION)));
}
} catch (IOException e) {
throw new RuntimeException("Unable to set accumulo version: an error occurred.", e);
@@ -78,9 +79,10 @@ public class Accumulo {
}
public static synchronized int getAccumuloPersistentVersion(VolumeManager fs) {
- Volume defaultVolume = fs.getDefaultVolume();
- Path path = ServerConstants.getDataVersionLocation(defaultVolume);
- return getAccumuloPersistentVersion(defaultVolume.getFileSystem(), path);
+ // It doesn't matter which Volume is used as they should all have the data version stored
+ Volume v = fs.getVolumes().iterator().next();
+ Path path = ServerConstants.getDataVersionLocation(v);
+ return getAccumuloPersistentVersion(v.getFileSystem(), path);
}
public static void enableTracing(String address, String application) {