hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AnandaVelMurugan Chandra Mohan <ananthu2...@gmail.com>
Subject No matching handler for protocol com.xyz.CounterCoprocessorProtocol in region
Date Fri, 29 Jun 2012 15:39:08 GMT
Hi,

I created a endpoint coprocessor to count rows containing specific value. I
exported it as jar and placed it in HDFS

My code is as follows

import java.io.IOException;

import org.apache.hadoop.hbase.ipc.CoprocessorProtocol;

public interface CounterCoprocessorProtocol extends CoprocessorProtocol {

    public int getCount(String asset)throws IOException;
}



public class CounterEndpoint extends BaseEndpointCoprocessor implements
        CounterCoprocessorProtocol {

    @Override
    public int getCount(String asset) throws IOException {
        // TODO Auto-generated method stub
        Scan scan = new Scan();
        scan.addColumn(Bytes.toBytes("asset"),
                Bytes.toBytes("model"));
        FilterList list = new FilterList();
        SingleColumnValueFilter filter = new
SingleColumnValueFilter(Bytes.toBytes("asset"),
                Bytes.toBytes("model"),
                CompareOp.EQUAL,
                asset.getBytes()
                );
        list.addFilter(filter);
        scan.setFilter(list);
        int sumResult=0;
        RegionCoprocessorEnvironment environment =
            (RegionCoprocessorEnvironment) getEnvironment();
        InternalScanner scanner = environment.getRegion().getScanner(scan);
        try {
          List<KeyValue> curVals = new ArrayList<KeyValue>();
          sumResult = curVals.size();
        } finally {
          scanner.close();
        }
        return sumResult;
    }

}

I loaded my coprocessor jar as follows in Hbase shell

 alter
'Test_report',METHOD=>'table_att','coprocessor'=>'hdfs://<namenode>:<port>/user/hadoop/temp/counter.jar|com.xyx.ConterEndpoint|1001|arg1=XYZ'

When I try to run it from client, I am getting a error "No matching handler
for protocol com.xyz.CounterCoprocessorProtocol in region"

Any idea, why i am getting this error? Any help would be greatly appreciated


-- 
Regards,
Anand

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message