简体   繁体   中英

Which jar file contains RowCounter class for Hbase

I am at my wits end. I can't find which jar file contains these two classes:

import org.apache.hadoop.hbase.mapreduce.RowCounter.RowCounterMapper;
import org.junit.experimental.categories.Category; 

I've tried:

  • looking it up on findjar.com
  • used my GoogleFu
  • praying to computer gods
  • manually tried several of the jars from cloudera via maven (for RowCounter).

Eclipse still says those import lines are not resolved.

How do I find the jar file that contains these classes or any class for that matter that I need for my program to compile?

Thanks in advance. I'm ready to ram my head into the wall.

RowCounterMapper is in HBase Server. Maven dependency:

<!-- https://mvnrepository.com/artifact/org.apache.hbase/hbase --> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase</artifactId> <version>1.2.1</version> <type>pom</type> </dependency>

Category is in Junit 4. Maven dependency: <!-- https://mvnrepository.com/artifact/junit/junit --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency>

I have also added links to GrepCode.

org.apache.hadoop.hbase.mapreduce.RowCounter.RowCounterMapper- hbase jar

org.junit.experimental.categories.Category junit jar

Base on the comments, @Classified wants a example to run RowCounter .
Here is a unittest I wrote which I think could be an exmaple.

Job job = RowCounter.createSubmittableJob(HBaseConfiguration.create(), new String[]{"table"});
job.waitForCompletion(true);
Counters counters = job.getCounters();
GenericCounter genericCounter = (GenericCounter) counters.findCounter(
                    "org.apache.hadoop.hbase.mapreduce.RowCounter$RowCounterMapper$Counters",
                    "ROWS");
genericCounter.getValue();

genericCounter.getValue() is the row count of "table" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM