Updated Branches: refs/heads/1.6.0-SNAPSHOT e11b3338a -> 6d083e44d
ACCUMULO-2057 track lastLocation through a split Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/6d083e44 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6d083e44 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6d083e44 Branch: refs/heads/1.6.0-SNAPSHOT Commit: 6d083e44d18bc01eebe742bb023671760c581ef3 Parents: e11b333 Author: Eric Newton <eric.new...@gmail.com> Authored: Thu Dec 19 16:14:56 2013 -0500 Committer: Eric Newton <eric.new...@gmail.com> Committed: Thu Dec 19 16:14:56 2013 -0500 ---------------------------------------------------------------------- .../java/org/apache/accumulo/tserver/Tablet.java | 17 +++++++++-------- .../org/apache/accumulo/tserver/TabletServer.java | 6 ++---- 2 files changed, 11 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/6d083e44/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java ---------------------------------------------------------------------- diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java index 7daa21a..d904037 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java @@ -1080,9 +1080,8 @@ public class Tablet { splitCreationTime = 0; } - public Tablet(TabletServer tabletServer, Text location, KeyExtent extent, TabletResourceManager trm, SortedMap<FileRef,DataFileValue> datafiles, String time, - long initFlushID, long initCompactID) throws IOException { - this(tabletServer, location, extent, trm, CachedConfiguration.getInstance(), datafiles, time, initFlushID, initCompactID); + public Tablet(KeyExtent extent, TabletServer tabletServer, TabletResourceManager trm, SplitInfo info) throws IOException { + this(tabletServer, new Text(info.dir), extent, trm, CachedConfiguration.getInstance(), info.datafiles, info.time, info.initFlushID, info.initCompactID, info.lastLocation); splitCreationTime = System.currentTimeMillis(); } @@ -1094,8 +1093,8 @@ public class Tablet { static private final List<LogEntry> EMPTY = Collections.emptyList(); private Tablet(TabletServer tabletServer, Text location, KeyExtent extent, TabletResourceManager trm, Configuration conf, - SortedMap<FileRef,DataFileValue> datafiles, String time, long initFlushID, long initCompactID) throws IOException { - this(tabletServer, location, extent, trm, conf, VolumeManagerImpl.get(), EMPTY, datafiles, time, null, new HashSet<FileRef>(), initFlushID, initCompactID); + SortedMap<FileRef,DataFileValue> datafiles, String time, long initFlushID, long initCompactID, TServerInstance last) throws IOException { + this(tabletServer, location, extent, trm, conf, VolumeManagerImpl.get(), EMPTY, datafiles, time, last, new HashSet<FileRef>(), initFlushID, initCompactID); } private static String lookupTime(AccumuloConfiguration conf, KeyExtent extent, SortedMap<Key,Value> tabletsKeyValues) { @@ -3477,13 +3476,15 @@ public class Tablet { String time; long initFlushID; long initCompactID; + TServerInstance lastLocation; - SplitInfo(String d, SortedMap<FileRef,DataFileValue> dfv, String time, long initFlushID, long initCompactID) { + SplitInfo(String d, SortedMap<FileRef,DataFileValue> dfv, String time, long initFlushID, long initCompactID, TServerInstance lastLocation) { this.dir = d; this.datafiles = dfv; this.time = time; this.initFlushID = initFlushID; this.initCompactID = initCompactID; + this.lastLocation = lastLocation; } } @@ -3572,8 +3573,8 @@ public class Tablet { log.log(TLevel.TABLET_HIST, extent + " split " + low + " " + high); - newTablets.put(high, new SplitInfo(tabletDirectory, highDatafileSizes, time, lastFlushID, lastCompactID)); - newTablets.put(low, new SplitInfo(lowDirectory, lowDatafileSizes, time, lastFlushID, lastCompactID)); + newTablets.put(high, new SplitInfo(tabletDirectory, highDatafileSizes, time, lastFlushID, lastCompactID, this.lastLocation)); + newTablets.put(low, new SplitInfo(lowDirectory, lowDatafileSizes, time, lastFlushID, lastCompactID, this.lastLocation)); long t2 = System.currentTimeMillis(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6d083e44/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java ---------------------------------------------------------------------- diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java index 1a4f5eb..9dabee7 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java @@ -2658,12 +2658,10 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu Tablet[] newTablets = new Tablet[2]; Entry<KeyExtent,SplitInfo> first = tabletInfo.firstEntry(); - newTablets[0] = new Tablet(TabletServer.this, new Text(first.getValue().dir), first.getKey(), resourceManager.createTabletResourceManager(), - first.getValue().datafiles, first.getValue().time, first.getValue().initFlushID, first.getValue().initCompactID); + newTablets[0] = new Tablet(first.getKey(), TabletServer.this, resourceManager.createTabletResourceManager(), first.getValue()); Entry<KeyExtent,SplitInfo> last = tabletInfo.lastEntry(); - newTablets[1] = new Tablet(TabletServer.this, new Text(last.getValue().dir), last.getKey(), resourceManager.createTabletResourceManager(), - last.getValue().datafiles, last.getValue().time, last.getValue().initFlushID, last.getValue().initCompactID); + newTablets[1] = new Tablet(first.getKey(), TabletServer.this, resourceManager.createTabletResourceManager(), last.getValue()); // roll tablet stats over into tablet server's statsKeeper object as // historical data