Revert "ACCUMULO-3772 All ZK WAL refs contain LogEntry in the node."
This reverts commit f55751bc073d449099794fd4fc5cc7a3ce7ee388. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/e7571e22 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/e7571e22 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/e7571e22 Branch: refs/heads/master Commit: e7571e226374b80d90f5ad75abf2afd4867fd608 Parents: 6b6b30a Author: Josh Elser <[email protected]> Authored: Sat May 9 14:41:13 2015 -0400 Committer: Josh Elser <[email protected]> Committed: Sat May 9 14:41:13 2015 -0400 ---------------------------------------------------------------------- .../apache/accumulo/server/util/MetadataTableUtil.java | 13 ++----------- .../apache/accumulo/test/functional/WALSunnyDayIT.java | 4 +--- 2 files changed, 3 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/e7571e22/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java index f53f6a5..d517989 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java @@ -1056,13 +1056,6 @@ public class MetadataTableUtil { public static void addNewLogMarker(ClientContext context, ZooLock zooLock, final TServerInstance tabletSession, final Path filename, TabletLevel level) { log.debug("Adding log entry " + filename); if (level == TabletLevel.ROOT) { - LogEntry log = new LogEntry(RootTable.EXTENT, System.currentTimeMillis(), tabletSession.hostPort(), filename.toString()); - final byte[] node; - try { - node = log.toBytes(); - } catch (IOException e) { - throw new RuntimeException("Failed to write to byte array", e); - } retryZooKeeperUpdate(context, zooLock, new ZooOperation() { @Override public void run(IZooReaderWriter rw) throws KeeperException, InterruptedException, IOException { @@ -1073,7 +1066,7 @@ public class MetadataTableUtil { path.append(CurrentLogsSection.getRowPrefix()); path.append(tabletSession.toString()); path.append(uniqueId); - rw.putPersistentData(path.toString(), node, NodeExistsPolicy.OVERWRITE); + rw.putPersistentData(path.toString(), filename.toString().getBytes(UTF_8), NodeExistsPolicy.OVERWRITE); } }); } else { @@ -1160,9 +1153,7 @@ public class MetadataTableUtil { String root = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + RootTable.ZROOT_TABLET_CURRENT_LOGS; logs.clear(); for (String child : rw.getChildren(root)) { - byte[] data = rw.getData(root + "/" + child, null); - LogEntry entry = LogEntry.fromBytes(data); - logs.add(new Path(entry.filename)); + logs.add(new Path(new String(rw.getData(root + "/" + child, null), UTF_8))); } } }); http://git-wip-us.apache.org/repos/asf/accumulo/blob/e7571e22/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java b/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java index f2ceb2c..7259177 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java @@ -48,7 +48,6 @@ import org.apache.accumulo.core.metadata.RootTable; import org.apache.accumulo.core.metadata.schema.MetadataSchema.CurrentLogsSection; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.TabletColumnFamily; -import org.apache.accumulo.core.tabletserver.log.LogEntry; import org.apache.accumulo.core.util.UtilWaitThread; import org.apache.accumulo.core.zookeeper.ZooUtil; import org.apache.accumulo.master.state.SetGoalState; @@ -214,8 +213,7 @@ public class WALSunnyDayIT extends ConfigurableMacIT { List<String> children = zoo.getChildren(zpath, null); for (String child : children) { byte[] data = zoo.getData(zpath + "/" + child, null, null); - LogEntry entry = LogEntry.fromBytes(data); - result.put(entry.filename, true); + result.put(new String(data), true); } return result; }
