This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 9c159456ee Fix miscellaneous trivial warnings
9c159456ee is described below
commit 9c159456ee63374f4f456f936d32ba5f920181ef
Author: Christopher Tubbs <[email protected]>
AuthorDate: Wed Sep 10 13:59:11 2025 -0400
Fix miscellaneous trivial warnings
* Workaround generic type inference bug in Eclipse in FateExecutor by
adding the generic type explicitly
* Remove unused code in RFile and ComprehensiveIT
* Remove unclosed resource warning in RangedTableLocksIT for
ClientContext variable (false positive in Eclipse, but easy to work
around)
---
.../apache/accumulo/core/fate/FateExecutor.java | 2 +-
.../org/apache/accumulo/core/file/rfile/RFile.java | 23 ----------------------
.../org/apache/accumulo/test/ComprehensiveIT.java | 2 --
.../accumulo/test/fate/RangedTableLocksIT.java | 4 ++--
4 files changed, 3 insertions(+), 28 deletions(-)
diff --git a/core/src/main/java/org/apache/accumulo/core/fate/FateExecutor.java
b/core/src/main/java/org/apache/accumulo/core/fate/FateExecutor.java
index a912fa5940..5797888043 100644
--- a/core/src/main/java/org/apache/accumulo/core/fate/FateExecutor.java
+++ b/core/src/main/java/org/apache/accumulo/core/fate/FateExecutor.java
@@ -101,7 +101,7 @@ public class FateExecutor<T> {
.numCoreThreads(poolSize).build();
this.idleWorkerCount = new AtomicInteger(0);
this.fateExecutorMetrics =
- new FateExecutorMetrics<>(type, poolName, runningTxRunners,
idleWorkerCount);
+ new FateExecutorMetrics<T>(type, poolName, runningTxRunners,
idleWorkerCount);
this.workFinder = Threads.createCriticalThread(workFinderThreadName, new
WorkFinder());
this.workFinder.start();
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
index e7a77a4ac3..1d996d27de 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
@@ -85,8 +85,6 @@ import org.slf4j.LoggerFactory;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
public class RFile {
@@ -1588,14 +1586,10 @@ public class RFile {
private final FileSKVIterator reader;
protected final Range fence;
- private final Key fencedStartKey;
- private final Supplier<Key> fencedEndKey;
public FencedFileSKVIterator(FileSKVIterator reader, Range fence) {
this.reader = Objects.requireNonNull(reader);
this.fence = Objects.requireNonNull(fence);
- this.fencedStartKey = fence.getStartKey();
- this.fencedEndKey = Suppliers.memoize(() ->
getEndKey(fence.getEndKey()));
}
@Override
@@ -1659,23 +1653,6 @@ public class RFile {
reader.close();
}
- private Key getEndKey(Key key) {
- // If they key is infinite it will be null or if inclusive we can just
use it as is
- // as it would be the correct value for getLastKey()
- if (fence.isInfiniteStopKey() || fence.isEndKeyInclusive()) {
- return key;
- }
-
- // If exclusive we need to strip the last byte to get the last key that
is part of the
- // actual range to return
- final byte[] ba = key.getRowData().toArray();
- Preconditions.checkArgument(ba.length > 0 && ba[ba.length - 1] == (byte)
0x00);
- byte[] fba = new byte[ba.length - 1];
- System.arraycopy(ba, 0, fba, 0, ba.length - 1);
-
- return new Key(fba);
- }
-
}
static class FencedIndex extends FencedFileSKVIterator {
diff --git a/test/src/main/java/org/apache/accumulo/test/ComprehensiveIT.java
b/test/src/main/java/org/apache/accumulo/test/ComprehensiveIT.java
index 3ffb5cf003..9a1bc508dd 100644
--- a/test/src/main/java/org/apache/accumulo/test/ComprehensiveIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ComprehensiveIT.java
@@ -19,8 +19,6 @@
package org.apache.accumulo.test;
import static org.apache.accumulo.harness.AccumuloITBase.SUNNY_DAY;
-import static org.apache.accumulo.harness.SharedMiniClusterBase.getClientProps;
-import static org.apache.accumulo.test.ComprehensiveITBase.AUTHORIZATIONS;
import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
diff --git
a/test/src/main/java/org/apache/accumulo/test/fate/RangedTableLocksIT.java
b/test/src/main/java/org/apache/accumulo/test/fate/RangedTableLocksIT.java
index 8f16f11f5e..6c8aa0dc6a 100644
--- a/test/src/main/java/org/apache/accumulo/test/fate/RangedTableLocksIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/fate/RangedTableLocksIT.java
@@ -220,7 +220,8 @@ public class RangedTableLocksIT extends
AccumuloClusterHarness {
var names = getUniqueNames(2);
var table1 = names[0];
var table2 = names[1];
- try (AccumuloClient client =
Accumulo.newClient().from(getClientProps()).build()) {
+ try (AccumuloClient client =
Accumulo.newClient().from(getClientProps()).build();
+ ClientContext ctx = ((ClientContext) client)) {
SortedMap<Text,TabletMergeability> splits = new TreeMap<>();
for (char c = 'b'; c < 'y'; c++) {
splits.put(new Text(c + ""), TabletMergeability.never());
@@ -228,7 +229,6 @@ public class RangedTableLocksIT extends
AccumuloClusterHarness {
client.tableOperations().create(table1, new
NewTableConfiguration().withSplits(splits));
client.tableOperations().create(table2);
- ClientContext ctx = ((ClientContext) client);
Ample ample = ctx.getAmple();
TableId tableId1 = ctx.getTableId(table1);