diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/CBlockConfigKeys.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/CBlockConfigKeys.java index e49c6de1f9..35b8961502 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/CBlockConfigKeys.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/CBlockConfigKeys.java @@ -25,28 +25,19 @@ public final class CBlockConfigKeys { public static final String DFS_CBLOCK_SERVICERPC_ADDRESS_KEY = "dfs.cblock.servicerpc-address"; - public static final String DFS_CBLOCK_SERVICERPC_PORT_KEY = - "dfs.cblock.servicerpc.port"; public static final int DFS_CBLOCK_SERVICERPC_PORT_DEFAULT = 9810; - public static final String DFS_CBLOCK_SERVICERPC_HOSTNAME_KEY = - "dfs.cblock.servicerpc.hostname"; public static final String DFS_CBLOCK_SERVICERPC_HOSTNAME_DEFAULT = "0.0.0.0"; - public static final String DFS_CBLOCK_SERVICERPC_ADDRESS_DEFAULT = - DFS_CBLOCK_SERVICERPC_HOSTNAME_DEFAULT - + ":" + DFS_CBLOCK_SERVICERPC_PORT_DEFAULT; public static final String DFS_CBLOCK_JSCSIRPC_ADDRESS_KEY = "dfs.cblock.jscsi-address"; //The port on CBlockManager node for jSCSI to ask + public static final String DFS_CBLOCK_JSCSI_PORT_KEY = + "dfs.cblock.jscsi.port"; public static final int DFS_CBLOCK_JSCSI_PORT_DEFAULT = 9811; - public static final String DFS_CBLOCK_JSCSIRPC_ADDRESS_DEFAULT = - DFS_CBLOCK_SERVICERPC_HOSTNAME_DEFAULT - + ":" + DFS_CBLOCK_JSCSI_PORT_DEFAULT; - public static final String DFS_CBLOCK_SERVICERPC_BIND_HOST_KEY = "dfs.cblock.service.rpc-bind-host"; @@ -97,9 +88,9 @@ public final class CBlockConfigKeys { /** * Minimum Number of threads that cache pool will use for background I/O. */ - public static final String DFS_CBLOCK_CACHE_CORE_POOL_SIZE = - "dfs.cblock.cache.core.pool.size"; - public static final int DFS_CBLOCK_CACHE_CORE_POOL_SIZE_DEFAULT = 16; + public static final String DFS_CBLOCK_CACHE_CORE_MIN_POOL_SIZE = + "dfs.cblock.cache.core.min.pool.size"; + public static final int DFS_CBLOCK_CACHE_CORE_MIN_POOL_SIZE_DEFAULT = 16; /** * Maximum Number of threads that cache pool will use for background I/O. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/jscsiHelper/ContainerCacheFlusher.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/jscsiHelper/ContainerCacheFlusher.java index 3998333fff..1582675bee 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/jscsiHelper/ContainerCacheFlusher.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/jscsiHelper/ContainerCacheFlusher.java @@ -61,9 +61,9 @@ import static org.apache.hadoop.cblock.CBlockConfigKeys .DFS_CBLOCK_CACHE_BLOCK_BUFFER_SIZE_DEFAULT; import static org.apache.hadoop.cblock.CBlockConfigKeys - .DFS_CBLOCK_CACHE_CORE_POOL_SIZE; + .DFS_CBLOCK_CACHE_CORE_MIN_POOL_SIZE; import static org.apache.hadoop.cblock.CBlockConfigKeys - .DFS_CBLOCK_CACHE_CORE_POOL_SIZE_DEFAULT; + .DFS_CBLOCK_CACHE_CORE_MIN_POOL_SIZE_DEFAULT; import static org.apache.hadoop.cblock.CBlockConfigKeys .DFS_CBLOCK_CACHE_KEEP_ALIVE_SECONDS; import static org.apache.hadoop.cblock.CBlockConfigKeys @@ -114,8 +114,8 @@ public ContainerCacheFlusher(Configuration config, CBlockTargetMetrics metrics) { int queueSize = config.getInt(DFS_CBLOCK_CACHE_QUEUE_SIZE_KB, DFS_CBLOCK_CACHE_QUEUE_SIZE_KB_DEFAULT) * 1024; - int corePoolSize = config.getInt(DFS_CBLOCK_CACHE_CORE_POOL_SIZE, - DFS_CBLOCK_CACHE_CORE_POOL_SIZE_DEFAULT); + int corePoolSize = config.getInt(DFS_CBLOCK_CACHE_CORE_MIN_POOL_SIZE, + DFS_CBLOCK_CACHE_CORE_MIN_POOL_SIZE_DEFAULT); int maxPoolSize = config.getInt(DFS_CBLOCK_CACHE_MAX_POOL_SIZE, DFS_CBLOCK_CACHE_MAX_POOL_SIZE_DEFAULT); long keepAlive = config.getLong(DFS_CBLOCK_CACHE_KEEP_ALIVE_SECONDS, diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/jscsiHelper/SCSITargetDaemon.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/jscsiHelper/SCSITargetDaemon.java index e0aa9ffc13..9751849caa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/jscsiHelper/SCSITargetDaemon.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/jscsiHelper/SCSITargetDaemon.java @@ -36,6 +36,7 @@ import static org.apache.hadoop.cblock.CBlockConfigKeys.DFS_CBLOCK_JSCSI_CBLOCK_SERVER_ADDRESS_DEFAULT; import static org.apache.hadoop.cblock.CBlockConfigKeys.DFS_CBLOCK_JSCSI_CBLOCK_SERVER_ADDRESS_KEY; import static org.apache.hadoop.cblock.CBlockConfigKeys.DFS_CBLOCK_JSCSI_PORT_DEFAULT; +import static org.apache.hadoop.cblock.CBlockConfigKeys.DFS_CBLOCK_JSCSI_PORT_KEY; import static org.apache.hadoop.cblock.CBlockConfigKeys.DFS_CBLOCK_JSCSI_SERVER_ADDRESS_DEFAULT; import static org.apache.hadoop.cblock.CBlockConfigKeys.DFS_CBLOCK_JSCSI_SERVER_ADDRESS_KEY; import static org.apache.hadoop.scm.ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY; @@ -67,6 +68,10 @@ public static void main(String[] args) throws Exception { DFS_CBLOCK_JSCSI_CBLOCK_SERVER_ADDRESS_KEY, DFS_CBLOCK_JSCSI_CBLOCK_SERVER_ADDRESS_DEFAULT ); + int cbmPort = ozoneConf.getInt( + DFS_CBLOCK_JSCSI_PORT_KEY, + DFS_CBLOCK_JSCSI_PORT_DEFAULT + ); String scmAddress = ozoneConf.get(OZONE_SCM_CLIENT_BIND_HOST_KEY, OZONE_SCM_CLIENT_BIND_HOST_DEFAULT); @@ -82,7 +87,7 @@ public static void main(String[] args) throws Exception { ozoneConf.set(OZONE_SCM_DATANODE_ADDRESS_KEY, scmDataodeAddress); InetSocketAddress cbmAddress = new InetSocketAddress( - cbmIPAddress, DFS_CBLOCK_JSCSI_PORT_DEFAULT); + cbmIPAddress, cbmPort); long version = RPC.getProtocolVersion( CBlockServiceProtocolPB.class); CBlockClientProtocolClientSideTranslatorPB cbmClient = diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml index d9d2d3e0a4..766da66550 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml @@ -579,5 +579,162 @@ The keytab file for Kerberos authentication in KSM. - + + + dfs.cblock.servicerpc-address + + + The address that cblock will be bind to, should be a host:port format, + this setting is required for cblock server to start. + + + + + dfs.cblock.jscsi.port + 9811 + + The port on CBlockManager node for jSCSI to talk to. + + + + + dfs.storage.service.handler.count + 10 + + Default number of handlers for CBlock service rpc. + + + + + dfs.cblock.service.leveldb.path + /tmp/cblock_levelDB.dat + + Default path for the cblock meta data disk store. + + + + + dfs.cblock.disk.cache.path + /tmp/cblockCacheDB + + Default path for the cblock local cache. + + + + + dfs.cblock.trace.io + false + + Default flag for enabling trace io. + + + + + dfs.cblock.short.circuit.io + false + + Default flag to enable cblock local cache. + + + + + dfs.cblock.cache.cache.size.in.kb + 256 + + Default cblock cache queue size, in number of kb. + + + + + dfs.cblock.cache.core.min.pool.size + 16 + + Minimum number of thread pool thread that cBlock cache will use for background I/O. + + + + + dfs.cblock.cache.max.pool.size + 256 + + Maximum number of thread pool thread that cBlcok cache will use for background I/O. + + + + + dfs.cblock.cache.keep.alive.seconds + 60 + + Number of seconds to keep the Thread alive when it is idle. + + + + + dfs.cblock.cache.thread.priority + 5 + + Priority of cache flusher thread, affecting the relative + performance of write and read.upported values are 1, 5, 10. + Use 10 for high priority and 1 for low priority. + + + + + dfs.cblock.cache.block.buffer.size + 512 + + Block Buffer size in terms of blockID entries, in number of blockIDs. + + + + + dfs.cblock.block.buffer.flush.interval.seconds + 60 + + The interval to flush cblock buffer in seconds. + + + + + dfs.cblock.jscsi.server.address + 127.0.0.1 + + The address that jscsi server will be running, should have one + local jscsi server for each client that tries to mount cblock. + + + + + dfs.cblock.jscsi.cblock.server.address + 127.0.0.1 + + The address local jscsi server will use to talk to cblock manager. + + + + + dfs.cblock.container.size + 5 + + The size of ozone container in number of GBs. Note that this is + not setting container size for ozone, but rather, this is setting + that assumption that cblock manager will make about ozone. + + + + + dfs.cblock.cache.leveldb.cache.size.mb + 256 + + The size of LevelDB cache file which uses an off-heap cache in LevelDB. + + + + + dfs.cblock.cache.max.retry + 65536 + + The maximum number of retries when writing a block to container. + +