diff --git a/core/src/main/java/com/scalar/db/common/TableMetadataManager.java b/core/src/main/java/com/scalar/db/common/TableMetadataManager.java index 062df0b076..5fbadf306d 100644 --- a/core/src/main/java/com/scalar/db/common/TableMetadataManager.java +++ b/core/src/main/java/com/scalar/db/common/TableMetadataManager.java @@ -27,7 +27,7 @@ public TableMetadataManager(Admin admin, long cacheExpirationTimeSecs) { } public TableMetadataManager( - ThrowableFunction, TableKey, Exception> getTableMetadataFunc, + ThrowableFunction, Exception> getTableMetadataFunc, long cacheExpirationTimeSecs) { CacheBuilder builder = CacheBuilder.newBuilder(); if (cacheExpirationTimeSecs >= 0) { diff --git a/core/src/main/java/com/scalar/db/util/ThrowableConsumer.java b/core/src/main/java/com/scalar/db/util/ThrowableConsumer.java new file mode 100644 index 0000000000..e6017221c8 --- /dev/null +++ b/core/src/main/java/com/scalar/db/util/ThrowableConsumer.java @@ -0,0 +1,6 @@ +package com.scalar.db.util; + +@FunctionalInterface +public interface ThrowableConsumer { + void accept(A arg) throws T; +} diff --git a/core/src/main/java/com/scalar/db/util/ThrowableFunction.java b/core/src/main/java/com/scalar/db/util/ThrowableFunction.java index eb839d7673..f846532944 100644 --- a/core/src/main/java/com/scalar/db/util/ThrowableFunction.java +++ b/core/src/main/java/com/scalar/db/util/ThrowableFunction.java @@ -1,6 +1,6 @@ package com.scalar.db.util; @FunctionalInterface -public interface ThrowableFunction { +public interface ThrowableFunction { R apply(A arg) throws T; } diff --git a/core/src/test/java/com/scalar/db/common/TableMetadataManagerTest.java b/core/src/test/java/com/scalar/db/common/TableMetadataManagerTest.java index 03bedef24b..9c6d01f0d6 100644 --- a/core/src/test/java/com/scalar/db/common/TableMetadataManagerTest.java +++ b/core/src/test/java/com/scalar/db/common/TableMetadataManagerTest.java @@ -26,7 +26,7 @@ public class TableMetadataManagerTest { @Mock private DistributedStorageAdmin admin; @Mock - private ThrowableFunction, TableMetadataManager.TableKey, Exception> + private ThrowableFunction, Exception> getTableMetadataFunc; @BeforeEach