HBASE-2984 [shell] Altering a family shouldn't reset to default unchanged

attributes
HBASE-3143  Adding the tests' hbase-site.xml to the jar breaks some clients


git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1026526 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2010-10-22 23:28:07 +00:00
parent a0d2e6dcb9
commit 01aa76e5b0
3 changed files with 21 additions and 20 deletions

View File

@ -606,6 +606,9 @@ Release 0.21.0 - Unreleased
HBASE-2998 rolling-restart.sh shouldn't rely on zoo.cfg HBASE-2998 rolling-restart.sh shouldn't rely on zoo.cfg
HBASE-3145 importtsv fails when the line contains no data HBASE-3145 importtsv fails when the line contains no data
(Kazuki Ohta via Todd Lipcon) (Kazuki Ohta via Todd Lipcon)
HBASE-2984 [shell] Altering a family shouldn't reset to default unchanged
attributes
HBASE-3143 Adding the tests' hbase-site.xml to the jar breaks some clients
IMPROVEMENTS IMPROVEMENTS

View File

@ -291,6 +291,7 @@
<exclude>org/apache/jute/**</exclude> <exclude>org/apache/jute/**</exclude>
<exclude>org/apache/zookeeper/**</exclude> <exclude>org/apache/zookeeper/**</exclude>
<exclude>**/*.jsp</exclude> <exclude>**/*.jsp</exclude>
<exclude>**/hbase-site.xml</exclude>
</excludes> </excludes>
</configuration> </configuration>
</plugin> </plugin>

View File

@ -132,7 +132,7 @@ module Hbase
end end
# Add column to the table # Add column to the table
descriptor = hcd(arg) descriptor = hcd(arg, htd)
if arg[COMPRESSION_COMPACT] if arg[COMPRESSION_COMPACT]
descriptor.setValue(COMPRESSION_COMPACT, arg[COMPRESSION_COMPACT]) descriptor.setValue(COMPRESSION_COMPACT, arg[COMPRESSION_COMPACT])
end end
@ -219,7 +219,7 @@ module Hbase
# No method parameter, try to use the args as a column definition # No method parameter, try to use the args as a column definition
unless method = arg.delete(METHOD) unless method = arg.delete(METHOD)
descriptor = hcd(arg) descriptor = hcd(arg, htd)
if arg[COMPRESSION_COMPACT] if arg[COMPRESSION_COMPACT]
descriptor.setValue(COMPRESSION_COMPACT, arg[COMPRESSION_COMPACT]) descriptor.setValue(COMPRESSION_COMPACT, arg[COMPRESSION_COMPACT])
end end
@ -320,29 +320,26 @@ module Hbase
#---------------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------------
# Return a new HColumnDescriptor made of passed args # Return a new HColumnDescriptor made of passed args
def hcd(arg) def hcd(arg, htd)
# String arg, single parameter constructor # String arg, single parameter constructor
return HColumnDescriptor.new(arg) if arg.kind_of?(String) return HColumnDescriptor.new(arg) if arg.kind_of?(String)
# TODO: This is brittle code.
# Here is current HCD constructor:
# public HColumnDescriptor(final byte [] familyName, final int maxVersions,
# final String compression, final boolean inMemory,
# final boolean blockCacheEnabled, final int blocksize,
# final int timeToLive, final boolean bloomFilter, final int scope) {
raise(ArgumentError, "Column family #{arg} must have a name") unless name = arg[NAME] raise(ArgumentError, "Column family #{arg} must have a name") unless name = arg[NAME]
# TODO: What encoding are Strings in jruby? family = htd.getFamily(name.to_java_bytes)
return HColumnDescriptor.new(name.to_java_bytes, # create it if it's a new family
# JRuby uses longs for ints. Need to convert. Also constants are String family ||= HColumnDescriptor.new(name.to_java_bytes)
arg.include?(VERSIONS)? JInteger.new(arg[VERSIONS]): HColumnDescriptor::DEFAULT_VERSIONS,
arg.include?(HColumnDescriptor::COMPRESSION)? arg[HColumnDescriptor::COMPRESSION]: HColumnDescriptor::DEFAULT_COMPRESSION, family.setBlockCacheEnabled(JBoolean.valueOf(arg[HColumnDescriptor::BLOCKCACHE])) if arg.include?(HColumnDescriptor::BLOCKCACHE)
arg.include?(IN_MEMORY)? JBoolean.valueOf(arg[IN_MEMORY]): HColumnDescriptor::DEFAULT_IN_MEMORY, family.setBloomFilterType(arg[HColumnDescriptor::BLOOMFILTER]) if arg.include?(HColumnDescriptor::BLOOMFILTER)
arg.include?(HColumnDescriptor::BLOCKCACHE)? JBoolean.valueOf(arg[HColumnDescriptor::BLOCKCACHE]): HColumnDescriptor::DEFAULT_BLOCKCACHE, family.setScope(JInteger.valueOf(arg[REPLICATION_SCOPE])) if arg.include?(HColumnDescriptor::REPLICATION_SCOPE)
arg.include?(HColumnDescriptor::BLOCKSIZE)? JInteger.valueOf(arg[HColumnDescriptor::BLOCKSIZE]): HColumnDescriptor::DEFAULT_BLOCKSIZE, family.setInMemory(JBoolean.valueOf(arg[IN_MEMORY])) if arg.include?(HColumnDescriptor::IN_MEMORY)
arg.include?(HColumnDescriptor::TTL)? JInteger.new(arg[HColumnDescriptor::TTL]): HColumnDescriptor::DEFAULT_TTL, family.setTimeToLive(JInteger.valueOf(arg[HColumnDescriptor::TTL])) if arg.include?(HColumnDescriptor::TTL)
arg.include?(HColumnDescriptor::BLOOMFILTER)? arg[HColumnDescriptor::BLOOMFILTER]: HColumnDescriptor::DEFAULT_BLOOMFILTER, family.setCompressionType(arg[HColumnDescriptor::COMPRESSION]) if arg.include?(HColumnDescriptor::COMPRESSION)
arg.include?(HColumnDescriptor::REPLICATION_SCOPE)? JInteger.new(arg[REPLICATION_SCOPE]): HColumnDescriptor::DEFAULT_REPLICATION_SCOPE) family.setBlocksize(JInteger.valueOf(arg[HColumnDescriptor::BLOCKSIZE])) if arg.include?(HColumnDescriptor::BLOCKSIZE)
family.setMaxVersions(JInteger.valueOf(arg[VERSIONS])) if arg.include?(HColumnDescriptor::VERSIONS)
return family
end end
#---------------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------------