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:
parent
ec38a78ca8
commit
be3f1a6ea3
|
@ -25,6 +25,7 @@ module HBase
|
||||||
TIMESTAMP = "TIMESTAMP"
|
TIMESTAMP = "TIMESTAMP"
|
||||||
NAME = HConstants::NAME
|
NAME = HConstants::NAME
|
||||||
VERSIONS = HConstants::VERSIONS
|
VERSIONS = HConstants::VERSIONS
|
||||||
|
IN_MEMORY = HConstants::IN_MEMORY
|
||||||
STOPROW = "STOPROW"
|
STOPROW = "STOPROW"
|
||||||
STARTROW = "STARTROW"
|
STARTROW = "STARTROW"
|
||||||
ENDROW = STOPROW
|
ENDROW = STOPROW
|
||||||
|
@ -158,7 +159,7 @@ module HBase
|
||||||
arg[VERSIONS]? arg[VERSIONS]: HColumnDescriptor::DEFAULT_VERSIONS,
|
arg[VERSIONS]? arg[VERSIONS]: HColumnDescriptor::DEFAULT_VERSIONS,
|
||||||
arg[HColumnDescriptor::COMPRESSION]? HColumnDescriptor::CompressionType::valueOf(arg[HColumnDescriptor::COMPRESSION]):
|
arg[HColumnDescriptor::COMPRESSION]? HColumnDescriptor::CompressionType::valueOf(arg[HColumnDescriptor::COMPRESSION]):
|
||||||
HColumnDescriptor::DEFAULT_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::BLOCKCACHE]? arg[HColumnDescriptor::BLOCKCACHE]: HColumnDescriptor::DEFAULT_BLOCKCACHE,
|
||||||
arg[HColumnDescriptor::LENGTH]? arg[HColumnDescriptor::LENGTH]: HColumnDescriptor::DEFAULT_LENGTH,
|
arg[HColumnDescriptor::LENGTH]? arg[HColumnDescriptor::LENGTH]: HColumnDescriptor::DEFAULT_LENGTH,
|
||||||
arg[HColumnDescriptor::TTL]? arg[HColumnDescriptor::TTL]: HColumnDescriptor::DEFAULT_TTL,
|
arg[HColumnDescriptor::TTL]? arg[HColumnDescriptor::TTL]: HColumnDescriptor::DEFAULT_TTL,
|
||||||
|
|
12
bin/hirb.rb
12
bin/hirb.rb
|
@ -117,18 +117,14 @@ HBASE SHELL COMMANDS:
|
||||||
create Create table; pass table name, a dictionary of specifications per
|
create Create table; pass table name, a dictionary of specifications per
|
||||||
column family, and optionally a dictionary of table configuration.
|
column family, and optionally a dictionary of table configuration.
|
||||||
Dictionaries are described below in the GENERAL NOTES section.
|
Dictionaries are described below in the GENERAL NOTES section.
|
||||||
For example, to create a table named 't1' with a single family named
|
Examples:
|
||||||
'f1' with an alternate maximum number of cells, type:
|
|
||||||
|
|
||||||
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}
|
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'}
|
hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'}
|
||||||
|
hbase> # The above in shorthand would be the following:
|
||||||
or in shorthand:
|
|
||||||
|
|
||||||
hbase> create 't1', 'f1', 'f2', 'f3'
|
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'"
|
describe Describe the named table: e.g. "hbase> describe 't1'"
|
||||||
|
|
||||||
|
|
|
@ -62,16 +62,13 @@ public class HColumnDescriptor implements WritableComparable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String COMPRESSION = "COMPRESSION";
|
public static final String COMPRESSION = "COMPRESSION";
|
||||||
public static final String IN_MEMORY = "IN_MEMORY";
|
|
||||||
public static final String BLOCKCACHE = "BLOCKCACHE";
|
public static final String BLOCKCACHE = "BLOCKCACHE";
|
||||||
public static final String LENGTH = "LENGTH";
|
public static final String LENGTH = "LENGTH";
|
||||||
public static final String TTL = "TTL";
|
public static final String TTL = "TTL";
|
||||||
public static final String VERSIONS = "VERSIONS";
|
|
||||||
public static final String BLOOMFILTER = "BLOOMFILTER";
|
public static final String BLOOMFILTER = "BLOOMFILTER";
|
||||||
public static final String FOREVER = "FOREVER";
|
public static final String FOREVER = "FOREVER";
|
||||||
public static final String MAPFILE_INDEX_INTERVAL =
|
public static final String MAPFILE_INDEX_INTERVAL =
|
||||||
"MAPFILE_INDEX_INTERVAL";
|
"MAPFILE_INDEX_INTERVAL";
|
||||||
public static final String MEMCACHE_FLUSHSIZE = "MEMCACHE_FLUSHSIZE";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default compression type.
|
* Default compression type.
|
||||||
|
@ -322,7 +319,7 @@ public class HColumnDescriptor implements WritableComparable {
|
||||||
|
|
||||||
/** @return maximum number of versions */
|
/** @return maximum number of versions */
|
||||||
public int getMaxVersions() {
|
public int getMaxVersions() {
|
||||||
String value = getValue(VERSIONS);
|
String value = getValue(HConstants.VERSIONS);
|
||||||
if (value != null)
|
if (value != null)
|
||||||
return Integer.valueOf(value);
|
return Integer.valueOf(value);
|
||||||
return DEFAULT_VERSIONS;
|
return DEFAULT_VERSIONS;
|
||||||
|
@ -332,7 +329,7 @@ public class HColumnDescriptor implements WritableComparable {
|
||||||
* @param maxVersions maximum number of versions
|
* @param maxVersions maximum number of versions
|
||||||
*/
|
*/
|
||||||
public void setMaxVersions(int maxVersions) {
|
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.
|
* @return True if we are to keep all in use HRegionServer cache.
|
||||||
*/
|
*/
|
||||||
public boolean isInMemory() {
|
public boolean isInMemory() {
|
||||||
String value = getValue(IN_MEMORY);
|
String value = getValue(HConstants.IN_MEMORY);
|
||||||
if (value != null)
|
if (value != null)
|
||||||
return Boolean.valueOf(value);
|
return Boolean.valueOf(value);
|
||||||
return DEFAULT_IN_MEMORY;
|
return DEFAULT_IN_MEMORY;
|
||||||
|
@ -370,7 +367,7 @@ public class HColumnDescriptor implements WritableComparable {
|
||||||
* cache
|
* cache
|
||||||
*/
|
*/
|
||||||
public void setInMemory(boolean inMemory) {
|
public void setInMemory(boolean inMemory) {
|
||||||
setValue(IN_MEMORY, Boolean.toString(inMemory));
|
setValue(HConstants.IN_MEMORY, Boolean.toString(inMemory));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -225,4 +225,5 @@ public interface HConstants {
|
||||||
|
|
||||||
public static final String NAME = "NAME";
|
public static final String NAME = "NAME";
|
||||||
public static final String VERSIONS = "VERSIONS";
|
public static final String VERSIONS = "VERSIONS";
|
||||||
|
public static final String IN_MEMORY = "IN_MEMORY";
|
||||||
}
|
}
|
|
@ -69,7 +69,6 @@ public class HTableDescriptor implements WritableComparable {
|
||||||
public static final String FAMILIES = "FAMILIES";
|
public static final String FAMILIES = "FAMILIES";
|
||||||
|
|
||||||
public static final String MAX_FILESIZE = "MAX_FILESIZE";
|
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 READONLY = "READONLY";
|
||||||
public static final String MEMCACHE_FLUSHSIZE = "MEMCACHE_FLUSHSIZE";
|
public static final String MEMCACHE_FLUSHSIZE = "MEMCACHE_FLUSHSIZE";
|
||||||
public static final String IS_ROOT = "IS_ROOT";
|
public static final String IS_ROOT = "IS_ROOT";
|
||||||
|
@ -269,7 +268,7 @@ public class HTableDescriptor implements WritableComparable {
|
||||||
* HRegionServer cache only
|
* HRegionServer cache only
|
||||||
*/
|
*/
|
||||||
public boolean isInMemory() {
|
public boolean isInMemory() {
|
||||||
String value = getValue(IN_MEMORY);
|
String value = getValue(HConstants.IN_MEMORY);
|
||||||
if (value != null)
|
if (value != null)
|
||||||
return Boolean.valueOf(value);
|
return Boolean.valueOf(value);
|
||||||
return DEFAULT_IN_MEMORY;
|
return DEFAULT_IN_MEMORY;
|
||||||
|
@ -280,7 +279,7 @@ public class HTableDescriptor implements WritableComparable {
|
||||||
* the HRegionServer cache only.
|
* the HRegionServer cache only.
|
||||||
*/
|
*/
|
||||||
public void setInMemory(boolean inMemory) {
|
public void setInMemory(boolean inMemory) {
|
||||||
setValue(IN_MEMORY, Boolean.toString(inMemory));
|
setValue(HConstants.IN_MEMORY, Boolean.toString(inMemory));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -78,6 +78,7 @@ public class TestRegionServerExit extends HBaseClusterTestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test abort of region server.
|
* Test abort of region server.
|
||||||
|
* Test is flakey up on hudson. Needs work.
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public void disabledTestCleanExit() throws IOException {
|
public void disabledTestCleanExit() throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue