Search in sources :

Example 1 with TableDescriptor

use of io.cdap.cdap.spi.hbase.TableDescriptor in project cdap by caskdata.

the class HBase10CDHTableDescriptorUtil method getTableDescriptor.

public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor) {
    Set<ColumnFamilyDescriptor> families = new HashSet<>();
    for (HColumnDescriptor family : descriptor.getColumnFamilies()) {
        families.add(getColumnFamilyDescriptor(family));
    }
    Set<CoprocessorDescriptor> coprocessors = new HashSet<>();
    coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
    Map<String, String> properties = CoprocessorUtil.getNonCoprocessorProperties(descriptor);
    // TODO: should add configurations as well
    return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(), descriptor.getTableName().getQualifierAsString(), families, coprocessors, properties);
}
Also used : HColumnDescriptor(org.apache.hadoop.hbase.HColumnDescriptor) ColumnFamilyDescriptor(io.cdap.cdap.spi.hbase.ColumnFamilyDescriptor) CoprocessorDescriptor(io.cdap.cdap.spi.hbase.CoprocessorDescriptor) TableDescriptor(io.cdap.cdap.spi.hbase.TableDescriptor) HTableDescriptor(org.apache.hadoop.hbase.HTableDescriptor) HashSet(java.util.HashSet)

Example 2 with TableDescriptor

use of io.cdap.cdap.spi.hbase.TableDescriptor in project cdap by caskdata.

the class HBase12CDH570TableDescriptorUtil method getTableDescriptor.

public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor) {
    Set<ColumnFamilyDescriptor> families = new HashSet<>();
    for (HColumnDescriptor family : descriptor.getColumnFamilies()) {
        families.add(getColumnFamilyDescriptor(family));
    }
    Set<CoprocessorDescriptor> coprocessors = new HashSet<>();
    coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
    Map<String, String> properties = CoprocessorUtil.getNonCoprocessorProperties(descriptor);
    // TODO: should add configurations as well
    return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(), descriptor.getTableName().getQualifierAsString(), families, coprocessors, properties);
}
Also used : HColumnDescriptor(org.apache.hadoop.hbase.HColumnDescriptor) ColumnFamilyDescriptor(io.cdap.cdap.spi.hbase.ColumnFamilyDescriptor) CoprocessorDescriptor(io.cdap.cdap.spi.hbase.CoprocessorDescriptor) TableDescriptor(io.cdap.cdap.spi.hbase.TableDescriptor) HTableDescriptor(org.apache.hadoop.hbase.HTableDescriptor) HashSet(java.util.HashSet)

Example 3 with TableDescriptor

use of io.cdap.cdap.spi.hbase.TableDescriptor in project cdap by caskdata.

the class HBase10CDH550TableDescriptorUtil method getTableDescriptor.

public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor) {
    Set<ColumnFamilyDescriptor> families = new HashSet<>();
    for (HColumnDescriptor family : descriptor.getColumnFamilies()) {
        families.add(getColumnFamilyDescriptor(family));
    }
    Set<CoprocessorDescriptor> coprocessors = new HashSet<>();
    coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
    Map<String, String> properties = CoprocessorUtil.getNonCoprocessorProperties(descriptor);
    // TODO: should add configurations as well
    return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(), descriptor.getTableName().getQualifierAsString(), families, coprocessors, properties);
}
Also used : HColumnDescriptor(org.apache.hadoop.hbase.HColumnDescriptor) ColumnFamilyDescriptor(io.cdap.cdap.spi.hbase.ColumnFamilyDescriptor) CoprocessorDescriptor(io.cdap.cdap.spi.hbase.CoprocessorDescriptor) TableDescriptor(io.cdap.cdap.spi.hbase.TableDescriptor) HTableDescriptor(org.apache.hadoop.hbase.HTableDescriptor) HashSet(java.util.HashSet)

Example 4 with TableDescriptor

use of io.cdap.cdap.spi.hbase.TableDescriptor in project cdap by caskdata.

the class HBase10CDH550TableUtil method modifyTable.

@Override
public void modifyTable(HBaseDDLExecutor ddlExecutor, HTableDescriptor tableDescriptor) throws IOException {
    Preconditions.checkArgument(ddlExecutor != null, "HBaseDDLExecutor should not be null");
    Preconditions.checkArgument(tableDescriptor != null, "Table descriptor should not be null.");
    TableName tableName = tableDescriptor.getTableName();
    TableDescriptor tbd = HBase10CDH550TableDescriptorUtil.getTableDescriptor(tableDescriptor);
    ddlExecutor.modifyTable(tableName.getNamespaceAsString(), tableName.getQualifierAsString(), tbd);
}
Also used : TableName(org.apache.hadoop.hbase.TableName) HTableDescriptor(org.apache.hadoop.hbase.HTableDescriptor) TableDescriptor(io.cdap.cdap.spi.hbase.TableDescriptor)

Example 5 with TableDescriptor

use of io.cdap.cdap.spi.hbase.TableDescriptor in project cdap by caskdata.

the class HBase10TableUtil method modifyTable.

@Override
public void modifyTable(HBaseDDLExecutor ddlExecutor, HTableDescriptor tableDescriptor) throws IOException {
    Preconditions.checkArgument(ddlExecutor != null, "HBaseDDLExecutor should not be null");
    Preconditions.checkArgument(tableDescriptor != null, "Table descriptor should not be null.");
    TableName tableName = tableDescriptor.getTableName();
    TableDescriptor tbd = HBase10TableDescriptorUtil.getTableDescriptor(tableDescriptor);
    ddlExecutor.modifyTable(tableName.getNamespaceAsString(), tableName.getQualifierAsString(), tbd);
}
Also used : TableName(org.apache.hadoop.hbase.TableName) HTableDescriptor(org.apache.hadoop.hbase.HTableDescriptor) TableDescriptor(io.cdap.cdap.spi.hbase.TableDescriptor)

Aggregations

TableDescriptor (io.cdap.cdap.spi.hbase.TableDescriptor)11 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)11 ColumnFamilyDescriptor (io.cdap.cdap.spi.hbase.ColumnFamilyDescriptor)5 CoprocessorDescriptor (io.cdap.cdap.spi.hbase.CoprocessorDescriptor)5 HashSet (java.util.HashSet)5 HColumnDescriptor (org.apache.hadoop.hbase.HColumnDescriptor)5 TableName (org.apache.hadoop.hbase.TableName)5