Skip to content

Commit ab94bec

Browse files
committed
Remove confusing default impl
1 parent 29d2a2d commit ab94bec

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

core/src/main/java/com/scalar/db/api/ReplicationAdmin.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.scalar.db.common.error.CoreError;
44
import com.scalar.db.exception.storage.ExecutionException;
5-
import java.util.Collections;
65
import java.util.Map;
76

87
/** An administrative interface for the replication feature. */
@@ -31,10 +30,7 @@ default void createReplicationTables(Map<String, String> options) throws Executi
3130
*/
3231
default void createReplicationTables(boolean ifNotExist, Map<String, String> options)
3332
throws ExecutionException {
34-
if (ifNotExist && replicationTablesExist()) {
35-
return;
36-
}
37-
createReplicationTables(options);
33+
throw new UnsupportedOperationException(CoreError.REPLICATION_NOT_ENABLED.buildMessage());
3834
}
3935

4036
/**
@@ -48,10 +44,7 @@ default void createReplicationTables(boolean ifNotExist, Map<String, String> opt
4844
* @throws ExecutionException if the operation fails
4945
*/
5046
default void createReplicationTables(boolean ifNotExist) throws ExecutionException {
51-
if (ifNotExist && replicationTablesExist()) {
52-
return;
53-
}
54-
createReplicationTables(Collections.emptyMap());
47+
throw new UnsupportedOperationException(CoreError.REPLICATION_NOT_ENABLED.buildMessage());
5548
}
5649

5750
/**
@@ -60,7 +53,7 @@ default void createReplicationTables(boolean ifNotExist) throws ExecutionExcepti
6053
* @throws ExecutionException if the operation fails
6154
*/
6255
default void createReplicationTables() throws ExecutionException {
63-
createReplicationTables(Collections.emptyMap());
56+
throw new UnsupportedOperationException(CoreError.REPLICATION_NOT_ENABLED.buildMessage());
6457
}
6558

6659
/**
@@ -83,10 +76,7 @@ default void dropReplicationTables() throws ExecutionException {
8376
* @throws ExecutionException if the operation fails
8477
*/
8578
default void dropReplicationTables(boolean ifExist) throws ExecutionException {
86-
if (ifExist && !replicationTablesExist()) {
87-
return;
88-
}
89-
dropReplicationTables();
79+
throw new UnsupportedOperationException(CoreError.REPLICATION_NOT_ENABLED.buildMessage());
9080
}
9181

9282
/**

0 commit comments

Comments
 (0)