use of com.scalar.db.api.DistributedStorageAdmin in project scalardb by scalar-labs.
the class MultiStorageAdminTest method setUp.
@BeforeEach
public void setUp() throws Exception {
MockitoAnnotations.openMocks(this).close();
// Arrange
Map<String, DistributedStorageAdmin> tableAdminMap = new HashMap<>();
tableAdminMap.put(NAMESPACE1 + "." + TABLE1, admin1);
tableAdminMap.put(NAMESPACE1 + "." + TABLE2, admin2);
Map<String, DistributedStorageAdmin> namespaceAdminMap = new HashMap<>();
namespaceAdminMap.put(NAMESPACE2, admin2);
DistributedStorageAdmin defaultAdmin = admin3;
multiStorageAdmin = new MultiStorageAdmin(tableAdminMap, namespaceAdminMap, defaultAdmin);
}
use of com.scalar.db.api.DistributedStorageAdmin in project scalardb by scalar-labs.
the class MultiStorageAdmin method getAdmin.
private DistributedStorageAdmin getAdmin(String namespace, String table) {
String fullTaleName = namespace + "." + table;
DistributedStorageAdmin admin = tableAdminMap.get(fullTaleName);
if (admin != null) {
return admin;
}
return getAdmin(namespace);
}
Aggregations