Search in sources :

Example 1 with ContainerDispatcher

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);
}
Also used : ContainerSet(org.apache.hadoop.ozone.container.common.impl.ContainerSet) ContainerDispatcher(org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher) ContainerController(org.apache.hadoop.ozone.container.ozoneimpl.ContainerController)

Example 2 with ContainerDispatcher

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;
}
Also used : ContainerSet(org.apache.hadoop.ozone.container.common.impl.ContainerSet) ContainerDispatcher(org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher) OzoneContainer(org.apache.hadoop.ozone.container.ozoneimpl.OzoneContainer)

Example 3 with ContainerDispatcher

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);
}
Also used : ContainerSet(org.apache.hadoop.ozone.container.common.impl.ContainerSet) ContainerDispatcher(org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher) ContainerController(org.apache.hadoop.ozone.container.ozoneimpl.ContainerController)

Example 4 with ContainerDispatcher

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);
}
Also used : ContainerSet(org.apache.hadoop.ozone.container.common.impl.ContainerSet) ContainerDispatcher(org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher) ContainerController(org.apache.hadoop.ozone.container.ozoneimpl.ContainerController)

Example 5 with ContainerDispatcher

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;
}
Also used : ContainerDispatcher(org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher) OzoneContainer(org.apache.hadoop.ozone.container.ozoneimpl.OzoneContainer)

Aggregations

ContainerDispatcher (org.apache.hadoop.ozone.container.common.interfaces.ContainerDispatcher)5 ContainerSet (org.apache.hadoop.ozone.container.common.impl.ContainerSet)4 ContainerController (org.apache.hadoop.ozone.container.ozoneimpl.ContainerController)3 OzoneContainer (org.apache.hadoop.ozone.container.ozoneimpl.OzoneContainer)2