@Override
    protected HRegionInfo[] next() throws IOException {
      List<HRegionInfo> regions = new ArrayList<HRegionInfo>();
      if(latestRegion == null) {
        latestRegion = nextRegion();
      }
      if(latestRegion != null) {
        regions.add(latestRegion);
      }
      latestRegion = nextRegion();
      if(latestRegion != null) {
        regions.add(latestRegion);
      }
      return regions.toArray(new HRegionInfo[regions.size()]);
    }

the method nextRegion may get Null ,So there is a bug in HBase0.20.6.



On Sun, Apr 24, 2011 at 2:56 PM, 陈加俊 <[email protected]> wrote:

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


-- 
Thanks & Best regards
jiajun

Reply via email to