use of org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher in project ozone by apache.
the class TestCSMMetrics method newXceiverServerRatis.
static XceiverServerRatis newXceiverServerRatis(DatanodeDetails dn, OzoneConfiguration conf) throws IOException {
conf.setInt(OzoneConfigKeys.DFS_CONTAINER_RATIS_IPC_PORT, dn.getPort(DatanodeDetails.Port.Name.RATIS).getValue());
final String dir = TEST_DIR + dn.getUuid();
conf.set(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATANODE_STORAGE_DIR, dir);
final ContainerDispatcher dispatcher = new TestContainerDispatcher();
return XceiverServerRatis.newXceiverServerRatis(dn, conf, dispatcher, new ContainerController(new ContainerSet(), Maps.newHashMap()), null, null);
}
use of org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher in project ozone by apache.
the class TestSchemaOneBackwardsCompatibility method makeMockOzoneContainer.
private OzoneContainer makeMockOzoneContainer(KeyValueHandler keyValueHandler) throws Exception {
ContainerSet containerSet = makeContainerSet();
OzoneContainer ozoneContainer = mock(OzoneContainer.class);
when(ozoneContainer.getContainerSet()).thenReturn(containerSet);
when(ozoneContainer.getWriteChannel()).thenReturn(null);
ContainerDispatcher dispatcher = mock(ContainerDispatcher.class);
when(ozoneContainer.getDispatcher()).thenReturn(dispatcher);
when(dispatcher.getHandler(any())).thenReturn(keyValueHandler);
return ozoneContainer;
}
use of org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher in project ozone by apache.
the class TestContainerServer method newXceiverServerRatis.
static XceiverServerRatis newXceiverServerRatis(DatanodeDetails dn, OzoneConfiguration conf) throws IOException {
conf.setInt(OzoneConfigKeys.DFS_CONTAINER_RATIS_IPC_PORT, dn.getPort(DatanodeDetails.Port.Name.RATIS).getValue());
final String dir = TEST_DIR + dn.getUuid();
conf.set(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATANODE_STORAGE_DIR, dir);
final ContainerDispatcher dispatcher = new TestContainerDispatcher();
return XceiverServerRatis.newXceiverServerRatis(dn, conf, dispatcher, new ContainerController(new ContainerSet(), Maps.newHashMap()), caClient, null);
}
use of org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher in project ozone by apache.
the class TestSecureContainerServer method newXceiverServerRatis.
static XceiverServerRatis newXceiverServerRatis(DatanodeDetails dn, OzoneConfiguration conf) throws IOException {
conf.setInt(OzoneConfigKeys.DFS_CONTAINER_RATIS_IPC_PORT, dn.getPort(DatanodeDetails.Port.Name.RATIS).getValue());
final String dir = TEST_DIR + dn.getUuid();
conf.set(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATANODE_STORAGE_DIR, dir);
final ContainerDispatcher dispatcher = createDispatcher(dn, UUID.randomUUID(), conf);
return XceiverServerRatis.newXceiverServerRatis(dn, conf, dispatcher, new ContainerController(new ContainerSet(), Maps.newHashMap()), caClient, null);
}
use of org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher in project ozone by apache.
the class TestBlockDeletingService method mockDependencies.
private OzoneContainer mockDependencies(ContainerSet containerSet, KeyValueHandler keyValueHandler) {
OzoneContainer ozoneContainer = mock(OzoneContainer.class);
when(ozoneContainer.getContainerSet()).thenReturn(containerSet);
when(ozoneContainer.getWriteChannel()).thenReturn(null);
ContainerDispatcher dispatcher = mock(ContainerDispatcher.class);
when(ozoneContainer.getDispatcher()).thenReturn(dispatcher);
when(dispatcher.getHandler(any())).thenReturn(keyValueHandler);
return ozoneContainer;
}
Aggregations