Search in sources :

Example 6 with IncrementHandlerState

use of co.cask.cdap.data2.increment.hbase.IncrementHandlerState in project cdap by caskdata.

the class IncrementHandler method start.

@Override
public void start(CoprocessorEnvironment e) throws IOException {
    if (e instanceof RegionCoprocessorEnvironment) {
        RegionCoprocessorEnvironment env = (RegionCoprocessorEnvironment) e;
        this.region = ((RegionCoprocessorEnvironment) e).getRegion();
        this.state = new IncrementHandlerState(env.getConfiguration(), env.getRegion().getTableDesc());
        HTableDescriptor tableDesc = env.getRegion().getTableDesc();
        for (HColumnDescriptor columnDesc : tableDesc.getFamilies()) {
            state.initFamily(columnDesc.getName(), convertFamilyValues(columnDesc.getValues()));
        }
    }
}
Also used : RegionCoprocessorEnvironment(org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment) HColumnDescriptor(org.apache.hadoop.hbase.HColumnDescriptor) IncrementHandlerState(co.cask.cdap.data2.increment.hbase.IncrementHandlerState) HTableDescriptor(org.apache.hadoop.hbase.HTableDescriptor)

Example 7 with IncrementHandlerState

use of co.cask.cdap.data2.increment.hbase.IncrementHandlerState in project cdap by caskdata.

the class IncrementHandler method start.

@Override
public void start(CoprocessorEnvironment e) throws IOException {
    if (e instanceof RegionCoprocessorEnvironment) {
        RegionCoprocessorEnvironment env = (RegionCoprocessorEnvironment) e;
        this.region = ((RegionCoprocessorEnvironment) e).getRegion();
        this.state = new IncrementHandlerState(env.getConfiguration(), env.getRegion().getTableDesc());
        HTableDescriptor tableDesc = env.getRegion().getTableDesc();
        for (HColumnDescriptor columnDesc : tableDesc.getFamilies()) {
            state.initFamily(columnDesc.getName(), convertFamilyValues(columnDesc.getValues()));
        }
    }
}
Also used : RegionCoprocessorEnvironment(org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment) HColumnDescriptor(org.apache.hadoop.hbase.HColumnDescriptor) IncrementHandlerState(co.cask.cdap.data2.increment.hbase.IncrementHandlerState) HTableDescriptor(org.apache.hadoop.hbase.HTableDescriptor)

Aggregations

IncrementHandlerState (co.cask.cdap.data2.increment.hbase.IncrementHandlerState)7 HColumnDescriptor (org.apache.hadoop.hbase.HColumnDescriptor)7 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)7 RegionCoprocessorEnvironment (org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment)7