HBASE-760 brittle/broken HCD create handling in HBase.rb

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@678866 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-07-22 19:22:21 +00:00
parent ec38a78ca8
commit be3f1a6ea3
6 changed files with 14 additions and 19 deletions

View File

@ -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,

View File

@ -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'"

View File

@ -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));
}
/**

View File

@ -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";
}

View File

@ -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));
}
/**

View File

@ -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 {