diff --git a/bin/HBase.rb b/bin/HBase.rb index 4f5c6e703fa..39860062abb 100644 --- a/bin/HBase.rb +++ b/bin/HBase.rb @@ -25,6 +25,7 @@ module HBase TIMESTAMP = "TIMESTAMP" NAME = HConstants::NAME VERSIONS = HConstants::VERSIONS + IN_MEMORY = HConstants::IN_MEMORY STOPROW = "STOPROW" STARTROW = "STARTROW" ENDROW = STOPROW @@ -158,7 +159,7 @@ module HBase arg[VERSIONS]? arg[VERSIONS]: HColumnDescriptor::DEFAULT_VERSIONS, arg[HColumnDescriptor::COMPRESSION]? HColumnDescriptor::CompressionType::valueOf(arg[HColumnDescriptor::COMPRESSION]): HColumnDescriptor::DEFAULT_COMPRESSION, - arg[HColumnDescriptor::IN_MEMORY]? arg[HColumnDescriptor::IN_MEMORY]: HColumnDescriptor::DEFAULT_IN_MEMORY, + arg[IN_MEMORY]? arg[IN_MEMORY]: HColumnDescriptor::DEFAULT_IN_MEMORY, arg[HColumnDescriptor::BLOCKCACHE]? arg[HColumnDescriptor::BLOCKCACHE]: HColumnDescriptor::DEFAULT_BLOCKCACHE, arg[HColumnDescriptor::LENGTH]? arg[HColumnDescriptor::LENGTH]: HColumnDescriptor::DEFAULT_LENGTH, arg[HColumnDescriptor::TTL]? arg[HColumnDescriptor::TTL]: HColumnDescriptor::DEFAULT_TTL, diff --git a/bin/hirb.rb b/bin/hirb.rb index 1361eafc873..0687e409b7f 100644 --- a/bin/hirb.rb +++ b/bin/hirb.rb @@ -117,18 +117,14 @@ HBASE SHELL COMMANDS: create Create table; pass table name, a dictionary of specifications per column family, and optionally a dictionary of table configuration. Dictionaries are described below in the GENERAL NOTES section. - For example, to create a table named 't1' with a single family named - 'f1' with an alternate maximum number of cells, type: + Examples: hbase> create 't1', {NAME => 'f1', VERSIONS => 5} - - To create a table with 'f1', 'f2', and 'f3' using all defaults: - hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'} - - or in shorthand: - + hbase> # The above in shorthand would be the following: hbase> create 't1', 'f1', 'f2', 'f3' + hbase> create 't1', {NAME => 'f1', VERSIONS => 1, TTL => 2592000, \ + BLOCKCACHE => true} describe Describe the named table: e.g. "hbase> describe 't1'" diff --git a/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java b/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java index cb8754f7aa4..fd1ae7507e1 100644 --- a/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java +++ b/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java @@ -62,16 +62,13 @@ public class HColumnDescriptor implements WritableComparable { } public static final String COMPRESSION = "COMPRESSION"; - public static final String IN_MEMORY = "IN_MEMORY"; public static final String BLOCKCACHE = "BLOCKCACHE"; public static final String LENGTH = "LENGTH"; public static final String TTL = "TTL"; - public static final String VERSIONS = "VERSIONS"; public static final String BLOOMFILTER = "BLOOMFILTER"; public static final String FOREVER = "FOREVER"; public static final String MAPFILE_INDEX_INTERVAL = "MAPFILE_INDEX_INTERVAL"; - public static final String MEMCACHE_FLUSHSIZE = "MEMCACHE_FLUSHSIZE"; /** * Default compression type. @@ -322,7 +319,7 @@ public class HColumnDescriptor implements WritableComparable { /** @return maximum number of versions */ public int getMaxVersions() { - String value = getValue(VERSIONS); + String value = getValue(HConstants.VERSIONS); if (value != null) return Integer.valueOf(value); return DEFAULT_VERSIONS; @@ -332,7 +329,7 @@ public class HColumnDescriptor implements WritableComparable { * @param maxVersions maximum number of versions */ public void setMaxVersions(int maxVersions) { - setValue(VERSIONS, Integer.toString(maxVersions)); + setValue(HConstants.VERSIONS, Integer.toString(maxVersions)); } /** @@ -359,7 +356,7 @@ public class HColumnDescriptor implements WritableComparable { * @return True if we are to keep all in use HRegionServer cache. */ public boolean isInMemory() { - String value = getValue(IN_MEMORY); + String value = getValue(HConstants.IN_MEMORY); if (value != null) return Boolean.valueOf(value); return DEFAULT_IN_MEMORY; @@ -370,7 +367,7 @@ public class HColumnDescriptor implements WritableComparable { * cache */ public void setInMemory(boolean inMemory) { - setValue(IN_MEMORY, Boolean.toString(inMemory)); + setValue(HConstants.IN_MEMORY, Boolean.toString(inMemory)); } /** diff --git a/src/java/org/apache/hadoop/hbase/HConstants.java b/src/java/org/apache/hadoop/hbase/HConstants.java index 8078875c374..80fb5aaebdd 100644 --- a/src/java/org/apache/hadoop/hbase/HConstants.java +++ b/src/java/org/apache/hadoop/hbase/HConstants.java @@ -225,4 +225,5 @@ public interface HConstants { public static final String NAME = "NAME"; public static final String VERSIONS = "VERSIONS"; + public static final String IN_MEMORY = "IN_MEMORY"; } \ No newline at end of file diff --git a/src/java/org/apache/hadoop/hbase/HTableDescriptor.java b/src/java/org/apache/hadoop/hbase/HTableDescriptor.java index df28183657a..58618266e99 100644 --- a/src/java/org/apache/hadoop/hbase/HTableDescriptor.java +++ b/src/java/org/apache/hadoop/hbase/HTableDescriptor.java @@ -69,7 +69,6 @@ public class HTableDescriptor implements WritableComparable { public static final String FAMILIES = "FAMILIES"; public static final String MAX_FILESIZE = "MAX_FILESIZE"; - public static final String IN_MEMORY = "IN_MEMORY"; public static final String READONLY = "READONLY"; public static final String MEMCACHE_FLUSHSIZE = "MEMCACHE_FLUSHSIZE"; public static final String IS_ROOT = "IS_ROOT"; @@ -269,7 +268,7 @@ public class HTableDescriptor implements WritableComparable { * HRegionServer cache only */ public boolean isInMemory() { - String value = getValue(IN_MEMORY); + String value = getValue(HConstants.IN_MEMORY); if (value != null) return Boolean.valueOf(value); return DEFAULT_IN_MEMORY; @@ -280,7 +279,7 @@ public class HTableDescriptor implements WritableComparable { * the HRegionServer cache only. */ public void setInMemory(boolean inMemory) { - setValue(IN_MEMORY, Boolean.toString(inMemory)); + setValue(HConstants.IN_MEMORY, Boolean.toString(inMemory)); } /** diff --git a/src/test/org/apache/hadoop/hbase/regionserver/TestRegionServerExit.java b/src/test/org/apache/hadoop/hbase/regionserver/TestRegionServerExit.java index 4f9ef4ff5e0..8bb091a5212 100644 --- a/src/test/org/apache/hadoop/hbase/regionserver/TestRegionServerExit.java +++ b/src/test/org/apache/hadoop/hbase/regionserver/TestRegionServerExit.java @@ -78,6 +78,7 @@ public class TestRegionServerExit extends HBaseClusterTestCase { /** * Test abort of region server. + * Test is flakey up on hudson. Needs work. * @throws IOException */ public void disabledTestCleanExit() throws IOException {