This is an automated email from the ASF dual-hosted git repository.
cshannon pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.1 by this push:
new fe2d201685 Refactor TabletMetadata.Location to encapsulate
TServerInstance (#3257)
fe2d201685 is described below
commit fe2d201685eb669cedbe778a5c13e1886419b585
Author: Christopher L. Shannon <[email protected]>
AuthorDate: Sat Mar 25 08:24:23 2023 -0400
Refactor TabletMetadata.Location to encapsulate TServerInstance (#3257)
The previous version where Location extends TServerInstance was
error prone if equals/hashcode was overriden. This fixes things by
encapsulating TServerInstance and creating proper equals/hashcode
methods so comparsions won't fail.
---
.../core/metadata/TabletLocationState.java | 68 ++++++++++++-----
.../accumulo/core/metadata/schema/Ample.java | 6 +-
.../core/metadata/schema/TabletMetadata.java | 86 ++++++++++++++++++++--
.../core/metadata/schema/TabletMetadataTest.java | 6 +-
.../manager/balancer/BalancerEnvironmentImpl.java | 5 +-
.../server/manager/state/MetaDataStateStore.java | 20 ++---
.../server/manager/state/MetaDataTableScanner.java | 13 ++--
.../server/manager/state/ZooTabletStateStore.java | 21 +++---
.../server/master/balancer/GroupBalancer.java | 2 +-
.../server/metadata/TabletMutatorBase.java | 10 ++-
.../accumulo/server/util/ManagerMetadataUtil.java | 42 +++++------
.../manager/state/RootTabletStateStoreTest.java | 10 ++-
.../manager/state/TabletLocationStateTest.java | 21 +++---
.../accumulo/gc/GarbageCollectWriteAheadLogs.java | 2 +-
.../gc/GarbageCollectWriteAheadLogsTest.java | 9 ++-
.../java/org/apache/accumulo/manager/Manager.java | 4 +-
.../manager/ManagerClientServiceHandler.java | 2 +-
.../accumulo/manager/TabletGroupWatcher.java | 20 ++---
.../manager/tableOps/bulkVer2/LoadFiles.java | 3 +-
.../manager/tableOps/compact/CompactionDriver.java | 2 +-
.../accumulo/manager/upgrade/Upgrader9to10.java | 8 +-
.../apache/accumulo/tserver/AssignmentHandler.java | 5 +-
.../accumulo/tserver/UnloadTabletHandler.java | 4 +-
.../accumulo/tserver/tablet/DatafileManager.java | 4 +-
.../org/apache/accumulo/tserver/tablet/Tablet.java | 8 +-
.../apache/accumulo/tserver/tablet/TabletData.java | 8 +-
.../shell/commands/ListTabletsCommand.java | 3 +-
.../shell/commands/ListTabletsCommandTest.java | 8 +-
.../test/ManagerRepairsDualAssignmentIT.java | 11 ++-
.../test/functional/AssignLocationModeIT.java | 6 +-
.../test/functional/CompactLocationModeIT.java | 4 +-
.../test/functional/ManagerAssignmentIT.java | 6 +-
.../accumulo/test/functional/SplitRecoveryIT.java | 4 +-
.../apache/accumulo/test/manager/MergeStateIT.java | 7 +-
.../accumulo/test/manager/SuspendedTabletsIT.java | 2 +-
35 files changed, 279 insertions(+), 161 deletions(-)
diff --git
a/core/src/main/java/org/apache/accumulo/core/metadata/TabletLocationState.java
b/core/src/main/java/org/apache/accumulo/core/metadata/TabletLocationState.java
index 61857794fa..d0cd66300b 100644
---
a/core/src/main/java/org/apache/accumulo/core/metadata/TabletLocationState.java
+++
b/core/src/main/java/org/apache/accumulo/core/metadata/TabletLocationState.java
@@ -25,6 +25,8 @@ import java.util.Collections;
import java.util.Set;
import org.apache.accumulo.core.dataImpl.KeyExtent;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.util.TextUtil;
import org.apache.hadoop.io.Text;
@@ -53,13 +55,13 @@ public class TabletLocationState {
}
}
- public TabletLocationState(KeyExtent extent, TServerInstance future,
TServerInstance current,
- TServerInstance last, SuspendingTServer suspend,
Collection<Collection<String>> walogs,
- boolean chopped) throws BadLocationStateException {
+ public TabletLocationState(KeyExtent extent, Location future, Location
current, Location last,
+ SuspendingTServer suspend, Collection<Collection<String>> walogs,
boolean chopped)
+ throws BadLocationStateException {
this.extent = extent;
- this.future = future;
- this.current = current;
- this.last = last;
+ this.future = validateLocation(future, TabletMetadata.LocationType.FUTURE);
+ this.current = validateLocation(current,
TabletMetadata.LocationType.CURRENT);
+ this.last = validateLocation(last, TabletMetadata.LocationType.LAST);
this.suspend = suspend;
if (walogs == null) {
walogs = Collections.emptyList();
@@ -74,27 +76,42 @@ public class TabletLocationState {
}
public final KeyExtent extent;
- public final TServerInstance future;
- public final TServerInstance current;
- public final TServerInstance last;
+ public final Location future;
+ public final Location current;
+ public final Location last;
public final SuspendingTServer suspend;
public final Collection<Collection<String>> walogs;
public final boolean chopped;
- public TServerInstance futureOrCurrent() {
+ public TServerInstance getCurrentServer() {
+ return serverInstance(current);
+ }
+
+ public TServerInstance getFutureServer() {
+ return serverInstance(future);
+ }
+
+ public TServerInstance getLastServer() {
+ return serverInstance(last);
+ }
+
+ public TServerInstance futureOrCurrentServer() {
+ return serverInstance(futureOrCurrent());
+ }
+
+ public Location futureOrCurrent() {
if (hasCurrent()) {
return current;
}
return future;
}
- @Override
- public String toString() {
- return extent + "@(" + future + "," + current + "," + last + ")" +
(chopped ? " chopped" : "");
+ public TServerInstance getServer() {
+ return serverInstance(getLocation());
}
- public TServerInstance getLocation() {
- TServerInstance result = null;
+ public Location getLocation() {
+ Location result = null;
if (hasCurrent()) {
result = current;
} else if (hasFuture()) {
@@ -119,10 +136,10 @@ public class TabletLocationState {
public TabletState getState(Set<TServerInstance> liveServers) {
if (hasFuture()) {
- return liveServers.contains(future) ? TabletState.ASSIGNED
+ return liveServers.contains(future.getServerInstance()) ?
TabletState.ASSIGNED
: TabletState.ASSIGNED_TO_DEAD_SERVER;
} else if (hasCurrent()) {
- return liveServers.contains(current) ? TabletState.HOSTED
+ return liveServers.contains(current.getServerInstance()) ?
TabletState.HOSTED
: TabletState.ASSIGNED_TO_DEAD_SERVER;
} else if (hasSuspend()) {
return TabletState.SUSPENDED;
@@ -130,4 +147,21 @@ public class TabletLocationState {
return TabletState.UNASSIGNED;
}
}
+
+ @Override
+ public String toString() {
+ return extent + "@(" + future + "," + current + "," + last + ")" +
(chopped ? " chopped" : "");
+ }
+
+ private static Location validateLocation(final Location location,
+ final TabletMetadata.LocationType type) {
+ if (location != null && !location.getType().equals(type)) {
+ throw new IllegalArgumentException("Location type is required to be of
type " + type);
+ }
+ return location;
+ }
+
+ protected static TServerInstance serverInstance(final Location location) {
+ return location != null ? location.getServerInstance() : null;
+ }
}
diff --git
a/core/src/main/java/org/apache/accumulo/core/metadata/schema/Ample.java
b/core/src/main/java/org/apache/accumulo/core/metadata/schema/Ample.java
index 7119a9dd59..7e1c5163a4 100644
--- a/core/src/main/java/org/apache/accumulo/core/metadata/schema/Ample.java
+++ b/core/src/main/java/org/apache/accumulo/core/metadata/schema/Ample.java
@@ -35,7 +35,7 @@ import org.apache.accumulo.core.metadata.StoredTabletFile;
import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.TabletFile;
import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType;
-import org.apache.accumulo.core.metadata.schema.TabletMetadata.LocationType;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.tabletserver.log.LogEntry;
import org.apache.hadoop.io.Text;
@@ -257,9 +257,9 @@ public interface Ample {
TabletMutator putFlushId(long flushId);
- TabletMutator putLocation(TServerInstance tserver, LocationType type);
+ TabletMutator putLocation(Location location);
- TabletMutator deleteLocation(TServerInstance tserver, LocationType type);
+ TabletMutator deleteLocation(Location location);
TabletMutator putZooLock(ServiceLock zooLock);
diff --git
a/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java
b/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java
index d4ed6315f6..4a640d4167 100644
---
a/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java
+++
b/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java
@@ -133,17 +133,89 @@ public class TabletMetadata {
ECOMP
}
- public static class Location extends TServerInstance {
+ public static class Location {
+ private final TServerInstance tServerInstance;
private final LocationType lt;
- public Location(String server, String session, LocationType lt) {
- super(HostAndPort.fromString(server), session);
- this.lt = lt;
+ private Location(final String server, final String session, final
LocationType lt) {
+ this(new TServerInstance(HostAndPort.fromString(server), session), lt);
+ }
+
+ private Location(final TServerInstance tServerInstance, final LocationType
lt) {
+ this.tServerInstance =
+ Objects.requireNonNull(tServerInstance, "tServerInstance must not be
null");
+ this.lt = Objects.requireNonNull(lt, "locationType must not be null");
}
public LocationType getType() {
return lt;
}
+
+ public TServerInstance getServerInstance() {
+ return tServerInstance;
+ }
+
+ public String getHostPortSession() {
+ return tServerInstance.getHostPortSession();
+ }
+
+ public String getHost() {
+ return tServerInstance.getHost();
+ }
+
+ public String getHostPort() {
+ return tServerInstance.getHostPort();
+ }
+
+ public HostAndPort getHostAndPort() {
+ return tServerInstance.getHostAndPort();
+ }
+
+ public String getSession() {
+ return tServerInstance.getSession();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Location location = (Location) o;
+ return Objects.equals(tServerInstance, location.tServerInstance) && lt
== location.lt;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(tServerInstance, lt);
+ }
+
+ public static Location last(TServerInstance instance) {
+ return new Location(instance, LocationType.LAST);
+ }
+
+ public static Location last(final String server, final String session) {
+ return last(new TServerInstance(HostAndPort.fromString(server),
session));
+ }
+
+ public static Location current(TServerInstance instance) {
+ return new Location(instance, LocationType.CURRENT);
+ }
+
+ public static Location current(final String server, final String session) {
+ return current(new TServerInstance(HostAndPort.fromString(server),
session));
+ }
+
+ public static Location future(TServerInstance instance) {
+ return new Location(instance, LocationType.FUTURE);
+ }
+
+ public static Location future(final String server, final String session) {
+ return future(new TServerInstance(HostAndPort.fromString(server),
session));
+ }
+
}
public TableId getTableId() {
@@ -283,8 +355,8 @@ public class TabletMetadata {
ensureFetched(ColumnType.LAST);
ensureFetched(ColumnType.SUSPEND);
try {
- TServerInstance current = null;
- TServerInstance future = null;
+ Location current = null;
+ Location future = null;
if (hasCurrent()) {
current = location;
} else {
@@ -389,7 +461,7 @@ public class TabletMetadata {
te.setLocationOnce(val, qual, LocationType.FUTURE);
break;
case LastLocationColumnFamily.STR_NAME:
- te.last = new Location(val, qual, LocationType.LAST);
+ te.last = Location.last(val, qual);
break;
case SuspendLocationColumn.STR_NAME:
te.suspend = SuspendingTServer.fromValue(kv.getValue());
diff --git
a/core/src/test/java/org/apache/accumulo/core/metadata/schema/TabletMetadataTest.java
b/core/src/test/java/org/apache/accumulo/core/metadata/schema/TabletMetadataTest.java
index 4f545d0140..f30ff5bd4d 100644
---
a/core/src/test/java/org/apache/accumulo/core/metadata/schema/TabletMetadataTest.java
+++
b/core/src/test/java/org/apache/accumulo/core/metadata/schema/TabletMetadataTest.java
@@ -196,7 +196,7 @@ public class TabletMetadataTest {
TabletState state = tm.getTabletState(tservers);
assertEquals(TabletState.ASSIGNED, state);
- assertEquals(ser1, tm.getLocation());
+ assertEquals(ser1, tm.getLocation().getServerInstance());
assertEquals(ser1.getSession(), tm.getLocation().getSession());
assertEquals(LocationType.FUTURE, tm.getLocation().getType());
assertFalse(tm.hasCurrent());
@@ -210,7 +210,7 @@ public class TabletMetadataTest {
tm = TabletMetadata.convertRow(rowMap.entrySet().iterator(), colsToFetch,
false);
assertEquals(TabletState.HOSTED, tm.getTabletState(tservers));
- assertEquals(ser2, tm.getLocation());
+ assertEquals(ser2, tm.getLocation().getServerInstance());
assertEquals(ser2.getSession(), tm.getLocation().getSession());
assertEquals(LocationType.CURRENT, tm.getLocation().getType());
assertTrue(tm.hasCurrent());
@@ -224,7 +224,7 @@ public class TabletMetadataTest {
tm = TabletMetadata.convertRow(rowMap.entrySet().iterator(), colsToFetch,
false);
assertEquals(TabletState.ASSIGNED_TO_DEAD_SERVER,
tm.getTabletState(tservers));
- assertEquals(deadSer, tm.getLocation());
+ assertEquals(deadSer, tm.getLocation().getServerInstance());
assertEquals(deadSer.getSession(), tm.getLocation().getSession());
assertEquals(LocationType.CURRENT, tm.getLocation().getType());
assertTrue(tm.hasCurrent());
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/manager/balancer/BalancerEnvironmentImpl.java
b/server/base/src/main/java/org/apache/accumulo/server/manager/balancer/BalancerEnvironmentImpl.java
index 485751355f..f44e290eec 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/manager/balancer/BalancerEnvironmentImpl.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/manager/balancer/BalancerEnvironmentImpl.java
@@ -24,6 +24,7 @@ import static
org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.accumulo.core.classloader.ClassLoaderUtil;
@@ -36,6 +37,7 @@ import org.apache.accumulo.core.dataImpl.TabletIdImpl;
import org.apache.accumulo.core.manager.balancer.TabletServerIdImpl;
import org.apache.accumulo.core.manager.balancer.TabletStatisticsImpl;
import org.apache.accumulo.core.manager.state.tables.TableState;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata;
import org.apache.accumulo.core.metadata.schema.TabletsMetadata;
import org.apache.accumulo.core.rpc.ThriftUtil;
import org.apache.accumulo.core.rpc.clients.ThriftClientTypes;
@@ -75,7 +77,8 @@ public class BalancerEnvironmentImpl extends
ServiceEnvironmentImpl implements B
for (var tm :
TabletsMetadata.builder(getContext()).forTable(tableId).fetch(LOCATION,
PREV_ROW)
.build()) {
tablets.put(new TabletIdImpl(tm.getExtent()),
- TabletServerIdImpl.fromThrift(tm.getLocation()));
+ TabletServerIdImpl.fromThrift(Optional.ofNullable(tm.getLocation())
+ .map(TabletMetadata.Location::getServerInstance).orElse(null)));
}
return tablets;
}
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataStateStore.java
b/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataStateStore.java
index 18a3386360..680f4d1db9 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataStateStore.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataStateStore.java
@@ -29,7 +29,7 @@ import org.apache.accumulo.core.metadata.TabletLocationState;
import org.apache.accumulo.core.metadata.schema.Ample;
import org.apache.accumulo.core.metadata.schema.Ample.TabletMutator;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
-import org.apache.accumulo.core.metadata.schema.TabletMetadata.LocationType;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.tabletserver.log.LogEntry;
import org.apache.accumulo.server.util.ManagerMetadataUtil;
import org.apache.hadoop.fs.Path;
@@ -62,10 +62,10 @@ class MetaDataStateStore implements TabletStateStore {
try (var tabletsMutator = ample.mutateTablets()) {
for (Assignment assignment : assignments) {
TabletMutator tabletMutator =
tabletsMutator.mutateTablet(assignment.tablet);
- tabletMutator.putLocation(assignment.server, LocationType.CURRENT);
+ tabletMutator.putLocation(Location.current(assignment.server));
ManagerMetadataUtil.updateLastForAssignmentMode(context, ample,
tabletMutator,
assignment.tablet, assignment.server);
- tabletMutator.deleteLocation(assignment.server, LocationType.FUTURE);
+ tabletMutator.deleteLocation(Location.future(assignment.server));
tabletMutator.deleteSuspension();
tabletMutator.mutate();
}
@@ -80,7 +80,7 @@ class MetaDataStateStore implements TabletStateStore {
try (var tabletsMutator = ample.mutateTablets()) {
for (Assignment assignment : assignments) {
tabletsMutator.mutateTablet(assignment.tablet).deleteSuspension()
- .putLocation(assignment.server, LocationType.FUTURE).mutate();
+ .putLocation(Location.future(assignment.server)).mutate();
}
} catch (RuntimeException ex) {
throw new DistributedStoreException(ex);
@@ -108,10 +108,10 @@ class MetaDataStateStore implements TabletStateStore {
TabletMutator tabletMutator = tabletsMutator.mutateTablet(tls.extent);
if (tls.current != null) {
ManagerMetadataUtil.updateLastForAssignmentMode(context, ample,
tabletMutator, tls.extent,
- tls.current);
- tabletMutator.deleteLocation(tls.current, LocationType.CURRENT);
+ tls.current.getServerInstance());
+ tabletMutator.deleteLocation(tls.current);
if (logsForDeadServers != null) {
- List<Path> logs = logsForDeadServers.get(tls.current);
+ List<Path> logs =
logsForDeadServers.get(tls.current.getServerInstance());
if (logs != null) {
for (Path log : logs) {
LogEntry entry = new LogEntry(tls.extent, 0, log.toString());
@@ -120,14 +120,14 @@ class MetaDataStateStore implements TabletStateStore {
}
}
if (suspensionTimestamp >= 0) {
- tabletMutator.putSuspension(tls.current, suspensionTimestamp);
+ tabletMutator.putSuspension(tls.current.getServerInstance(),
suspensionTimestamp);
}
}
if (tls.suspend != null && suspensionTimestamp < 0) {
tabletMutator.deleteSuspension();
}
- if (tls.future != null) {
- tabletMutator.deleteLocation(tls.future, LocationType.FUTURE);
+ if (tls.hasFuture()) {
+ tabletMutator.deleteLocation(tls.future);
}
tabletMutator.mutate();
}
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataTableScanner.java
b/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataTableScanner.java
index b554f98fa8..f6a50db58a 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataTableScanner.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataTableScanner.java
@@ -52,6 +52,7 @@ import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.La
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.LogColumnFamily;
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.SuspendLocationColumn;
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.TabletColumnFamily;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.util.cleaner.CleanerUtil;
import org.apache.hadoop.io.Text;
@@ -145,9 +146,9 @@ public class MetaDataTableScanner implements
ClosableIterator<TabletLocationStat
throws IOException, BadLocationStateException {
final SortedMap<Key,Value> decodedRow = WholeRowIterator.decodeRow(k, v);
KeyExtent extent = null;
- TServerInstance future = null;
- TServerInstance current = null;
- TServerInstance last = null;
+ Location future = null;
+ Location current = null;
+ Location last = null;
SuspendingTServer suspend = null;
long lastTimestamp = 0;
List<Collection<String>> walogs = new ArrayList<>();
@@ -161,14 +162,14 @@ public class MetaDataTableScanner implements
ClosableIterator<TabletLocationStat
Text cq = key.getColumnQualifier();
if (cf.compareTo(FutureLocationColumnFamily.NAME) == 0) {
- TServerInstance location = new TServerInstance(entry.getValue(), cq);
+ Location location = Location.future(new
TServerInstance(entry.getValue(), cq));
if (future != null) {
throw new BadLocationStateException("found two assignments for the
same extent " + row
+ ": " + future + " and " + location, row);
}
future = location;
} else if (cf.compareTo(CurrentLocationColumnFamily.NAME) == 0) {
- TServerInstance location = new TServerInstance(entry.getValue(), cq);
+ Location location = Location.current(new
TServerInstance(entry.getValue(), cq));
if (current != null) {
throw new BadLocationStateException("found two locations for the
same extent " + row
+ ": " + current + " and " + location, row);
@@ -179,7 +180,7 @@ public class MetaDataTableScanner implements
ClosableIterator<TabletLocationStat
walogs.add(Arrays.asList(split));
} else if (cf.compareTo(LastLocationColumnFamily.NAME) == 0) {
if (lastTimestamp < entry.getKey().getTimestamp()) {
- last = new TServerInstance(entry.getValue(), cq);
+ last = Location.last(new TServerInstance(entry.getValue(), cq));
}
} else if (cf.compareTo(ChoppedColumnFamily.NAME) == 0) {
chopped = true;
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/manager/state/ZooTabletStateStore.java
b/server/base/src/main/java/org/apache/accumulo/server/manager/state/ZooTabletStateStore.java
index 4cee8f8e23..0930b6c34f 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/manager/state/ZooTabletStateStore.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/manager/state/ZooTabletStateStore.java
@@ -69,9 +69,9 @@ class ZooTabletStateStore implements TabletStateStore {
TabletMetadata rootMeta = ample.readTablet(RootTable.EXTENT,
ReadConsistency.EVENTUAL);
- TServerInstance currentSession = null;
- TServerInstance futureSession = null;
- TServerInstance lastSession = null;
+ Location currentSession = null;
+ Location futureSession = null;
+ Location lastSession = null;
Location loc = rootMeta.getLocation();
@@ -122,7 +122,7 @@ class ZooTabletStateStore implements TabletStateStore {
}
TabletMutator tabletMutator = ample.mutateTablet(assignment.tablet);
- tabletMutator.putLocation(assignment.server, LocationType.FUTURE);
+ tabletMutator.putLocation(Location.future(assignment.server));
tabletMutator.mutate();
}
@@ -137,10 +137,10 @@ class ZooTabletStateStore implements TabletStateStore {
}
TabletMutator tabletMutator = ample.mutateTablet(assignment.tablet);
- tabletMutator.putLocation(assignment.server, LocationType.CURRENT);
+ tabletMutator.putLocation(Location.current(assignment.server));
ManagerMetadataUtil.updateLastForAssignmentMode(context, ample,
tabletMutator,
assignment.tablet, assignment.server);
- tabletMutator.deleteLocation(assignment.server, LocationType.FUTURE);
+ tabletMutator.deleteLocation(Location.future(assignment.server));
tabletMutator.mutate();
}
@@ -157,13 +157,14 @@ class ZooTabletStateStore implements TabletStateStore {
}
TabletMutator tabletMutator = ample.mutateTablet(tls.extent);
+ final TServerInstance futureOrCurrent =
tls.futureOrCurrent().getServerInstance();
- tabletMutator.deleteLocation(tls.futureOrCurrent(), LocationType.FUTURE);
- tabletMutator.deleteLocation(tls.futureOrCurrent(), LocationType.CURRENT);
+ tabletMutator.deleteLocation(Location.future(futureOrCurrent));
+ tabletMutator.deleteLocation(Location.current(futureOrCurrent));
ManagerMetadataUtil.updateLastForAssignmentMode(context, ample,
tabletMutator, tls.extent,
- tls.futureOrCurrent());
+ futureOrCurrent);
if (logsForDeadServers != null) {
- List<Path> logs = logsForDeadServers.get(tls.futureOrCurrent());
+ List<Path> logs = logsForDeadServers.get(futureOrCurrent);
if (logs != null) {
for (Path entry : logs) {
LogEntry logEntry =
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/GroupBalancer.java
b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/GroupBalancer.java
index edf5b4ad9e..b25198867c 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/GroupBalancer.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/GroupBalancer.java
@@ -94,7 +94,7 @@ public abstract class GroupBalancer extends TabletBalancer {
Map<KeyExtent,TServerInstance> tablets = new LinkedHashMap<>();
for (var tm :
TabletsMetadata.builder(context).forTable(tableId).fetch(LOCATION, PREV_ROW)
.build()) {
- tablets.put(tm.getExtent(), tm.getLocation());
+ tablets.put(tm.getExtent(), tm.getLocation().getServerInstance());
}
return tablets;
}
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/metadata/TabletMutatorBase.java
b/server/base/src/main/java/org/apache/accumulo/server/metadata/TabletMutatorBase.java
index 35bac3ab28..065a0bdbf9 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/metadata/TabletMutatorBase.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/metadata/TabletMutatorBase.java
@@ -45,6 +45,7 @@ import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.Se
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.SuspendLocationColumn;
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.TabletColumnFamily;
import org.apache.accumulo.core.metadata.schema.MetadataTime;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.metadata.schema.TabletMetadata.LocationType;
import org.apache.accumulo.core.tabletserver.log.LogEntry;
import org.apache.accumulo.server.ServerContext;
@@ -142,16 +143,17 @@ public abstract class TabletMutatorBase implements
Ample.TabletMutator {
}
@Override
- public Ample.TabletMutator putLocation(TServerInstance tsi, LocationType
type) {
+ public Ample.TabletMutator putLocation(Location location) {
Preconditions.checkState(updatesEnabled, "Cannot make updates after
calling mutate.");
- mutation.put(getLocationFamily(type), tsi.getSession(), tsi.getHostPort());
+ mutation.put(getLocationFamily(location.getType()), location.getSession(),
+ location.getHostPort());
return this;
}
@Override
- public Ample.TabletMutator deleteLocation(TServerInstance tsi, LocationType
type) {
+ public Ample.TabletMutator deleteLocation(Location location) {
Preconditions.checkState(updatesEnabled, "Cannot make updates after
calling mutate.");
- mutation.putDelete(getLocationFamily(type), tsi.getSession());
+ mutation.putDelete(getLocationFamily(location.getType()),
location.getSession());
return this;
}
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/util/ManagerMetadataUtil.java
b/server/base/src/main/java/org/apache/accumulo/server/util/ManagerMetadataUtil.java
index 810c3f5f20..0ee5996ed9 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/util/ManagerMetadataUtil.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/util/ManagerMetadataUtil.java
@@ -56,7 +56,7 @@ import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.DataFileColumnFamily;
import org.apache.accumulo.core.metadata.schema.MetadataTime;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
-import org.apache.accumulo.core.metadata.schema.TabletMetadata.LocationType;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.server.ServerContext;
import org.apache.hadoop.io.Text;
@@ -69,7 +69,7 @@ public class ManagerMetadataUtil {
private static final Logger log =
LoggerFactory.getLogger(ManagerMetadataUtil.class);
public static void addNewTablet(ServerContext context, KeyExtent extent,
String dirName,
- TServerInstance location, Map<StoredTabletFile,DataFileValue>
datafileSizes,
+ TServerInstance tServerInstance, Map<StoredTabletFile,DataFileValue>
datafileSizes,
Map<Long,? extends Collection<TabletFile>> bulkLoadedFiles, MetadataTime
time,
long lastFlushID, long lastCompactID, ServiceLock zooLock) {
@@ -87,9 +87,9 @@ public class ManagerMetadataUtil {
tablet.putCompactionId(lastCompactID);
}
- if (location != null) {
- tablet.putLocation(location, LocationType.CURRENT);
- tablet.deleteLocation(location, LocationType.FUTURE);
+ if (tServerInstance != null) {
+ tablet.putLocation(Location.current(tServerInstance));
+ tablet.deleteLocation(Location.future(tServerInstance));
}
datafileSizes.forEach(tablet::putFile);
@@ -190,7 +190,7 @@ public class ManagerMetadataUtil {
public static void replaceDatafiles(ServerContext context, KeyExtent extent,
Set<StoredTabletFile> datafilesToDelete, Set<StoredTabletFile> scanFiles,
Optional<StoredTabletFile> path, Long compactionId, DataFileValue size,
String address,
- TServerInstance lastLocation, ServiceLock zooLock,
Optional<ExternalCompactionId> ecid) {
+ Location lastLocation, ServiceLock zooLock,
Optional<ExternalCompactionId> ecid) {
context.getAmple().putGcCandidates(extent.tableId(), datafilesToDelete);
@@ -223,7 +223,7 @@ public class ManagerMetadataUtil {
*/
public static Optional<StoredTabletFile> updateTabletDataFile(ServerContext
context,
KeyExtent extent, TabletFile newDatafile, DataFileValue dfv,
MetadataTime time,
- String address, ServiceLock zooLock, Set<String> unusedWalLogs,
TServerInstance lastLocation,
+ String address, ServiceLock zooLock, Set<String> unusedWalLogs, Location
lastLocation,
long flushId) {
TabletMutator tablet = context.getAmple().mutateTablet(extent);
@@ -264,8 +264,8 @@ public class ManagerMetadataUtil {
// location value
if
("assignment".equals(context.getConfiguration().get(Property.TSERV_LAST_LOCATION_MODE)))
{
TabletMetadata lastMetadata = ample.readTablet(extent,
TabletMetadata.ColumnType.LAST);
- TServerInstance lastLocation = (lastMetadata == null ? null :
lastMetadata.getLast());
- ManagerMetadataUtil.updateLast(tabletMutator, lastLocation, location);
+ Location lastLocation = (lastMetadata == null ? null :
lastMetadata.getLast());
+ ManagerMetadataUtil.updateLocation(tabletMutator, lastLocation,
Location.last(location));
}
}
@@ -280,31 +280,31 @@ public class ManagerMetadataUtil {
* @param zooLock The zookeeper lock
*/
public static void updateLastForCompactionMode(ClientContext context,
TabletMutator tabletMutator,
- TServerInstance lastLocation, String address, ServiceLock zooLock) {
+ Location lastLocation, String address, ServiceLock zooLock) {
// if the location mode is 'compaction', then preserve the current
compaction location in the
// last location value
if
("compaction".equals(context.getConfiguration().get(Property.TSERV_LAST_LOCATION_MODE)))
{
- TServerInstance newLocation = getTServerInstance(address, zooLock);
- updateLast(tabletMutator, lastLocation, newLocation);
+ Location newLocation = Location.last(getTServerInstance(address,
zooLock));
+ updateLocation(tabletMutator, lastLocation, newLocation);
}
}
/**
- * Update the last location, deleting the previous location if needed
+ * Update the location, deleting the previous location if needed
*
* @param tabletMutator The mutator being built
- * @param lastLocation The last location (may be null)
+ * @param previousLocation The location (may be null)
* @param newLocation The new location
*/
- public static void updateLast(TabletMutator tabletMutator, TServerInstance
lastLocation,
- TServerInstance newLocation) {
- if (lastLocation != null) {
- if (!lastLocation.equals(newLocation)) {
- tabletMutator.deleteLocation(lastLocation, LocationType.LAST);
- tabletMutator.putLocation(newLocation, LocationType.LAST);
+ private static void updateLocation(TabletMutator tabletMutator, Location
previousLocation,
+ Location newLocation) {
+ if (previousLocation != null) {
+ if (!previousLocation.equals(newLocation)) {
+ tabletMutator.deleteLocation(previousLocation);
+ tabletMutator.putLocation(newLocation);
}
} else {
- tabletMutator.putLocation(newLocation, LocationType.LAST);
+ tabletMutator.putLocation(newLocation);
}
}
}
diff --git
a/server/base/src/test/java/org/apache/accumulo/server/manager/state/RootTabletStateStoreTest.java
b/server/base/src/test/java/org/apache/accumulo/server/manager/state/RootTabletStateStoreTest.java
index 0de924dfc5..e5ba3fec83 100644
---
a/server/base/src/test/java/org/apache/accumulo/server/manager/state/RootTabletStateStoreTest.java
+++
b/server/base/src/test/java/org/apache/accumulo/server/manager/state/RootTabletStateStoreTest.java
@@ -40,6 +40,7 @@ import org.apache.accumulo.core.metadata.schema.Ample;
import org.apache.accumulo.core.metadata.schema.RootTabletMetadata;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.metadata.schema.TabletsMetadata;
import org.apache.accumulo.core.util.HostAndPort;
import org.apache.accumulo.server.MockServerContext;
@@ -102,7 +103,7 @@ public class RootTabletStateStoreTest {
int count = 0;
for (TabletLocationState location : tstore) {
assertEquals(location.extent, root);
- assertEquals(location.future, server);
+ assertEquals(location.future.getServerInstance(), server);
assertNull(location.current);
count++;
}
@@ -112,13 +113,14 @@ public class RootTabletStateStoreTest {
for (TabletLocationState location : tstore) {
assertEquals(location.extent, root);
assertNull(location.future);
- assertEquals(location.current, server);
+ assertEquals(location.current.getServerInstance(), server);
count++;
}
assertEquals(count, 1);
TabletLocationState assigned = null;
try {
- assigned = new TabletLocationState(root, server, null, null, null, null,
false);
+ assigned =
+ new TabletLocationState(root, Location.future(server), null, null,
null, null, false);
} catch (BadLocationStateException e) {
fail("Unexpected error " + e);
}
@@ -140,7 +142,7 @@ public class RootTabletStateStoreTest {
try {
TabletLocationState broken =
- new TabletLocationState(notRoot, server, null, null, null, null,
false);
+ new TabletLocationState(notRoot, Location.future(server), null,
null, null, null, false);
final var assignmentList1 = List.of(broken);
assertThrows(IllegalArgumentException.class, () ->
tstore.unassign(assignmentList1, null));
} catch (BadLocationStateException e) {
diff --git
a/server/base/src/test/java/org/apache/accumulo/server/manager/state/TabletLocationStateTest.java
b/server/base/src/test/java/org/apache/accumulo/server/manager/state/TabletLocationStateTest.java
index cb714fbca5..c6e21bbe97 100644
---
a/server/base/src/test/java/org/apache/accumulo/server/manager/state/TabletLocationStateTest.java
+++
b/server/base/src/test/java/org/apache/accumulo/server/manager/state/TabletLocationStateTest.java
@@ -35,6 +35,7 @@ import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.TabletLocationState;
import org.apache.accumulo.core.metadata.TabletState;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.hadoop.io.Text;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
@@ -51,17 +52,17 @@ public class TabletLocationStateTest {
}
private KeyExtent keyExtent;
- private TServerInstance future;
- private TServerInstance current;
- private TServerInstance last;
+ private Location future;
+ private Location current;
+ private Location last;
private TabletLocationState tls;
@BeforeEach
public void setUp() {
keyExtent = createMock(KeyExtent.class);
- future = createMock(TServerInstance.class);
- current = createMock(TServerInstance.class);
- last = createMock(TServerInstance.class);
+ future = Location.future(createMock(TServerInstance.class));
+ current = Location.current(createMock(TServerInstance.class));
+ last = Location.last(createMock(TServerInstance.class));
}
@Test
@@ -141,7 +142,7 @@ public class TabletLocationStateTest {
@Test
public void testGetState_Assigned() throws Exception {
Set<TServerInstance> liveServers = new java.util.HashSet<>();
- liveServers.add(future);
+ liveServers.add(future.getServerInstance());
tls = new TabletLocationState(keyExtent, future, null, last, null, walogs,
true);
assertEquals(TabletState.ASSIGNED, tls.getState(liveServers));
}
@@ -149,7 +150,7 @@ public class TabletLocationStateTest {
@Test
public void testGetState_Hosted() throws Exception {
Set<TServerInstance> liveServers = new java.util.HashSet<>();
- liveServers.add(current);
+ liveServers.add(current.getServerInstance());
tls = new TabletLocationState(keyExtent, null, current, last, null,
walogs, true);
assertEquals(TabletState.HOSTED, tls.getState(liveServers));
}
@@ -157,7 +158,7 @@ public class TabletLocationStateTest {
@Test
public void testGetState_Dead1() throws Exception {
Set<TServerInstance> liveServers = new java.util.HashSet<>();
- liveServers.add(current);
+ liveServers.add(current.getServerInstance());
tls = new TabletLocationState(keyExtent, future, null, last, null, walogs,
true);
assertEquals(TabletState.ASSIGNED_TO_DEAD_SERVER,
tls.getState(liveServers));
}
@@ -165,7 +166,7 @@ public class TabletLocationStateTest {
@Test
public void testGetState_Dead2() throws Exception {
Set<TServerInstance> liveServers = new java.util.HashSet<>();
- liveServers.add(future);
+ liveServers.add(future.getServerInstance());
tls = new TabletLocationState(keyExtent, null, current, last, null,
walogs, true);
assertEquals(TabletState.ASSIGNED_TO_DEAD_SERVER,
tls.getState(liveServers));
}
diff --git
a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
index 631e6ca531..75c294c519 100644
---
a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
+++
b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
@@ -306,7 +306,7 @@ public class GarbageCollectWriteAheadLogs {
// Tablet is still assigned to a dead server. Manager has moved markers
and reassigned it
// Easiest to just ignore all the WALs for the dead server.
if (state.getState(liveServers) == TabletState.ASSIGNED_TO_DEAD_SERVER) {
- Set<UUID> idsToIgnore = candidates.remove(state.current);
+ Set<UUID> idsToIgnore =
candidates.remove(state.current.getServerInstance());
if (idsToIgnore != null) {
result.keySet().removeAll(idsToIgnore);
recoveryLogs.keySet().removeAll(idsToIgnore);
diff --git
a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java
b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java
index 2027f35477..d9c69da11f 100644
---
a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java
+++
b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java
@@ -36,6 +36,7 @@ import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.TabletLocationState;
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.ReplicationSection;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.replication.ReplicationSchema;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.util.Pair;
@@ -73,10 +74,10 @@ public class GarbageCollectWriteAheadLogsTest {
{
try {
- tabletAssignedToServer1 =
- new TabletLocationState(extent, null, server1, null, null, walogs,
false);
- tabletAssignedToServer2 =
- new TabletLocationState(extent, null, server2, null, null, walogs,
false);
+ tabletAssignedToServer1 = new TabletLocationState(extent, null,
Location.current(server1),
+ null, null, walogs, false);
+ tabletAssignedToServer2 = new TabletLocationState(extent, null,
Location.current(server2),
+ null, null, walogs, false);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
index 5c5a5ad203..69fceb3b14 100644
--- a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
+++ b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
@@ -629,7 +629,7 @@ public class Manager extends AbstractServer
return TabletGoalState.UNASSIGNED;
}
- if (tls.current != null && serversToShutdown.contains(tls.current)) {
+ if (tls.current != null &&
serversToShutdown.contains(tls.current.getServerInstance())) {
return TabletGoalState.SUSPENDED;
}
// Handle merge transitions
@@ -670,7 +670,7 @@ public class Manager extends AbstractServer
if (state == TabletGoalState.HOSTED) {
// Maybe this tablet needs to be migrated
TServerInstance dest = migrations.get(extent);
- if (dest != null && tls.current != null && !dest.equals(tls.current)) {
+ if (dest != null && tls.current != null &&
!dest.equals(tls.current.getServerInstance())) {
return TabletGoalState.UNASSIGNED;
}
}
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java
b/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java
index c1ce939c9e..5d04d9c2ec 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java
@@ -201,7 +201,7 @@ public class ManagerClientServiceHandler implements
ManagerClientService.Iface {
if ((tablet.hasCurrent() || logs > 0) &&
tablet.getFlushId().orElse(-1) < flushID) {
tabletsToWaitFor++;
if (tablet.hasCurrent()) {
- serversToFlush.add(tablet.getLocation());
+ serversToFlush.add(tablet.getLocation().getServerInstance());
}
}
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
index 2003c158f3..593d09438f 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
@@ -240,11 +240,11 @@ abstract class TabletGroupWatcher extends
AccumuloDaemonThread {
return mStats != null ? mStats : new MergeStats(new MergeInfo());
});
TabletGoalState goal = manager.getGoalState(tls,
mergeStats.getMergeInfo());
- TServerInstance location = tls.getLocation();
+ TServerInstance location = tls.getServer();
TabletState state = tls.getState(currentTServers.keySet());
- TabletLogger.missassigned(tls.extent, goal.toString(),
state.toString(), tls.future,
- tls.current, tls.walogs.size());
+ TabletLogger.missassigned(tls.extent, goal.toString(),
state.toString(),
+ tls.getFutureServer(), tls.getCurrentServer(),
tls.walogs.size());
stats.update(tableId, state);
mergeStats.update(tls.extent, state, tls.chopped,
!tls.walogs.isEmpty());
@@ -286,7 +286,7 @@ abstract class TabletGroupWatcher extends
AccumuloDaemonThread {
break;
case ASSIGNED:
// Send another reminder
- tLists.assigned.add(new Assignment(tls.extent, tls.future));
+ tLists.assigned.add(new Assignment(tls.extent,
tls.getFutureServer()));
break;
}
} else {
@@ -374,9 +374,9 @@ abstract class TabletGroupWatcher extends
AccumuloDaemonThread {
private void unassignDeadTablet(TabletLists tLists, TabletLocationState tls,
WalStateManager wals)
throws WalMarkerException {
tLists.assignedToDeadServers.add(tls);
- if (!tLists.logsForDeadServers.containsKey(tls.futureOrCurrent())) {
- tLists.logsForDeadServers.put(tls.futureOrCurrent(),
- wals.getWalsInUse(tls.futureOrCurrent()));
+ if (!tLists.logsForDeadServers.containsKey(tls.futureOrCurrentServer())) {
+ tLists.logsForDeadServers.put(tls.futureOrCurrentServer(),
+ wals.getWalsInUse(tls.futureOrCurrentServer()));
}
}
@@ -431,7 +431,7 @@ abstract class TabletGroupWatcher extends
AccumuloDaemonThread {
if (location.equals(manager.migrations.get(tls.extent))) {
manager.migrations.remove(tls.extent);
}
- TServerInstance tserver = tls.futureOrCurrent();
+ TServerInstance tserver = tls.futureOrCurrentServer();
if (!tLists.logsForDeadServers.containsKey(tserver)) {
tLists.logsForDeadServers.put(tserver, wals.getWalsInUse(tserver));
}
@@ -542,7 +542,7 @@ abstract class TabletGroupWatcher extends
AccumuloDaemonThread {
}
try {
TServerConnection conn;
- conn = manager.tserverSet.getConnection(tls.current);
+ conn = manager.tserverSet.getConnection(tls.getCurrentServer());
if (conn != null) {
Manager.log.info("Asking {} to split {} at {}", tls.current,
tls.extent, splitPoint);
conn.splitTablet(tls.extent, splitPoint);
@@ -575,7 +575,7 @@ abstract class TabletGroupWatcher extends
AccumuloDaemonThread {
if (info.needsToBeChopped(tls.extent)) {
TServerConnection conn;
try {
- conn = manager.tserverSet.getConnection(tls.current);
+ conn = manager.tserverSet.getConnection(tls.getCurrentServer());
if (conn != null) {
Manager.log.info("Asking {} to chop {}", tls.current, tls.extent);
conn.chop(manager.managerLock, tls.extent);
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFiles.java
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFiles.java
index a9cb992b15..d889bbd7dd 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFiles.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFiles.java
@@ -53,6 +53,7 @@ import org.apache.accumulo.core.metadata.TabletFile;
import org.apache.accumulo.core.metadata.schema.DataFileValue;
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.DataFileColumnFamily;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.metadata.schema.TabletsMetadata;
import org.apache.accumulo.core.rpc.ThriftUtil;
import org.apache.accumulo.core.rpc.clients.ThriftClientTypes;
@@ -209,7 +210,7 @@ class LoadFiles extends ManagerRepo {
// send files to tablet sever
// ideally there should only be one tablet location to send all the
files
- TabletMetadata.Location location = tablet.getLocation();
+ Location location = tablet.getLocation();
HostAndPort server = null;
if (location == null) {
locationLess++;
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactionDriver.java
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactionDriver.java
index e0c250452f..cf2b669030 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactionDriver.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactionDriver.java
@@ -110,7 +110,7 @@ class CompactionDriver extends ManagerRepo {
if (tablet.getCompactId().orElse(-1) < compactId) {
tabletsToWaitFor++;
if (tablet.hasCurrent()) {
- serversToFlush.increment(tablet.getLocation(), 1);
+ serversToFlush.increment(tablet.getLocation().getServerInstance(),
1);
}
}
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader9to10.java
b/server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader9to10.java
index 45b281aa6e..7156e0005e 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader9to10.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader9to10.java
@@ -70,7 +70,7 @@ import
org.apache.accumulo.core.metadata.schema.MetadataSchema.DeletesSection.Sk
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.DataFileColumnFamily;
import org.apache.accumulo.core.metadata.schema.MetadataTime;
import org.apache.accumulo.core.metadata.schema.RootTabletMetadata;
-import org.apache.accumulo.core.metadata.schema.TabletMetadata.LocationType;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.spi.compaction.SimpleCompactionDispatcher;
import org.apache.accumulo.core.spi.crypto.NoCryptoServiceFactory;
@@ -289,15 +289,15 @@ public class Upgrader9to10 implements Upgrader {
tabletMutator.putDirName(upgradeDirColumn(dir));
if (last != null) {
- tabletMutator.putLocation(last, LocationType.LAST);
+ tabletMutator.putLocation(Location.last(last));
}
if (future != null) {
- tabletMutator.putLocation(future, LocationType.FUTURE);
+ tabletMutator.putLocation(Location.future(future));
}
if (current != null) {
- tabletMutator.putLocation(current, LocationType.CURRENT);
+ tabletMutator.putLocation(Location.current(current));
}
logs.forEach(tabletMutator::putWal);
diff --git
a/server/tserver/src/main/java/org/apache/accumulo/tserver/AssignmentHandler.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/AssignmentHandler.java
index af5f7d3e72..1c629a321a 100644
---
a/server/tserver/src/main/java/org/apache/accumulo/tserver/AssignmentHandler.java
+++
b/server/tserver/src/main/java/org/apache/accumulo/tserver/AssignmentHandler.java
@@ -33,6 +33,7 @@ import
org.apache.accumulo.core.manager.thrift.TabletLoadState;
import org.apache.accumulo.core.metadata.RootTable;
import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.util.threads.ThreadPools;
import org.apache.accumulo.core.util.threads.Threads;
import org.apache.accumulo.server.manager.state.Assignment;
@@ -275,10 +276,10 @@ class AssignmentHandler implements Runnable {
METADATA_ISSUE + "metadata entry does not have time (" +
meta.getExtent() + ")");
}
- TabletMetadata.Location loc = meta.getLocation();
+ Location loc = meta.getLocation();
if (!ignoreLocationCheck && (loc == null || loc.getType() !=
TabletMetadata.LocationType.FUTURE
- || !instance.equals(loc))) {
+ || !instance.equals(loc.getServerInstance()))) {
log.info(METADATA_ISSUE + "Unexpected location {} {}", extent, loc);
return false;
}
diff --git
a/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java
index 5b79f231ba..0b3c611a05 100644
---
a/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java
+++
b/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java
@@ -26,6 +26,7 @@ import
org.apache.accumulo.core.manager.thrift.TabletLoadState;
import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.TabletLocationState;
import
org.apache.accumulo.core.metadata.TabletLocationState.BadLocationStateException;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.tabletserver.thrift.TUnloadTabletGoal;
import org.apache.accumulo.server.manager.state.DistributedStoreException;
import org.apache.accumulo.server.manager.state.TabletStateStore;
@@ -111,7 +112,8 @@ class UnloadTabletHandler implements Runnable {
new TServerInstance(server.clientAddress,
server.getLock().getSessionId());
TabletLocationState tls = null;
try {
- tls = new TabletLocationState(extent, null, instance, null, null,
null, false);
+ tls = new TabletLocationState(extent, null,
Location.current(instance), null, null, null,
+ false);
} catch (BadLocationStateException e) {
log.error("Unexpected error", e);
}
diff --git
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
index d50eb2e92c..44adfcc38d 100644
---
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
+++
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
@@ -39,10 +39,10 @@ import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.core.logging.TabletLogger;
import org.apache.accumulo.core.metadata.StoredTabletFile;
-import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.TabletFile;
import org.apache.accumulo.core.metadata.schema.DataFileValue;
import org.apache.accumulo.core.metadata.schema.ExternalCompactionId;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.trace.TraceUtil;
import org.apache.accumulo.core.util.MapCounter;
import org.apache.accumulo.core.util.Pair;
@@ -457,7 +457,7 @@ class DatafileManager {
rename(vm, tmpDatafile.getPath(), newDatafile.getPath());
}
- TServerInstance lastLocation = null;
+ Location lastLocation = null;
Optional<StoredTabletFile> newFile;
if (dfv.getNumEntries() > 0) {
diff --git
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 1ff062b08b..5c4b7d40db 100644
---
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -72,7 +72,6 @@ import
org.apache.accumulo.core.manager.state.tables.TableState;
import org.apache.accumulo.core.master.thrift.BulkImportState;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.StoredTabletFile;
-import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.TabletFile;
import org.apache.accumulo.core.metadata.schema.DataFileValue;
import org.apache.accumulo.core.metadata.schema.ExternalCompactionId;
@@ -81,6 +80,7 @@ import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.Se
import org.apache.accumulo.core.metadata.schema.MetadataTime;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.protobuf.ProtobufUtil;
import org.apache.accumulo.core.sample.impl.SamplerConfigurationImpl;
import org.apache.accumulo.core.security.Authorizations;
@@ -153,7 +153,7 @@ public class Tablet extends TabletBase {
private final Object timeLock = new Object();
private long persistedTime;
- private TServerInstance lastLocation = null;
+ private Location lastLocation = null;
private volatile Set<Path> checkedTabletDirs = new ConcurrentSkipListSet<>();
private final AtomicLong dataSourceDeletions = new AtomicLong(0);
@@ -2110,8 +2110,8 @@ public class Tablet extends TabletBase {
computeNumEntries();
}
- public TServerInstance resetLastLocation() {
- TServerInstance result = lastLocation;
+ public Location resetLastLocation() {
+ Location result = lastLocation;
lastLocation = null;
return result;
}
diff --git
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletData.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletData.java
index 1126d54a5e..16147151ae 100644
---
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletData.java
+++
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletData.java
@@ -27,13 +27,13 @@ import java.util.SortedMap;
import java.util.TreeMap;
import org.apache.accumulo.core.metadata.StoredTabletFile;
-import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.TabletFile;
import org.apache.accumulo.core.metadata.schema.DataFileValue;
import org.apache.accumulo.core.metadata.schema.ExternalCompactionId;
import org.apache.accumulo.core.metadata.schema.ExternalCompactionMetadata;
import org.apache.accumulo.core.metadata.schema.MetadataTime;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.tabletserver.log.LogEntry;
/*
@@ -46,7 +46,7 @@ public class TabletData {
private HashSet<StoredTabletFile> scanFiles = new HashSet<>();
private long flushID = -1;
private long compactID = -1;
- private TServerInstance lastLocation = null;
+ private Location lastLocation = null;
private Map<Long,List<TabletFile>> bulkImported = new HashMap<>();
private long splitTime = 0;
private String directoryName = null;
@@ -77,7 +77,7 @@ public class TabletData {
// Data pulled from an existing tablet to make a split
public TabletData(String dirName, SortedMap<StoredTabletFile,DataFileValue>
highDatafileSizes,
- MetadataTime time, long lastFlushID, long lastCompactID, TServerInstance
lastLocation,
+ MetadataTime time, long lastFlushID, long lastCompactID, Location
lastLocation,
Map<Long,List<TabletFile>> bulkIngestedFiles) {
this.directoryName = dirName;
this.dataFiles = highDatafileSizes;
@@ -114,7 +114,7 @@ public class TabletData {
return compactID;
}
- public TServerInstance getLastLocation() {
+ public Location getLastLocation() {
return lastLocation;
}
diff --git
a/shell/src/main/java/org/apache/accumulo/shell/commands/ListTabletsCommand.java
b/shell/src/main/java/org/apache/accumulo/shell/commands/ListTabletsCommand.java
index 3ee8630646..71b2a18b75 100644
---
a/shell/src/main/java/org/apache/accumulo/shell/commands/ListTabletsCommand.java
+++
b/shell/src/main/java/org/apache/accumulo/shell/commands/ListTabletsCommand.java
@@ -37,6 +37,7 @@ import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.schema.DataFileValue;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.metadata.schema.TabletsMetadata;
import org.apache.accumulo.core.util.NumUtil;
import org.apache.accumulo.shell.Shell;
@@ -422,7 +423,7 @@ public class ListTabletsCommand extends Command {
return this;
}
- public Factory location(TabletMetadata.Location location) {
+ public Factory location(Location location) {
if (location == null) {
this.location = "None";
} else {
diff --git
a/shell/src/test/java/org/apache/accumulo/shell/commands/ListTabletsCommandTest.java
b/shell/src/test/java/org/apache/accumulo/shell/commands/ListTabletsCommandTest.java
index 93da84a38f..583819b96b 100644
---
a/shell/src/test/java/org/apache/accumulo/shell/commands/ListTabletsCommandTest.java
+++
b/shell/src/test/java/org/apache/accumulo/shell/commands/ListTabletsCommandTest.java
@@ -35,7 +35,7 @@ import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.core.metadata.TabletState;
-import org.apache.accumulo.core.metadata.schema.TabletMetadata;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.shell.Shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
@@ -91,8 +91,7 @@ public class ListTabletsCommandTest {
KeyExtent ke1 = new KeyExtent(tableId, new Text("a"), null);
KeyExtent ke2 = new KeyExtent(tableId, new Text("m"), new Text("a"));
KeyExtent ke3 = new KeyExtent(tableId, null, new Text("m"));
- TabletMetadata.Location loc =
- new TabletMetadata.Location("localhost", "",
TabletMetadata.LocationType.CURRENT);
+ Location loc = Location.current("localhost", "");
ListTabletsCommand.TabletRowInfo.Factory factory =
new ListTabletsCommand.TabletRowInfo.Factory(tableName,
ke1).dir("t-dir1").numFiles(1)
.numWalLogs(1).numEntries(1).size(100).status(TabletState.HOSTED.toString())
@@ -169,8 +168,7 @@ public class ListTabletsCommandTest {
Text startRow = new Text("a");
Text endRow = new Text("z");
KeyExtent ke = new KeyExtent(id, endRow, startRow);
- TabletMetadata.Location loc =
- new TabletMetadata.Location("localhost", "",
TabletMetadata.LocationType.CURRENT);
+ Location loc = Location.current("localhost", "");
ListTabletsCommand.TabletRowInfo.Factory factory =
new ListTabletsCommand.TabletRowInfo.Factory("aName",
ke).numFiles(1).numWalLogs(2)
.numEntries(3).size(4).status(TabletState.HOSTED.toString()).location(loc)
diff --git
a/test/src/main/java/org/apache/accumulo/test/ManagerRepairsDualAssignmentIT.java
b/test/src/main/java/org/apache/accumulo/test/ManagerRepairsDualAssignmentIT.java
index e8263478e6..dcaced8278 100644
---
a/test/src/main/java/org/apache/accumulo/test/ManagerRepairsDualAssignmentIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/ManagerRepairsDualAssignmentIT.java
@@ -36,11 +36,10 @@ import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.RootTable;
-import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.TabletLocationState;
import org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
import org.apache.accumulo.core.metadata.schema.Ample.TabletMutator;
-import org.apache.accumulo.core.metadata.schema.TabletMetadata.LocationType;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata;
import org.apache.accumulo.core.security.TablePermission;
import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.ServerType;
@@ -86,7 +85,7 @@ public class ManagerRepairsDualAssignmentIT extends
ConfigurableMacBase {
NewTableConfiguration ntc = new
NewTableConfiguration().withSplits(partitions);
c.tableOperations().create(table, ntc);
// scan the metadata table and get the two table location states
- Set<TServerInstance> states = new HashSet<>();
+ Set<TabletMetadata.Location> states = new HashSet<>();
Set<TabletLocationState> oldLocations = new HashSet<>();
TabletStateStore store =
TabletStateStore.getStoreForLevel(DataLevel.USER, context);
while (states.size() < 2) {
@@ -103,7 +102,7 @@ public class ManagerRepairsDualAssignmentIT extends
ConfigurableMacBase {
// Kill a tablet server... we don't care which one... wait for
everything to be reassigned
cluster.killProcess(ServerType.TABLET_SERVER,
cluster.getProcesses().get(ServerType.TABLET_SERVER).iterator().next());
- Set<TServerInstance> replStates = new HashSet<>();
+ Set<TabletMetadata.Location> replStates = new HashSet<>();
@SuppressWarnings("deprecation")
TableId repTable =
org.apache.accumulo.core.replication.ReplicationTable.ID;
// Find out which tablet server remains
@@ -138,14 +137,14 @@ public class ManagerRepairsDualAssignmentIT extends
ConfigurableMacBase {
assertNotEquals(null, moved);
// throw a mutation in as if we were the dying tablet
TabletMutator tabletMutator =
serverContext.getAmple().mutateTablet(moved.extent);
- tabletMutator.putLocation(moved.current, LocationType.CURRENT);
+ tabletMutator.putLocation(moved.current);
tabletMutator.mutate();
// wait for the manager to fix the problem
waitForCleanStore(store);
// now jam up the metadata table
tabletMutator =
serverContext.getAmple().mutateTablet(new
KeyExtent(MetadataTable.ID, null, null));
- tabletMutator.putLocation(moved.current, LocationType.CURRENT);
+ tabletMutator.putLocation(moved.current);
tabletMutator.mutate();
waitForCleanStore(TabletStateStore.getStoreForLevel(DataLevel.METADATA,
context));
}
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/AssignLocationModeIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/AssignLocationModeIT.java
index dae97130f7..a80717cf84 100644
---
a/test/src/main/java/org/apache/accumulo/test/functional/AssignLocationModeIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/functional/AssignLocationModeIT.java
@@ -67,7 +67,7 @@ public class AssignLocationModeIT extends ConfigurableMacBase
{
newTablet = getTabletLocationState(c, tableId);
} while (newTablet.current == null);
// this would be null if the mode was not "assign"
- assertEquals(newTablet.current, newTablet.last);
+ assertEquals(newTablet.getCurrentServer(), newTablet.getLastServer());
assertNull(newTablet.future);
// put something in it
@@ -83,7 +83,7 @@ public class AssignLocationModeIT extends ConfigurableMacBase
{
// last location should not be set yet
TabletLocationState unflushed = getTabletLocationState(c, tableId);
assertEquals(newTablet.current, unflushed.current);
- assertEquals(newTablet.current, unflushed.last);
+ assertEquals(newTablet.getCurrentServer(), unflushed.getLastServer());
assertNull(newTablet.future);
// take the tablet offline
@@ -91,7 +91,7 @@ public class AssignLocationModeIT extends ConfigurableMacBase
{
TabletLocationState offline = getTabletLocationState(c, tableId);
assertNull(offline.future);
assertNull(offline.current);
- assertEquals(newTablet.current, offline.last);
+ assertEquals(newTablet.getCurrentServer(), offline.getLastServer());
// put it back online, should have the same last location
c.tableOperations().online(tableName, true);
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/CompactLocationModeIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/CompactLocationModeIT.java
index 4f2dccaa97..146fbeecb0 100644
---
a/test/src/main/java/org/apache/accumulo/test/functional/CompactLocationModeIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/functional/CompactLocationModeIT.java
@@ -90,7 +90,7 @@ public class CompactLocationModeIT extends
ConfigurableMacBase {
TabletLocationState flushed = getTabletLocationState(c, tableId);
assertEquals(newTablet.current, flushed.current);
- assertEquals(flushed.current, flushed.last);
+ assertEquals(flushed.getCurrentServer(), flushed.getLastServer());
assertNull(newTablet.future);
// take the tablet offline
@@ -98,7 +98,7 @@ public class CompactLocationModeIT extends
ConfigurableMacBase {
TabletLocationState offline = getTabletLocationState(c, tableId);
assertNull(offline.future);
assertNull(offline.current);
- assertEquals(flushed.current, offline.last);
+ assertEquals(flushed.getCurrentServer(), offline.getLastServer());
// put it back online, should have the same last location
c.tableOperations().online(tableName, true);
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
index 6235bed638..c3fc72d242 100644
---
a/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
@@ -72,7 +72,7 @@ public class ManagerAssignmentIT extends
AccumuloClusterHarness {
TabletLocationState flushed = getTabletLocationState(c, tableId);
assertEquals(newTablet.current, flushed.current);
- assertEquals(flushed.current, flushed.last);
+ assertEquals(flushed.getCurrentServer(), flushed.getLastServer());
assertNull(newTablet.future);
// take the tablet offline
@@ -80,14 +80,14 @@ public class ManagerAssignmentIT extends
AccumuloClusterHarness {
TabletLocationState offline = getTabletLocationState(c, tableId);
assertNull(offline.future);
assertNull(offline.current);
- assertEquals(flushed.current, offline.last);
+ assertEquals(flushed.getCurrentServer(), offline.getLastServer());
// put it back online
c.tableOperations().online(tableName, true);
TabletLocationState online = getTabletLocationState(c, tableId);
assertNull(online.future);
assertNotNull(online.current);
- assertEquals(online.current, online.last);
+ assertEquals(online.getCurrentServer(), online.getLastServer());
}
}
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java
index d4332c34cc..c27f9fd570 100644
---
a/test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java
@@ -66,7 +66,7 @@ import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.Se
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.TabletColumnFamily;
import org.apache.accumulo.core.metadata.schema.MetadataTime;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
-import org.apache.accumulo.core.metadata.schema.TabletMetadata.LocationType;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.util.ColumnFQ;
import org.apache.accumulo.server.ServerContext;
@@ -211,7 +211,7 @@ public class SplitRecoveryIT extends ConfigurableMacBase {
Assignment assignment = new Assignment(high, instance);
TabletMutator tabletMutator = context.getAmple().mutateTablet(extent);
- tabletMutator.putLocation(assignment.server, LocationType.FUTURE);
+ tabletMutator.putLocation(Location.future(assignment.server));
tabletMutator.mutate();
if (steps >= 1) {
diff --git
a/test/src/main/java/org/apache/accumulo/test/manager/MergeStateIT.java
b/test/src/main/java/org/apache/accumulo/test/manager/MergeStateIT.java
index b709d60193..68aa73408b 100644
--- a/test/src/main/java/org/apache/accumulo/test/manager/MergeStateIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/manager/MergeStateIT.java
@@ -43,6 +43,7 @@ import
org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ChoppedColumnFamily;
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.CurrentLocationColumnFamily;
import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.TabletColumnFamily;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
import org.apache.accumulo.core.util.HostAndPort;
@@ -203,10 +204,8 @@ public class MergeStateIT extends ConfigurableMacBase {
// take it offline
m = TabletColumnFamily.createPrevRowMutation(tablet);
Collection<Collection<String>> walogs = Collections.emptyList();
- metaDataStateStore.unassign(
- Collections.singletonList(
- new TabletLocationState(tablet, null, state.someTServer, null,
null, walogs, false)),
- null);
+ metaDataStateStore.unassign(Collections.singletonList(new
TabletLocationState(tablet, null,
+ Location.current(state.someTServer), null, null, walogs, false)),
null);
// now we can split
stats = scan(state, metaDataStateStore);
diff --git
a/test/src/main/java/org/apache/accumulo/test/manager/SuspendedTabletsIT.java
b/test/src/main/java/org/apache/accumulo/test/manager/SuspendedTabletsIT.java
index bd395d8bab..46e81fb055 100644
---
a/test/src/main/java/org/apache/accumulo/test/manager/SuspendedTabletsIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/manager/SuspendedTabletsIT.java
@@ -183,7 +183,7 @@ public class SuspendedTabletsIT extends ConfigurableMacBase
{
for (TabletLocationState tls : locs.locationStates.values()) {
if (tls.current != null) {
// add to set of all servers
- tserverSet.add(tls.current);
+ tserverSet.add(tls.current.getServerInstance());
// get server that the current tablets metadata is on
TabletLocator.TabletLocation tab =