You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2022/10/24 20:01:54 UTC
[accumulo] branch main updated: Trivial improvements to block cache code (#3038)
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 662d7df805 Trivial improvements to block cache code (#3038)
662d7df805 is described below
commit 662d7df80534e342f5c435bfb28d61c89e1cb7d1
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Mon Oct 24 16:01:48 2022 -0400
Trivial improvements to block cache code (#3038)
Make trivial improvements seen while investigating #2697
* Get rid of unnecessary generic method in internal implementation
* Drop redundant static modifier on interface
* Add explicit private constructor for BlockIndex
---
.../apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java | 6 +++---
.../main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java | 2 ++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
index 878de6a058..b33f5ea821 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
@@ -30,6 +30,7 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
+import org.apache.accumulo.core.file.rfile.BlockIndex;
import org.apache.accumulo.core.file.rfile.bcfile.BCFile;
import org.apache.accumulo.core.file.rfile.bcfile.BCFile.Reader.BlockReader;
import org.apache.accumulo.core.file.rfile.bcfile.MetaBlockDoesNotExist;
@@ -37,7 +38,6 @@ import org.apache.accumulo.core.file.streams.RateLimitedInputStream;
import org.apache.accumulo.core.spi.cache.BlockCache;
import org.apache.accumulo.core.spi.cache.BlockCache.Loader;
import org.apache.accumulo.core.spi.cache.CacheEntry;
-import org.apache.accumulo.core.spi.cache.CacheEntry.Weighable;
import org.apache.accumulo.core.spi.crypto.CryptoService;
import org.apache.accumulo.core.util.ratelimit.RateLimiter;
import org.apache.hadoop.conf.Configuration;
@@ -59,7 +59,7 @@ public class CachableBlockFile {
private static final Logger log = LoggerFactory.getLogger(CachableBlockFile.class);
- private static interface IoeSupplier<T> {
+ private interface IoeSupplier<T> {
T get() throws IOException;
}
@@ -511,7 +511,7 @@ public class CachableBlockFile {
return seekableInput.getBuffer();
}
- public <T extends Weighable> T getIndex(Supplier<T> indexSupplier) {
+ public BlockIndex getIndex(Supplier<BlockIndex> indexSupplier) {
return cb.getIndex(indexSupplier);
}
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java
index 0bf1d545ef..483f08bc51 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java
@@ -33,6 +33,8 @@ import org.apache.accumulo.core.spi.cache.CacheEntry.Weighable;
public class BlockIndex implements Weighable {
+ private BlockIndex() {}
+
public static BlockIndex getIndex(CachedBlockRead cacheBlock, IndexEntry indexEntry)
throws IOException {