HBASE-791 RowCount doesn't work

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@681590 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-08-01 02:39:22 +00:00
parent 344b6b774b
commit 5710476a73
2 changed files with 6 additions and 3 deletions

View File

@ -220,6 +220,7 @@ Release 0.2.0
HBASE-424 Should be able to enable/disable .META. table
HBASE-771 Names legal in 0.1 are not in 0.2; breaks migration
HBASE-788 Div by zero in Master.jsp (Clint Morgan via Jim Kellerman)
HBASE-791 RowCount doesn't work (Jean-Daniel Cryans via Stack)
IMPROVEMENTS
HBASE-559 MR example job to count table rows

View File

@ -25,9 +25,11 @@ import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.io.HbaseMapWritable;
import org.apache.hadoop.hbase.io.Cell;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.io.RowResult;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.OutputCollector;
@ -47,7 +49,8 @@ public class RowCounter extends TableMap<ImmutableBytesWritable, RowResult> impl
static final String NAME = "rowcounter";
private Configuration conf;
private final RowResult EMPTY_RESULT_VALUE = new RowResult();
private final RowResult EMPTY_RESULT_VALUE =
new RowResult(Bytes.toBytes("dummy"),new HbaseMapWritable<byte [], Cell>());
private static enum Counters {ROWS}
@Override
@ -119,8 +122,7 @@ public class RowCounter extends TableMap<ImmutableBytesWritable, RowResult> impl
public static void main(String[] args) throws Exception {
HBaseConfiguration c = new HBaseConfiguration();
c.set("hbase.master", args[0]);
int errCode = ToolRunner.run(c, new RowCounter(), args);
System.exit(errCode);
}
}
}