use of org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor in project hbase by apache.
the class ThriftUtilities method tableDescriptorFromHBase.
public static TTableDescriptor tableDescriptorFromHBase(TableDescriptor in) {
TTableDescriptor out = new TTableDescriptor();
out.setTableName(tableNameFromHBase(in.getTableName()));
Map<Bytes, Bytes> attributes = in.getValues();
for (Map.Entry<Bytes, Bytes> attribute : attributes.entrySet()) {
out.putToAttributes(ByteBuffer.wrap(attribute.getKey().get()), ByteBuffer.wrap(attribute.getValue().get()));
}
for (ColumnFamilyDescriptor column : in.getColumnFamilies()) {
out.addToColumns(columnFamilyDescriptorFromHBase(column));
}
out.setDurability(durabilityFromHBase(in.getDurability()));
return out;
}
Aggregations