HDFS-12568. Ozone: Cleanup the ozone-default.xml. Contributed by Anu Engineer.

This commit is contained in:
Anu Engineer 2017-10-03 11:41:27 -07:00 committed by Owen O'Malley
parent 05246e2b32
commit 6a754caca0
6 changed files with 868 additions and 894 deletions

View File

@ -49,7 +49,7 @@ public final class CBlockConfigKeys {
4096;
public static final String DFS_CBLOCK_SERVICERPC_HANDLER_COUNT_KEY =
"dfs.storage.service.handler.count";
"dfs.cblock.service.handler.count";
public static final int DFS_CBLOCK_SERVICERPC_HANDLER_COUNT_DEFAULT = 10;
public static final String DFS_CBLOCK_SERVICE_LEVELDB_PATH_KEY =
@ -82,7 +82,7 @@ public final class CBlockConfigKeys {
* Cache size in 1000s of entries. 256 indicates 256 * 1024.
*/
public static final String DFS_CBLOCK_CACHE_QUEUE_SIZE_KB =
"dfs.cblock.cache.cache.size.in.kb";
"dfs.cblock.cache.queue.size.in.kb";
public static final int DFS_CBLOCK_CACHE_QUEUE_SIZE_KB_DEFAULT = 256;
/**
@ -148,7 +148,7 @@ public final class CBlockConfigKeys {
public static final int DFS_CBLOCK_SCM_PORT_DEFAULT = 9860;
public static final String DFS_CBLOCK_CONTAINER_SIZE_GB_KEY =
"dfs.cblock.container.size";
"dfs.cblock.container.size.gb";
public static final int DFS_CBLOCK_CONTAINER_SIZE_GB_DEFAULT =
5;

View File

@ -89,8 +89,9 @@ public final class OzoneConfigKeys {
public static final String OZONE_METADATA_STORE_IMPL_DEFAULT =
OZONE_METADATA_STORE_IMPL_ROCKSDB;
public static final String OZONE_KEY_CACHE = "ozone.key.cache.size";
public static final int OZONE_KEY_CACHE_DEFAULT = 1024;
public static final String OZONE_CONTAINER_CACHE_SIZE =
"ozone.container.cache.size";
public static final int OZONE_CONTAINER_CACHE_DEFAULT = 1024;
public static final String OZONE_SCM_BLOCK_SIZE_KEY =
"ozone.scm.block.size";
@ -158,9 +159,6 @@ public final class OzoneConfigKeys {
= ScmConfigKeys.DFS_CONTAINER_RATIS_RPC_TYPE_KEY;
public static final String DFS_CONTAINER_RATIS_RPC_TYPE_DEFAULT
= ScmConfigKeys.DFS_CONTAINER_RATIS_RPC_TYPE_DEFAULT;
/** A unique ID to identify a Ratis server. */
public static final String DFS_CONTAINER_RATIS_SERVER_ID =
"dfs.container.ratis.server.id";
public static final String DFS_CONTAINER_RATIS_DATANODE_STORAGE_DIR =
"dfs.container.ratis.datanode.storage.dir";

View File

@ -57,7 +57,7 @@ private KSMConfigKeys() {
// LevelDB cache file uses an off-heap cache in LevelDB of 128 MB.
public static final String OZONE_KSM_DB_CACHE_SIZE_MB =
"ozone.ksm.leveldb.cache.size.mb";
"ozone.ksm.db.cache.size.mb";
public static final int OZONE_KSM_DB_CACHE_SIZE_DEFAULT = 128;
public static final String OZONE_KSM_USER_MAX_VOLUME =

View File

@ -59,8 +59,8 @@ private ContainerCache(int maxSize, float loadFactor, boolean
*/
public synchronized static ContainerCache getInstance(Configuration conf) {
if (cache == null) {
int cacheSize = conf.getInt(OzoneConfigKeys.OZONE_KEY_CACHE,
OzoneConfigKeys.OZONE_KEY_CACHE_DEFAULT);
int cacheSize = conf.getInt(OzoneConfigKeys.OZONE_CONTAINER_CACHE_SIZE,
OzoneConfigKeys.OZONE_CONTAINER_CACHE_DEFAULT);
cache = new ContainerCache(cacheSize, LOAD_FACTOR, true);
}
return cache;

View File

@ -18,13 +18,9 @@
package org.apache.hadoop.ozone;
import org.apache.hadoop.cblock.CBlockConfigKeys;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.OzonePropertyTag;
import org.apache.hadoop.conf.TestConfigurationFieldsBase;
import org.apache.hadoop.ozone.ksm.KSMConfigKeys;
import org.apache.hadoop.scm.ScmConfigKeys;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Tests if configuration constants documented in ozone-defaults.xml.
@ -40,32 +36,4 @@ public void initializeMemberVariables() {
errorIfMissingConfigProps = true;
errorIfMissingXmlProps = true;
}
@Test
public void testOzoneTags() {
Configuration config = new OzoneConfiguration();
config.reloadConfiguration();
// To load default resources
config.get("ozone.enabled");
assertEquals(87,
config.getAllPropertiesByTag(OzonePropertyTag.OZONE).size());
assertEquals(15, config.getAllPropertiesByTag(OzonePropertyTag.KSM)
.size());
assertEquals(6, config.getAllPropertiesByTag(OzonePropertyTag.SCM)
.size());
assertEquals(6, config.getAllPropertiesByTag(OzonePropertyTag.MANAGEMENT)
.size());
assertEquals(7, config.getAllPropertiesByTag(OzonePropertyTag.SECURITY)
.size());
assertEquals(9, config.getAllPropertiesByTag(OzonePropertyTag.PERFORMANCE)
.size());
assertEquals(1, config.getAllPropertiesByTag(OzonePropertyTag.DEBUG)
.size());
assertEquals(3, config.getAllPropertiesByTag(OzonePropertyTag.REQUIRED)
.size());
assertEquals(2, config.getAllPropertiesByTag(OzonePropertyTag.RATIS)
.size());
}
}