Skip to content

Commit 4c259d7

Browse files
authored
Removed unreferenced code (#5935)
1 parent cbe4dc0 commit 4c259d7

File tree

61 files changed

+19
-785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+19
-785
lines changed

core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ public AuthenticationToken getToken() {
170170
+ "accumulo-client.properties. Expected format: -o <key>=<value>")
171171
private List<String> overrides = new ArrayList<>();
172172

173-
@Parameter(names = "--trace", description = "turn on distributed tracing")
174-
public boolean trace = false;
175-
176173
public Map<String,String> getOverrides() {
177174
return ConfigOpts.getOverrides(overrides);
178175
}

core/src/main/java/org/apache/accumulo/core/client/NamespaceNotEmptyException.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*/
1919
package org.apache.accumulo.core.client;
2020

21-
import org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException;
22-
2321
/**
2422
* Thrown when the namespace specified contains tables
2523
*/
@@ -55,13 +53,6 @@ public NamespaceNotEmptyException(String namespaceId, String namespaceName, Stri
5553
super.initCause(cause);
5654
}
5755

58-
/**
59-
* @param e constructs an exception from a thrift exception
60-
*/
61-
public NamespaceNotEmptyException(ThriftTableOperationException e) {
62-
this(e.getTableId(), e.getTableName(), e.getDescription(), e);
63-
}
64-
6556
/**
6657
* @return the name of the namespace
6758
*/

core/src/main/java/org/apache/accumulo/core/client/admin/NewTableConfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ public NewTableConfiguration setLocalityGroups(Map<String,Set<Text>> groups) {
272272
*
273273
* @since 2.0.0
274274
*/
275-
@SuppressWarnings("unchecked")
276275
public NewTableConfiguration withSplits(final SortedSet<Text> splits) {
277276
checkArgument(splits != null, "splits set is null");
278277
checkArgument(!splits.isEmpty(), "splits set is empty");

core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,10 +1143,6 @@ public void setProperty(ClientProperty property, CharSequence value) {
11431143
properties.setProperty(property.getKey(), value.toString());
11441144
}
11451145

1146-
public void setProperty(ClientProperty property, Long value) {
1147-
setProperty(property, Long.toString(value));
1148-
}
1149-
11501146
public void setProperty(ClientProperty property, Integer value) {
11511147
setProperty(property, Integer.toString(value));
11521148
}

core/src/main/java/org/apache/accumulo/core/clientImpl/ClientInfo.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
package org.apache.accumulo.core.clientImpl;
2020

21-
import java.net.URL;
2221
import java.nio.file.Path;
2322
import java.util.Optional;
2423
import java.util.Properties;
@@ -94,13 +93,6 @@ static ClientInfo from(Properties properties) {
9493
return new ClientInfoImpl(properties, Optional.empty());
9594
}
9695

97-
/**
98-
* @return ClientInfo given URL path to client config file
99-
*/
100-
static ClientInfo from(URL propertiesURL) {
101-
return new ClientInfoImpl(ClientInfoImpl.toProperties(propertiesURL), Optional.empty());
102-
}
103-
10496
/**
10597
* @return ClientInfo given properties and token
10698
*/

core/src/main/java/org/apache/accumulo/core/clientImpl/ClientTabletCache.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.apache.accumulo.core.dataImpl.KeyExtent;
4040
import org.apache.accumulo.core.util.Interner;
4141
import org.apache.accumulo.core.util.Timer;
42-
import org.apache.accumulo.core.util.UtilWaitThread;
4342
import org.apache.hadoop.io.Text;
4443

4544
/**
@@ -116,17 +115,6 @@ public CachedTablet findTablet(ClientContext context, Text row, boolean skipRow,
116115
return findTablet(context, row, skipRow, locationNeed, 0, null);
117116
}
118117

119-
public CachedTablet findTabletWithRetry(ClientContext context, Text row, boolean skipRow,
120-
LocationNeed locationNeed) throws AccumuloException, AccumuloSecurityException,
121-
TableNotFoundException, InvalidTabletHostingRequestException {
122-
var tl = findTablet(context, row, skipRow, locationNeed);
123-
while (tl == null && locationNeed == LocationNeed.REQUIRED) {
124-
UtilWaitThread.sleep(100);
125-
tl = findTablet(context, row, skipRow, locationNeed);
126-
}
127-
return tl;
128-
}
129-
130118
public abstract <T extends Mutation> void binMutations(ClientContext context, List<T> mutations,
131119
Map<String,TabletServerMutations<T>> binnedMutations, List<T> failures)
132120
throws AccumuloException, AccumuloSecurityException, TableNotFoundException,

core/src/main/java/org/apache/accumulo/core/clientImpl/ClientTabletCacheImpl.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -611,11 +611,6 @@ public long getTabletHostingRequestCount() {
611611
return tabletHostingRequestCount.get();
612612
}
613613

614-
@VisibleForTesting
615-
public void resetTabletHostingRequestCount() {
616-
tabletHostingRequestCount.set(0);
617-
}
618-
619614
@VisibleForTesting
620615
public void enableTabletHostingRequests(boolean enabled) {
621616
HOSTING_ENABLED.set(enabled);

core/src/main/java/org/apache/accumulo/core/clientImpl/DelegationTokenImpl.java

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,9 @@
3030
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
3131
import org.apache.accumulo.core.securityImpl.thrift.TAuthenticationTokenIdentifier;
3232
import org.apache.hadoop.io.Text;
33-
import org.apache.hadoop.security.Credentials;
34-
import org.apache.hadoop.security.UserGroupInformation;
3533
import org.apache.hadoop.security.token.Token;
36-
import org.apache.hadoop.security.token.TokenIdentifier;
37-
import org.slf4j.Logger;
38-
import org.slf4j.LoggerFactory;
3934

4035
public class DelegationTokenImpl extends PasswordToken implements DelegationToken {
41-
private static final Logger log = LoggerFactory.getLogger(DelegationTokenImpl.class);
4236

4337
public static final String SERVICE_NAME = "AccumuloDelegationToken";
4438

@@ -56,41 +50,6 @@ public DelegationTokenImpl(byte[] delegationTokenPassword,
5650
this.identifier = identifier;
5751
}
5852

59-
public DelegationTokenImpl(String instanceID, UserGroupInformation user,
60-
AuthenticationTokenIdentifier identifier) {
61-
requireNonNull(instanceID);
62-
requireNonNull(user);
63-
requireNonNull(identifier);
64-
65-
Credentials creds = user.getCredentials();
66-
Token<? extends TokenIdentifier> token =
67-
creds.getToken(new Text(SERVICE_NAME + "-" + instanceID));
68-
if (token == null) {
69-
throw new IllegalArgumentException(
70-
"Did not find Accumulo delegation token in provided UserGroupInformation");
71-
}
72-
setPasswordFromToken(token);
73-
this.identifier = identifier;
74-
}
75-
76-
public DelegationTokenImpl(Token<? extends TokenIdentifier> token,
77-
AuthenticationTokenIdentifier identifier) {
78-
requireNonNull(token);
79-
requireNonNull(identifier);
80-
setPasswordFromToken(token);
81-
this.identifier = identifier;
82-
}
83-
84-
private void setPasswordFromToken(Token<? extends TokenIdentifier> token) {
85-
if (!AuthenticationTokenIdentifier.TOKEN_KIND.equals(token.getKind())) {
86-
String msg = "Expected an AuthenticationTokenIdentifier but got a " + token.getKind();
87-
log.error(msg);
88-
throw new IllegalArgumentException(msg);
89-
}
90-
91-
setPassword(token.getPassword());
92-
}
93-
9453
/**
9554
* The identifier for this token, may be null.
9655
*/

core/src/main/java/org/apache/accumulo/core/clientImpl/TabletAvailabilityUtil.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,10 @@
1919
package org.apache.accumulo.core.clientImpl;
2020

2121
import org.apache.accumulo.core.client.admin.TabletAvailability;
22-
import org.apache.accumulo.core.clientImpl.thrift.TTabletAvailability;
2322
import org.apache.accumulo.core.data.Value;
2423

2524
public class TabletAvailabilityUtil {
2625

27-
public static TabletAvailability fromThrift(TTabletAvailability tAvailability) {
28-
return switch (tAvailability) {
29-
case HOSTED -> TabletAvailability.HOSTED;
30-
case UNHOSTED -> TabletAvailability.UNHOSTED;
31-
case ONDEMAND -> TabletAvailability.ONDEMAND;
32-
};
33-
}
34-
35-
public static TTabletAvailability toThrift(TabletAvailability tabletAvailability) {
36-
return switch (tabletAvailability) {
37-
case HOSTED -> TTabletAvailability.HOSTED;
38-
case UNHOSTED -> TTabletAvailability.UNHOSTED;
39-
case ONDEMAND -> TTabletAvailability.ONDEMAND;
40-
};
41-
}
42-
4326
public static TabletAvailability fromValue(Value value) {
4427
return switch (value.toString()) {
4528
case "HOSTED" -> TabletAvailability.HOSTED;

core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchReaderIterator.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -843,15 +843,6 @@ public long getTimeOut() {
843843
}
844844
}
845845

846-
public static void doLookup(ClientContext context, String server,
847-
Map<KeyExtent,List<Range>> requested, Map<KeyExtent,List<Range>> failures,
848-
Map<KeyExtent,List<Range>> unscanned, ResultReceiver receiver, List<Column> columns,
849-
ScannerOptions options, Authorizations authorizations)
850-
throws IOException, AccumuloSecurityException, AccumuloServerException {
851-
doLookup(context, server, requested, failures, unscanned, receiver, columns, options,
852-
authorizations, new TimeoutTracker(Long.MAX_VALUE), 0L);
853-
}
854-
855846
static void doLookup(ClientContext context, String server, Map<KeyExtent,List<Range>> requested,
856847
Map<KeyExtent,List<Range>> failures, Map<KeyExtent,List<Range>> unscanned,
857848
ResultReceiver receiver, List<Column> columns, ScannerOptions options,

0 commit comments

Comments
 (0)