Skip to content

Commit 67b4e4f

Browse files
authored
Removed table name and id from RFileScanner. (#5512)
Closes #5505
1 parent 5c91c5a commit 67b4e4f

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

core/src/main/java/org/apache/accumulo/core/client/rfile/RFileScanner.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ public RFileScannerEnvironmentImpl(Opts opts) {
9595

9696
@Override
9797
public String getTableName(TableId tableId) throws TableNotFoundException {
98-
Preconditions.checkArgument(tableId == TABLE_ID, "Expected " + TABLE_ID + " obtained"
99-
+ " from IteratorEnvironment.getTableId(), but got: " + tableId);
100-
return TABLE_NAME;
98+
return null;
10199
}
102100

103101
@Override
@@ -107,17 +105,13 @@ public Configuration getConfiguration() {
107105

108106
@Override
109107
public Configuration getConfiguration(TableId tableId) {
110-
Preconditions.checkArgument(tableId == TABLE_ID, "Expected " + TABLE_ID + " obtained"
111-
+ " from IteratorEnvironment.getTableId(), but got: " + tableId);
112108
return tableConf;
113109
}
114110

115111
}
116112

117113
private static final byte[] EMPTY_BYTES = new byte[0];
118114
private static final Range EMPTY_RANGE = new Range();
119-
private static final String TABLE_NAME = "rfileScanner";
120-
private static final TableId TABLE_ID = TableId.of(TABLE_NAME);
121115

122116
private Range range;
123117
private BlockCacheManager blockCacheManager = null;
@@ -309,7 +303,7 @@ public Iterator<Entry<Key,Value>> iterator() {
309303

310304
ClientIteratorEnvironment.Builder iterEnvBuilder = new ClientIteratorEnvironment.Builder()
311305
.withEnvironment(new RFileScannerEnvironmentImpl(opts)).withAuthorizations(opts.auths)
312-
.withScope(IteratorScope.scan).withTableId(TABLE_ID);
306+
.withScope(IteratorScope.scan).withTableId(null);
313307
if (getSamplerConfiguration() != null) {
314308
iterEnvBuilder.withSamplerConfiguration(getSamplerConfiguration());
315309
iterEnvBuilder.withSamplingEnabled();

core/src/main/java/org/apache/accumulo/core/iteratorsImpl/ClientIteratorEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public Builder isUserCompaction() {
7575

7676
public Builder withTableId(TableId tableId) {
7777
checkState(this.tableId.isEmpty(), "TableId has already been set");
78-
this.tableId = Optional.of(tableId);
78+
this.tableId = Optional.ofNullable(tableId);
7979
return this;
8080
}
8181

0 commit comments

Comments
 (0)