accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject git commit: ACCUMULO-1481 create the root table entry in zookeeper, but blocked by ACCUMULO-1814
Date Thu, 24 Oct 2013 18:58:30 GMT
Updated Branches:
  refs/heads/master 4eaf2df1c -> 6337c285f


ACCUMULO-1481 create the root table entry in zookeeper, but blocked by ACCUMULO-1814


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

Branch: refs/heads/master
Commit: 6337c285fba031c0c14ab1a22e81e5c9b3c4c84c
Parents: 4eaf2df
Author: Eric Newton <eric.newton@gmail.com>
Authored: Thu Oct 24 14:58:50 2013 -0400
Committer: Eric Newton <eric.newton@gmail.com>
Committed: Thu Oct 24 14:58:50 2013 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/server/master/Master.java | 2 +-
 .../accumulo/server/master/recovery/RecoveryManager.java    | 2 ++
 .../apache/accumulo/server/tabletserver/log/LogSorter.java  | 3 ++-
 .../org/apache/accumulo/server/util/MetadataTableUtil.java  | 9 +++++++++
 4 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/6337c285/server/src/main/java/org/apache/accumulo/server/master/Master.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/Master.java b/server/src/main/java/org/apache/accumulo/server/master/Master.java
index 22ac1f4..9cbfb51 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/Master.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/Master.java
@@ -144,7 +144,6 @@ import org.apache.accumulo.server.util.TabletIterator.TabletDeletedException;
 import org.apache.accumulo.server.util.time.SimpleTimer;
 import org.apache.accumulo.server.zookeeper.ZooLock;
 import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
-import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
 import org.apache.accumulo.trace.instrument.thrift.TraceWrap;
 import org.apache.accumulo.trace.thrift.TInfo;
 import org.apache.hadoop.io.DataInputBuffer;
@@ -294,6 +293,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver,
CurrentSt
           @Override
           public void run() {
             try {
+              MetadataTableUtil.convertRootTabletToRootTable(instance, SystemCredentials.get());
               MetadataTableUtil.moveMetaDeleteMarkers(instance, SystemCredentials.get());
               Accumulo.updateAccumuloVersion(fs);
               

http://git-wip-us.apache.org/repos/asf/accumulo/blob/6337c285/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoveryManager.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoveryManager.java
b/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoveryManager.java
index bdaa82b..5ce7a66 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoveryManager.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoveryManager.java
@@ -35,6 +35,7 @@ import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.util.NamingThreadFactory;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.server.ServerConstants;
+import org.apache.accumulo.server.fs.VolumeManager.FileType;
 import org.apache.accumulo.server.master.Master;
 import org.apache.accumulo.server.zookeeper.DistributedWorkQueue;
 import org.apache.accumulo.server.zookeeper.ZooCache;
@@ -129,6 +130,7 @@ public class RecoveryManager {
         String parts[] = filename.split("/");
         String sortId = parts[parts.length - 1];
         String dest = master.getFileSystem().choose(ServerConstants.getRecoveryDirs()) +
"/" + sortId;
+        filename = master.getFileSystem().getFullPath(FileType.WAL, walog).toString();
         log.debug("Recovering " + filename + " to " + dest);
         
         boolean sortQueued;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/6337c285/server/src/main/java/org/apache/accumulo/server/tabletserver/log/LogSorter.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/log/LogSorter.java
b/server/src/main/java/org/apache/accumulo/server/tabletserver/log/LogSorter.java
index 7518edb..abd9c6f 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/log/LogSorter.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/log/LogSorter.java
@@ -112,7 +112,8 @@ public class LogSorter {
         // the following call does not throw an exception if the file/dir does not exist
         fs.deleteRecursively(new Path(destPath));
         
-        FSDataInputStream tmpInput = fs.open(srcPath);
+        Map<String, String> opts = new HashMap<String,String>();
+        FSDataInputStream tmpInput = DfsLogger.readHeader(fs, srcPath, opts); 
                 
         byte[] magic = DfsLogger.LOG_FILE_HEADER_V2.getBytes();
         byte[] magicBuffer = new byte[magic.length];

http://git-wip-us.apache.org/repos/asf/accumulo/blob/6337c285/server/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
index 1f3468f..f5ed91b 100644
--- a/server/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
+++ b/server/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
@@ -52,6 +52,7 @@ import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.PartialKey;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.master.state.tables.TableState;
 import org.apache.accumulo.core.metadata.MetadataTable;
 import org.apache.accumulo.core.metadata.RootTable;
 import org.apache.accumulo.core.metadata.schema.DataFileValue;
@@ -81,6 +82,7 @@ import org.apache.accumulo.server.fs.VolumeManager;
 import org.apache.accumulo.server.fs.VolumeManager.FileType;
 import org.apache.accumulo.server.fs.VolumeManagerImpl;
 import org.apache.accumulo.server.master.state.TServerInstance;
+import org.apache.accumulo.server.master.state.tables.TableManager;
 import org.apache.accumulo.server.security.SystemCredentials;
 import org.apache.accumulo.server.zookeeper.ZooLock;
 import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
@@ -1312,5 +1314,12 @@ public class MetadataTableUtil {
     
     return tabletEntries;
   }
+
+  public static void convertRootTabletToRootTable(Instance instance, SystemCredentials systemCredentials)
throws KeeperException, InterruptedException {
+    ZooReaderWriter zoo = ZooReaderWriter.getInstance();
+    if (zoo.exists(ZooUtil.getRoot(instance)+"/tables/" + RootTable.ID))
+      return;
+    TableManager.prepareNewTableState(instance.getInstanceID(), RootTable.ID, RootTable.NAME,
TableState.ONLINE, NodeExistsPolicy.FAIL);
+  }
   
 }


Mime
View raw message