I run jruby as follows :
# Name of this script
NAME = "merge_table"
# Print usage for this script
def usage
puts 'Usage: %s.rb TABLE_NAME' % NAME
exit!
end
# Get configuration to use.
c = HBaseConfiguration.new()
# Set hadoop filesystem configuration using the hbase.rootdir.
# Otherwise, we'll always use localhost though the hbase.rootdir
# might be pointing at hdfs location.
c.set("fs.default.name", c.get(HConstants::HBASE_DIR))
fs = FileSystem.get(c)
# Get a logger and a metautils instance.
LOG = LogFactory.getLog(NAME)
# Check arguments
if ARGV.size < 1 || ARGV.size > 2
usage
end
tableName = java.lang.String.new(ARGV[0])
LOG.info("merge regions of table: " + tableName.toString())
HMerge.merge(c,fs,Bytes.toBytes(tableName))
But it is strange that :
......
11/04/24 14:55:31 DEBUG client.HConnectionManager$TableServers: Cache hit
for row <> in tableName .META.: location server 192.168.0.185:60020,
location region name .META.,,1
11/04/24 14:55:31 INFO hbase.HMerge: Row:
<ContentPageTempletValidate,,1289377363886>
11/04/24 14:55:31 INFO hbase.HMerge: Row: <EnterNodeRNDV,,1301653657945>
11/04/24 14:55:31 INFO hbase.HMerge: only one region - nothing to merge
11/04/24 14:55:31 DEBUG regionserver.HLog: closing hlog writer in hdfs://
test.namenode.uc.uuwatch.com:9000/hbase/cjjPutTest1/merge_1303628131187.logs
11/04/24 14:55:31 INFO zookeeper.ZooKeeper: Session: 0x32f5daa5e9700b3
closed
11/04/24 14:55:31 INFO zookeeper.ClientCnxn: EventThread shut down
11/04/24 14:55:31 DEBUG zookeeper.ZooKeeperWrapper: Closed connection with
ZooKeeper
the table cjjPutTest1 has 166 regions ,Why it said only one region ?
--
Thanks & Best regards
jiajun