HDFS-12568. Ozone: Cleanup the ozone-default.xml. Contributed by Anu Engineer.
This commit is contained in:
parent
05246e2b32
commit
6a754caca0
@ -49,7 +49,7 @@ public final class CBlockConfigKeys {
|
|||||||
4096;
|
4096;
|
||||||
|
|
||||||
public static final String DFS_CBLOCK_SERVICERPC_HANDLER_COUNT_KEY =
|
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 int DFS_CBLOCK_SERVICERPC_HANDLER_COUNT_DEFAULT = 10;
|
||||||
|
|
||||||
public static final String DFS_CBLOCK_SERVICE_LEVELDB_PATH_KEY =
|
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.
|
* Cache size in 1000s of entries. 256 indicates 256 * 1024.
|
||||||
*/
|
*/
|
||||||
public static final String DFS_CBLOCK_CACHE_QUEUE_SIZE_KB =
|
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;
|
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 int DFS_CBLOCK_SCM_PORT_DEFAULT = 9860;
|
||||||
|
|
||||||
public static final String DFS_CBLOCK_CONTAINER_SIZE_GB_KEY =
|
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 =
|
public static final int DFS_CBLOCK_CONTAINER_SIZE_GB_DEFAULT =
|
||||||
5;
|
5;
|
||||||
|
|
||||||
|
@ -89,8 +89,9 @@ public final class OzoneConfigKeys {
|
|||||||
public static final String OZONE_METADATA_STORE_IMPL_DEFAULT =
|
public static final String OZONE_METADATA_STORE_IMPL_DEFAULT =
|
||||||
OZONE_METADATA_STORE_IMPL_ROCKSDB;
|
OZONE_METADATA_STORE_IMPL_ROCKSDB;
|
||||||
|
|
||||||
public static final String OZONE_KEY_CACHE = "ozone.key.cache.size";
|
public static final String OZONE_CONTAINER_CACHE_SIZE =
|
||||||
public static final int OZONE_KEY_CACHE_DEFAULT = 1024;
|
"ozone.container.cache.size";
|
||||||
|
public static final int OZONE_CONTAINER_CACHE_DEFAULT = 1024;
|
||||||
|
|
||||||
public static final String OZONE_SCM_BLOCK_SIZE_KEY =
|
public static final String OZONE_SCM_BLOCK_SIZE_KEY =
|
||||||
"ozone.scm.block.size";
|
"ozone.scm.block.size";
|
||||||
@ -158,9 +159,6 @@ public final class OzoneConfigKeys {
|
|||||||
= ScmConfigKeys.DFS_CONTAINER_RATIS_RPC_TYPE_KEY;
|
= ScmConfigKeys.DFS_CONTAINER_RATIS_RPC_TYPE_KEY;
|
||||||
public static final String DFS_CONTAINER_RATIS_RPC_TYPE_DEFAULT
|
public static final String DFS_CONTAINER_RATIS_RPC_TYPE_DEFAULT
|
||||||
= ScmConfigKeys.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 =
|
public static final String DFS_CONTAINER_RATIS_DATANODE_STORAGE_DIR =
|
||||||
"dfs.container.ratis.datanode.storage.dir";
|
"dfs.container.ratis.datanode.storage.dir";
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ private KSMConfigKeys() {
|
|||||||
|
|
||||||
// LevelDB cache file uses an off-heap cache in LevelDB of 128 MB.
|
// LevelDB cache file uses an off-heap cache in LevelDB of 128 MB.
|
||||||
public static final String OZONE_KSM_DB_CACHE_SIZE_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 int OZONE_KSM_DB_CACHE_SIZE_DEFAULT = 128;
|
||||||
|
|
||||||
public static final String OZONE_KSM_USER_MAX_VOLUME =
|
public static final String OZONE_KSM_USER_MAX_VOLUME =
|
||||||
|
@ -59,8 +59,8 @@ private ContainerCache(int maxSize, float loadFactor, boolean
|
|||||||
*/
|
*/
|
||||||
public synchronized static ContainerCache getInstance(Configuration conf) {
|
public synchronized static ContainerCache getInstance(Configuration conf) {
|
||||||
if (cache == null) {
|
if (cache == null) {
|
||||||
int cacheSize = conf.getInt(OzoneConfigKeys.OZONE_KEY_CACHE,
|
int cacheSize = conf.getInt(OzoneConfigKeys.OZONE_CONTAINER_CACHE_SIZE,
|
||||||
OzoneConfigKeys.OZONE_KEY_CACHE_DEFAULT);
|
OzoneConfigKeys.OZONE_CONTAINER_CACHE_DEFAULT);
|
||||||
cache = new ContainerCache(cacheSize, LOAD_FACTOR, true);
|
cache = new ContainerCache(cacheSize, LOAD_FACTOR, true);
|
||||||
}
|
}
|
||||||
return cache;
|
return cache;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -18,13 +18,9 @@
|
|||||||
package org.apache.hadoop.ozone;
|
package org.apache.hadoop.ozone;
|
||||||
|
|
||||||
import org.apache.hadoop.cblock.CBlockConfigKeys;
|
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.conf.TestConfigurationFieldsBase;
|
||||||
import org.apache.hadoop.ozone.ksm.KSMConfigKeys;
|
import org.apache.hadoop.ozone.ksm.KSMConfigKeys;
|
||||||
import org.apache.hadoop.scm.ScmConfigKeys;
|
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.
|
* Tests if configuration constants documented in ozone-defaults.xml.
|
||||||
@ -40,32 +36,4 @@ public void initializeMemberVariables() {
|
|||||||
errorIfMissingConfigProps = true;
|
errorIfMissingConfigProps = true;
|
||||||
errorIfMissingXmlProps = 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());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user