use of org.apache.bookkeeper.stream.storage.impl.sc.LocalStorageContainerManager in project bookkeeper by apache.
the class TestRangeStoreImpl method setUp.
@SuppressWarnings("unchecked")
@Before
public void setUp() throws Exception {
storageResources = StorageResources.create();
Endpoint endpoint = createEndpoint("127.0.0.1", 0);
// create the client manager
MVCCStoreFactory storeFactory = mock(MVCCStoreFactory.class);
MVCCAsyncStore<byte[], byte[]> store = mock(MVCCAsyncStore.class);
when(storeFactory.openStore(anyLong(), anyLong(), anyLong())).thenReturn(FutureUtils.value(store));
when(storeFactory.closeStores(anyLong())).thenReturn(FutureUtils.Void());
rangeStore = (RangeStoreImpl) RangeStoreBuilder.newBuilder().withStorageConfiguration(storageConf).withStorageResources(storageResources).withStorageContainerManagerFactory((numScs, storeConf, rgRegistry) -> new LocalStorageContainerManager(endpoint, storeConf, rgRegistry, 2)).withRangeStoreFactory(storeFactory).withDefaultBackendUri(URI.create("distributedlog://127.0.0.1/stream/storage")).build();
rangeStore.start();
}
Aggregations