HDFS-11798. Ozone: Correct description for ozone.handler.type in ozone-default.xml. Contributed by Mukul Kumar Singh.

This commit is contained in:
Anu Engineer 2017-05-10 14:43:53 -07:00 committed by Owen O'Malley
parent 744a052dc2
commit 070960ed8a
20 changed files with 48 additions and 30 deletions

View File

@ -31,6 +31,7 @@ import com.sun.jersey.api.container.ContainerFactory;
import com.sun.jersey.api.core.ApplicationAdapter; import com.sun.jersey.api.core.ApplicationAdapter;
import org.apache.hadoop.ozone.OzoneClientUtils; import org.apache.hadoop.ozone.OzoneClientUtils;
import org.apache.hadoop.ozone.OzoneConsts;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -80,7 +81,7 @@ public final class ObjectStoreHandler implements Closeable {
final StorageHandler storageHandler; final StorageHandler storageHandler;
// Initialize Jersey container for object store web application. // Initialize Jersey container for object store web application.
if ("distributed".equalsIgnoreCase(shType)) { if (OzoneConsts.OZONE_HANDLER_DISTRIBUTED.equalsIgnoreCase(shType)) {
RPC.setProtocolEngine(conf, StorageContainerLocationProtocolPB.class, RPC.setProtocolEngine(conf, StorageContainerLocationProtocolPB.class,
ProtobufRpcEngine.class); ProtobufRpcEngine.class);
long version = long version =
@ -95,13 +96,16 @@ public final class ObjectStoreHandler implements Closeable {
storageHandler = new DistributedStorageHandler(new OzoneConfiguration(), storageHandler = new DistributedStorageHandler(new OzoneConfiguration(),
this.storageContainerLocationClient); this.storageContainerLocationClient);
} else { } else {
if ("local".equalsIgnoreCase(shType)) { if (OzoneConsts.OZONE_HANDLER_LOCAL.equalsIgnoreCase(shType)) {
storageHandler = new LocalStorageHandler(conf); storageHandler = new LocalStorageHandler(conf);
this.storageContainerLocationClient = null; this.storageContainerLocationClient = null;
} else { } else {
throw new IllegalArgumentException( throw new IllegalArgumentException(
String.format("Unrecognized value for %s: %s", String.format("Unrecognized value for %s: %s,"
OZONE_HANDLER_TYPE_KEY, shType)); + " Allowed values are %s,%s",
OZONE_HANDLER_TYPE_KEY, shType,
OzoneConsts.OZONE_HANDLER_DISTRIBUTED,
OzoneConsts.OZONE_HANDLER_LOCAL));
} }
} }
ApplicationAdapter aa = ApplicationAdapter aa =

View File

@ -86,6 +86,12 @@ public final class OzoneConsts {
*/ */
public enum Versioning {NOT_DEFINED, ENABLED, DISABLED} public enum Versioning {NOT_DEFINED, ENABLED, DISABLED}
/**
* Ozone handler types
*/
public static final String OZONE_HANDLER_DISTRIBUTED = "distributed";
public static final String OZONE_HANDLER_LOCAL = "local";
private OzoneConsts() { private OzoneConsts() {
// Never Constructed // Never Constructed
} }

View File

@ -39,7 +39,7 @@
<description> <description>
The second key dfs.storage.handler.type tells ozone which storage The second key dfs.storage.handler.type tells ozone which storage
handler to use. The possible values are: handler to use. The possible values are:
ozone - The Ozone distributed storage handler. distributed - The Ozone distributed storage handler.
local - Local Storage handler strictly for testing. local - Local Storage handler strictly for testing.
</description> </description>
</property> </property>

View File

@ -28,6 +28,7 @@ import org.apache.hadoop.cblock.jscsiHelper.cache.impl.CBlockLocalCache;
import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.ozone.MiniOzoneCluster; import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConfiguration; import org.apache.hadoop.ozone.OzoneConfiguration;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.container.ozoneimpl.TestOzoneContainer; import org.apache.hadoop.ozone.container.ozoneimpl.TestOzoneContainer;
import org.apache.hadoop.scm.XceiverClientManager; import org.apache.hadoop.scm.XceiverClientManager;
import org.apache.hadoop.scm.XceiverClientSpi; import org.apache.hadoop.scm.XceiverClientSpi;
@ -90,7 +91,8 @@ public class TestLocalBlockCache {
config.setBoolean(DFS_CBLOCK_TRACE_IO, true); config.setBoolean(DFS_CBLOCK_TRACE_IO, true);
config.setBoolean(DFS_CBLOCK_ENABLE_SHORT_CIRCUIT_IO, true); config.setBoolean(DFS_CBLOCK_ENABLE_SHORT_CIRCUIT_IO, true);
cluster = new MiniOzoneCluster.Builder(config) cluster = new MiniOzoneCluster.Builder(config)
.numDataNodes(1).setHandlerType("distributed").build(); .numDataNodes(1)
.setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
storageContainerLocationClient = cluster storageContainerLocationClient = cluster
.createStorageContainerLocationClient(); .createStorageContainerLocationClient();
xceiverClientManager = new XceiverClientManager(config); xceiverClientManager = new XceiverClientManager(config);

View File

@ -55,7 +55,7 @@ public class TestContainerOperations {
SCMContainerPlacementCapacity.class, ContainerPlacementPolicy.class); SCMContainerPlacementCapacity.class, ContainerPlacementPolicy.class);
cluster = new MiniOzoneCluster.Builder(ozoneConf).numDataNodes(1) cluster = new MiniOzoneCluster.Builder(ozoneConf).numDataNodes(1)
.storageCapacities(new long[] {datanodeCapacities, datanodeCapacities}) .storageCapacities(new long[] {datanodeCapacities, datanodeCapacities})
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
StorageContainerLocationProtocolClientSideTranslatorPB client = StorageContainerLocationProtocolClientSideTranslatorPB client =
cluster.createStorageContainerLocationClient(); cluster.createStorageContainerLocationClient();
RPC.setProtocolEngine(ozoneConf, StorageContainerLocationProtocolPB.class, RPC.setProtocolEngine(ozoneConf, StorageContainerLocationProtocolPB.class,

View File

@ -78,7 +78,7 @@ public class TestMiniOzoneCluster {
public void testStartMultipleDatanodes() throws Exception { public void testStartMultipleDatanodes() throws Exception {
final int numberOfNodes = 3; final int numberOfNodes = 3;
cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(numberOfNodes) cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(numberOfNodes)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
// make sure datanode.id file is correct // make sure datanode.id file is correct
File idPath = new File( File idPath = new File(

View File

@ -69,7 +69,7 @@ public class TestStorageContainerManager {
//@Test //@Test
public void testLocationsForSingleKey() throws Exception { public void testLocationsForSingleKey() throws Exception {
cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1) cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
storageContainerLocationClient = storageContainerLocationClient =
cluster.createStorageContainerLocationClient(); cluster.createStorageContainerLocationClient();
Set<LocatedContainer> containers = Set<LocatedContainer> containers =
@ -85,7 +85,7 @@ public class TestStorageContainerManager {
//@Test //@Test
public void testLocationsForMultipleKeys() throws Exception { public void testLocationsForMultipleKeys() throws Exception {
cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1) cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
storageContainerLocationClient = storageContainerLocationClient =
cluster.createStorageContainerLocationClient(); cluster.createStorageContainerLocationClient();
Set<LocatedContainer> containers = Set<LocatedContainer> containers =
@ -102,7 +102,7 @@ public class TestStorageContainerManager {
//@Test //@Test
public void testNoDataNodes() throws Exception { public void testNoDataNodes() throws Exception {
cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(0) cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(0)
.setHandlerType("distributed") .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED)
.doNotwaitTobeOutofChillMode() .doNotwaitTobeOutofChillMode()
.build(); .build();
storageContainerLocationClient = storageContainerLocationClient =
@ -118,7 +118,7 @@ public class TestStorageContainerManager {
//@Test //@Test
public void testMultipleDataNodes() throws Exception { public void testMultipleDataNodes() throws Exception {
cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(3) cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(3)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
storageContainerLocationClient = storageContainerLocationClient =
cluster.createStorageContainerLocationClient(); cluster.createStorageContainerLocationClient();
Set<LocatedContainer> containers = Set<LocatedContainer> containers =

View File

@ -106,7 +106,7 @@ public class TestContainerPersistence {
Assert.assertTrue(containerDir.mkdirs()); Assert.assertTrue(containerDir.mkdirs());
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
containerManager = new ContainerManagerImpl(); containerManager = new ContainerManagerImpl();
chunkManager = new ChunkManagerImpl(containerManager); chunkManager = new ChunkManagerImpl(containerManager);
containerManager.setChunkManager(chunkManager); containerManager.setChunkManager(chunkManager);

View File

@ -22,6 +22,7 @@ import org.apache.hadoop.hdfs.ozone.protocol.proto.ContainerProtos;
import org.apache.hadoop.ozone.MiniOzoneCluster; import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConfigKeys; import org.apache.hadoop.ozone.OzoneConfigKeys;
import org.apache.hadoop.ozone.OzoneConfiguration; import org.apache.hadoop.ozone.OzoneConfiguration;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.container.ContainerTestHelper; import org.apache.hadoop.ozone.container.ContainerTestHelper;
import org.apache.hadoop.ozone.web.utils.OzoneUtils; import org.apache.hadoop.ozone.web.utils.OzoneUtils;
import org.apache.hadoop.scm.XceiverClient; import org.apache.hadoop.scm.XceiverClient;
@ -64,7 +65,7 @@ public class TestOzoneContainer {
try { try {
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setRandomContainerPort(false) .setRandomContainerPort(false)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
// We don't start Ozone Container via data node, we will do it // We don't start Ozone Container via data node, we will do it
// independently in our test path. // independently in our test path.
Pipeline pipeline = ContainerTestHelper.createSingleNodePipeline( Pipeline pipeline = ContainerTestHelper.createSingleNodePipeline(
@ -116,7 +117,7 @@ public class TestOzoneContainer {
ContainerTestHelper.initRatisConf(rpc, pipeline, conf); ContainerTestHelper.initRatisConf(rpc, pipeline, conf);
final MiniOzoneCluster cluster = new MiniOzoneCluster.Builder(conf) final MiniOzoneCluster cluster = new MiniOzoneCluster.Builder(conf)
.setHandlerType("local") .setHandlerType(OzoneConsts.OZONE_HANDLER_LOCAL)
.numDataNodes(pipeline.getMachines().size()) .numDataNodes(pipeline.getMachines().size())
.build(); .build();
cluster.waitOzoneReady(); cluster.waitOzoneReady();
@ -165,7 +166,7 @@ public class TestOzoneContainer {
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setRandomContainerPort(false) .setRandomContainerPort(false)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
// This client talks to ozone container via datanode. // This client talks to ozone container via datanode.
XceiverClient client = new XceiverClient(pipeline, conf); XceiverClient client = new XceiverClient(pipeline, conf);
@ -271,7 +272,7 @@ public class TestOzoneContainer {
client = createClientForTesting(conf); client = createClientForTesting(conf);
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setRandomContainerPort(false) .setRandomContainerPort(false)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
client.connect(); client.connect();
String containerName = client.getPipeline().getContainerName(); String containerName = client.getPipeline().getContainerName();
@ -316,7 +317,7 @@ public class TestOzoneContainer {
client = createClientForTesting(conf); client = createClientForTesting(conf);
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setRandomContainerPort(false) .setRandomContainerPort(false)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
client.connect(); client.connect();
String containerName = client.getPipeline().getContainerName(); String containerName = client.getPipeline().getContainerName();
@ -404,7 +405,7 @@ public class TestOzoneContainer {
client = createClientForTesting(conf); client = createClientForTesting(conf);
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setRandomContainerPort(false) .setRandomContainerPort(false)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
client.connect(); client.connect();
String containerName = client.getPipeline().getContainerName(); String containerName = client.getPipeline().getContainerName();

View File

@ -51,7 +51,7 @@ public class TestAllocateContainer {
conf = new OzoneConfiguration(); conf = new OzoneConfiguration();
cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1) cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1)
.storageCapacities(new long[] {datanodeCapacities, datanodeCapacities}) .storageCapacities(new long[] {datanodeCapacities, datanodeCapacities})
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
storageContainerLocationClient = storageContainerLocationClient =
cluster.createStorageContainerLocationClient(); cluster.createStorageContainerLocationClient();
cluster.waitForHeartbeatProcessed(); cluster.waitForHeartbeatProcessed();

View File

@ -80,7 +80,7 @@ public class TestContainerSQLCli {
conf.setInt(ScmConfigKeys.OZONE_SCM_CONTAINER_PROVISION_BATCH_SIZE, 2); conf.setInt(ScmConfigKeys.OZONE_SCM_CONTAINER_PROVISION_BATCH_SIZE, 2);
cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1) cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1)
.storageCapacities(new long[] {datanodeCapacities, datanodeCapacities}) .storageCapacities(new long[] {datanodeCapacities, datanodeCapacities})
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
storageContainerLocationClient = storageContainerLocationClient =
cluster.createStorageContainerLocationClient(); cluster.createStorageContainerLocationClient();
cluster.waitForHeartbeatProcessed(); cluster.waitForHeartbeatProcessed();

View File

@ -62,7 +62,7 @@ public class TestContainerSmallFile {
SCMContainerPlacementCapacity.class, ContainerPlacementPolicy.class); SCMContainerPlacementCapacity.class, ContainerPlacementPolicy.class);
cluster = new MiniOzoneCluster.Builder(ozoneConfig).numDataNodes(1) cluster = new MiniOzoneCluster.Builder(ozoneConfig).numDataNodes(1)
.storageCapacities(new long[] {datanodeCapacities, datanodeCapacities}) .storageCapacities(new long[] {datanodeCapacities, datanodeCapacities})
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
storageContainerLocationClient = cluster storageContainerLocationClient = cluster
.createStorageContainerLocationClient(); .createStorageContainerLocationClient();
xceiverClientManager = new XceiverClientManager(ozoneConfig); xceiverClientManager = new XceiverClientManager(ozoneConfig);

View File

@ -21,6 +21,7 @@ import org.apache.hadoop.hdfs.protocol.DatanodeID;
import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.ozone.MiniOzoneCluster; import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConfiguration; import org.apache.hadoop.ozone.OzoneConfiguration;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.container.common.helpers.ContainerData; import org.apache.hadoop.ozone.container.common.helpers.ContainerData;
import org.apache.hadoop.ozone.container.common.helpers.KeyUtils; import org.apache.hadoop.ozone.container.common.helpers.KeyUtils;
import org.apache.hadoop.ozone.container.common.interfaces.ContainerManager; import org.apache.hadoop.ozone.container.common.interfaces.ContainerManager;
@ -76,7 +77,7 @@ public class TestSCMCli {
public static void setup() throws Exception { public static void setup() throws Exception {
conf = new OzoneConfiguration(); conf = new OzoneConfiguration();
cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1) cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
storageContainerLocationClient = storageContainerLocationClient =
cluster.createStorageContainerLocationClient(); cluster.createStorageContainerLocationClient();
ScmClient client = new ContainerOperationClient( ScmClient client = new ContainerOperationClient(

View File

@ -23,6 +23,7 @@ import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.ozone.MiniOzoneCluster; import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConfiguration; import org.apache.hadoop.ozone.OzoneConfiguration;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.scm.node.NodeManager; import org.apache.hadoop.ozone.scm.node.NodeManager;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.AfterClass; import org.junit.AfterClass;
@ -56,7 +57,7 @@ public class TestSCMMXBean {
conf = new OzoneConfiguration(); conf = new OzoneConfiguration();
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.numDataNodes(numOfDatanodes) .numDataNodes(numOfDatanodes)
.setHandlerType("distributed") .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED)
.build(); .build();
scm = cluster.getStorageContainerManager(); scm = cluster.getStorageContainerManager();
mbs = ManagementFactory.getPlatformMBeanServer(); mbs = ManagementFactory.getPlatformMBeanServer();

View File

@ -24,6 +24,7 @@ import static org.apache.hadoop.ozone.OzoneConsts.CHUNK_SIZE;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import org.apache.commons.lang.RandomStringUtils; import org.apache.commons.lang.RandomStringUtils;
import org.apache.hadoop.ozone.OzoneConsts;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Rule; import org.junit.Rule;
@ -60,7 +61,7 @@ public class TestOzoneRestWithMiniCluster {
public static void init() throws Exception { public static void init() throws Exception {
conf = new OzoneConfiguration(); conf = new OzoneConfiguration();
cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1) cluster = new MiniOzoneCluster.Builder(conf).numDataNodes(1)
.setHandlerType("distributed").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_DISTRIBUTED).build();
ozoneClient = cluster.createOzoneClient(); ozoneClient = cluster.createOzoneClient();
} }

View File

@ -82,7 +82,7 @@ public class TestOzoneVolumes {
Logger.getLogger("log4j.logger.org.apache.http").setLevel(Level.DEBUG); Logger.getLogger("log4j.logger.org.apache.http").setLevel(Level.DEBUG);
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setHandlerType("local").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_LOCAL).build();
DataNode dataNode = cluster.getDataNodes().get(0); DataNode dataNode = cluster.getDataNodes().get(0);
port = dataNode.getInfoPort(); port = dataNode.getInfoPort();
} }

View File

@ -74,7 +74,7 @@ public class TestOzoneWebAccess {
conf.set(OzoneConfigKeys.OZONE_LOCALSTORAGE_ROOT, path); conf.set(OzoneConfigKeys.OZONE_LOCALSTORAGE_ROOT, path);
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setHandlerType("local").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_LOCAL).build();
DataNode dataNode = cluster.getDataNodes().get(0); DataNode dataNode = cluster.getDataNodes().get(0);
port = dataNode.getInfoPort(); port = dataNode.getInfoPort();
} }

View File

@ -22,6 +22,7 @@ import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.ozone.MiniOzoneCluster; import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConfigKeys; import org.apache.hadoop.ozone.OzoneConfigKeys;
import org.apache.hadoop.ozone.OzoneConfiguration; import org.apache.hadoop.ozone.OzoneConfiguration;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.web.exceptions.OzoneException; import org.apache.hadoop.ozone.web.exceptions.OzoneException;
import org.apache.hadoop.ozone.web.request.OzoneQuota; import org.apache.hadoop.ozone.web.request.OzoneQuota;
import org.apache.hadoop.ozone.web.utils.OzoneUtils; import org.apache.hadoop.ozone.web.utils.OzoneUtils;
@ -71,7 +72,7 @@ public class TestBuckets {
conf.set(OzoneConfigKeys.OZONE_LOCALSTORAGE_ROOT, path); conf.set(OzoneConfigKeys.OZONE_LOCALSTORAGE_ROOT, path);
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setHandlerType("local").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_LOCAL).build();
DataNode dataNode = cluster.getDataNodes().get(0); DataNode dataNode = cluster.getDataNodes().get(0);
final int port = dataNode.getInfoPort(); final int port = dataNode.getInfoPort();
client = new OzoneClient(String.format("http://localhost:%d", port)); client = new OzoneClient(String.format("http://localhost:%d", port));

View File

@ -23,6 +23,7 @@ import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.ozone.MiniOzoneCluster; import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConfigKeys; import org.apache.hadoop.ozone.OzoneConfigKeys;
import org.apache.hadoop.ozone.OzoneConfiguration; import org.apache.hadoop.ozone.OzoneConfiguration;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.web.exceptions.ErrorTable; import org.apache.hadoop.ozone.web.exceptions.ErrorTable;
import org.apache.hadoop.ozone.web.exceptions.OzoneException; import org.apache.hadoop.ozone.web.exceptions.OzoneException;
import org.apache.hadoop.ozone.web.utils.OzoneUtils; import org.apache.hadoop.ozone.web.utils.OzoneUtils;
@ -81,7 +82,7 @@ public class TestKeys {
Logger.getLogger("log4j.logger.org.apache.http").setLevel(Level.DEBUG); Logger.getLogger("log4j.logger.org.apache.http").setLevel(Level.DEBUG);
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setHandlerType("local").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_LOCAL).build();
DataNode dataNode = cluster.getDataNodes().get(0); DataNode dataNode = cluster.getDataNodes().get(0);
final int port = dataNode.getInfoPort(); final int port = dataNode.getInfoPort();
client = new OzoneClient(String.format("http://localhost:%d", port)); client = new OzoneClient(String.format("http://localhost:%d", port));

View File

@ -73,7 +73,7 @@ public class TestVolume {
Logger.getLogger("log4j.logger.org.apache.http").setLevel(Level.DEBUG); Logger.getLogger("log4j.logger.org.apache.http").setLevel(Level.DEBUG);
cluster = new MiniOzoneCluster.Builder(conf) cluster = new MiniOzoneCluster.Builder(conf)
.setHandlerType("local").build(); .setHandlerType(OzoneConsts.OZONE_HANDLER_LOCAL).build();
DataNode dataNode = cluster.getDataNodes().get(0); DataNode dataNode = cluster.getDataNodes().get(0);
final int port = dataNode.getInfoPort(); final int port = dataNode.getInfoPort();