Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion core/src/main/java/org/apache/accumulo/core/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public class Constants {
public static final String ZCOMPACTORS = "/compactors";

public static final String ZDEAD = "/dead";
public static final String ZDEADTSERVERS = ZDEAD + "/tservers";

public static final String ZSHUTTING_DOWN_TSERVERS = "/shutting-down-tservers";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1327,12 +1327,11 @@ public void clearTabletLocationCache() {
}

private static Set<String> createPersistentWatcherPaths() {
return Set.of(Constants.ZCOMPACTORS, Constants.ZDEADTSERVERS, Constants.ZGC_LOCK,
Constants.ZMANAGER_LOCK, Constants.ZMINI_LOCK, Constants.ZMONITOR_LOCK,
Constants.ZNAMESPACES, Constants.ZRECOVERY, Constants.ZSSERVERS, Constants.ZTABLES,
Constants.ZTSERVERS, Constants.ZUSERS, RootTable.ZROOT_TABLET, Constants.ZTEST_LOCK,
Constants.ZMANAGER_ASSISTANT_LOCK, Constants.ZRESOURCEGROUPS,
Constants.ZMANAGER_ASSIGNMENTS);
return Set.of(Constants.ZCOMPACTORS, Constants.ZGC_LOCK, Constants.ZMANAGER_LOCK,
Constants.ZMINI_LOCK, Constants.ZMONITOR_LOCK, Constants.ZNAMESPACES, Constants.ZRECOVERY,
Constants.ZSSERVERS, Constants.ZTABLES, Constants.ZTSERVERS, Constants.ZUSERS,
RootTable.ZROOT_TABLET, Constants.ZTEST_LOCK, Constants.ZMANAGER_ASSISTANT_LOCK,
Constants.ZRESOURCEGROUPS, Constants.ZMANAGER_ASSIGNMENTS);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ private ServiceLockPath(String type, String content) {
*/
private ServiceLockPath(String type, ResourceGroupId resourceGroup, HostAndPort server) {
this.type = requireNonNull(type);
Preconditions.checkArgument(
this.type.equals(Constants.ZCOMPACTORS) || this.type.equals(Constants.ZSSERVERS)
|| this.type.equals(Constants.ZTSERVERS) || this.type.equals(Constants.ZDEADTSERVERS)
|| this.type.equals(Constants.ZMANAGER_ASSISTANT_LOCK),
"Unsupported type: " + type);
Preconditions.checkArgument(this.type.equals(Constants.ZCOMPACTORS)
|| this.type.equals(Constants.ZSSERVERS) || this.type.equals(Constants.ZTSERVERS)
|| this.type.equals(Constants.ZMANAGER_ASSISTANT_LOCK), "Unsupported type: " + type);
this.resourceGroup = requireNonNull(resourceGroup);
this.server = requireNonNull(server).toString();
this.path = this.type + "/" + this.resourceGroup + "/" + this.server;
Expand Down Expand Up @@ -186,8 +184,6 @@ private static String determineServerType(final String path) {
return Constants.ZCOMPACTORS;
} else if (pathStartsWith(path, Constants.ZSSERVERS)) {
return Constants.ZSSERVERS;
} else if (pathStartsWith(path, Constants.ZDEADTSERVERS)) {
return Constants.ZDEADTSERVERS;
} else if (pathStartsWith(path, Constants.ZTSERVERS)) {
return Constants.ZTSERVERS;
} else {
Expand Down Expand Up @@ -223,7 +219,7 @@ public static ServiceLockPath parse(Optional<String> serverType, String path) {
return switch (type) {
case Constants.ZMINI_LOCK -> new ServiceLockPath(type, server);
case Constants.ZCOMPACTORS, Constants.ZSSERVERS, Constants.ZTSERVERS,
Constants.ZDEADTSERVERS, Constants.ZMANAGER_ASSISTANT_LOCK ->
Constants.ZMANAGER_ASSISTANT_LOCK ->
new ServiceLockPath(type, ResourceGroupId.of(resourceGroup),
HostAndPort.fromString(server));
default ->
Expand Down Expand Up @@ -278,11 +274,6 @@ public ServiceLockPath createTabletServerPath(ResourceGroupId resourceGroup,
return new ServiceLockPath(Constants.ZTSERVERS, resourceGroup, serverAddress);
}

public ServiceLockPath createDeadTabletServerPath(ResourceGroupId resourceGroup,
HostAndPort serverAddress) {
return new ServiceLockPath(Constants.ZDEADTSERVERS, resourceGroup, serverAddress);
}

public ServiceLockPath createAdminLockPath() {
return new ServiceLockPath(Constants.ZADMIN_LOCK);
}
Expand Down Expand Up @@ -356,11 +347,6 @@ public Set<ServiceLockPath> getTabletServer(ResourceGroupPredicate resourceGroup
return get(Constants.ZTSERVERS, resourceGroupPredicate, address, withLock);
}

public Set<ServiceLockPath> getDeadTabletServer(ResourceGroupPredicate resourceGroupPredicate,
AddressSelector address, boolean withLock) {
return get(Constants.ZDEADTSERVERS, resourceGroupPredicate, address, withLock);
}

public interface ResourceGroupPredicate extends Predicate<ResourceGroupId> {
ResourceGroupPredicate ANY = rgid -> true;
ResourceGroupPredicate DEFAULT_RG_ONLY = ResourceGroupId.DEFAULT::equals;
Expand Down Expand Up @@ -445,7 +431,7 @@ private Set<ServiceLockPath> get(final String serverType,
}
}
} else if (serverType.equals(Constants.ZCOMPACTORS) || serverType.equals(Constants.ZSSERVERS)
|| serverType.equals(Constants.ZTSERVERS) || serverType.equals(Constants.ZDEADTSERVERS)
|| serverType.equals(Constants.ZTSERVERS)
|| serverType.equals(Constants.ZMANAGER_ASSISTANT_LOCK)) {
final List<String> resourceGroups = zooCache.getChildren(typePath);
for (final String group : resourceGroups) {
Expand Down Expand Up @@ -484,7 +470,7 @@ private Set<ServiceLockPath> get(final String serverType,
if (addressPredicate.test(server)) {
final ServiceLockPath slp =
parse(Optional.of(serverType), typePath + "/" + group + "/" + server);
if (!withLock || slp.getType().equals(Constants.ZDEADTSERVERS)) {
if (!withLock) {
// Dead TServers don't have lock data
results.add(slp);
} else {
Expand Down
Loading