本文整理匯總了Java中org.apache.hadoop.hbase.HTableDescriptor.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java HTableDescriptor.getValue方法的具體用法?Java HTableDescriptor.getValue怎麽用?Java HTableDescriptor.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.hbase.HTableDescriptor
的用法示例。
在下文中一共展示了HTableDescriptor.getValue方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: listTables
import org.apache.hadoop.hbase.HTableDescriptor; //導入方法依賴的package包/類
/**
* list all tables, including tables with or without indexes.
*
* @return an array of {@link HTableDescriptor}
* @throws IOException
*/
public HTableDescriptor[] listTables() throws IOException {
ArrayList<HTableDescriptor> descList = new ArrayList<HTableDescriptor>();
HTableDescriptor[] tableDescriptor = admin.listTables();
if (tableDescriptor != null && tableDescriptor.length != 0) {
for (HTableDescriptor desc : tableDescriptor) {
byte[] indexType = desc.getValue(IndexConstants.INDEX_TYPE);
// table without any index or main data table
if (indexType == null) {
descList.add(desc);
}
}
}
return descList.toArray(new HTableDescriptor[0]);
}
示例2: getNextPriority
import org.apache.hadoop.hbase.HTableDescriptor; //導入方法依賴的package包/類
private static long getNextPriority(HTableDescriptor desc) {
String value = desc.getValue(COUNTER_KEY);
long priority;
// get the current priority
if (value == null) {
priority = MIN_PRIORITY;
} else {
priority = Long.parseLong(value) + 1;
}
return priority;
}
示例3: getIndexTableRelation
import org.apache.hadoop.hbase.HTableDescriptor; //導入方法依賴的package包/類
public static IndexTableRelation getIndexTableRelation(HTableDescriptor desc) throws IOException {
byte[] bytes;
if (desc != null && (bytes = desc.getValue(INDEX_ATTRIBUTE_NAME_BYTES)) != null) {
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
DataInputStream dis = new DataInputStream(inputStream);
IndexTableRelation rl = new IndexTableRelation(desc.getTableName(), IndexType.NoIndex);
rl.readFields(dis);
return rl;
}
LOG.info("index table relation = null, because " + (desc == null ?
"desc is null" :
("attribute is null for table " + desc.getTableName())));
return null;
}
示例4: isIndexTable
import org.apache.hadoop.hbase.HTableDescriptor; //導入方法依賴的package包/類
/**
* Check if it is an index table.
*
* @param desc
* @throws IllegalArgumentException-desc is null
*/
private boolean isIndexTable(HTableDescriptor desc) throws IOException {
if (desc == null) {
throw new IllegalArgumentException("Table Descriptor is empty");
}
byte[] value = desc.getValue(IndexConstants.INDEX_TYPE);
return (value != null) ? true : false;
}
示例5: getKeyValueForClass
import org.apache.hadoop.hbase.HTableDescriptor; //導入方法依賴的package包/類
/**
* Get the kv {@link Entry} in the descriptor for the specified class
*
* @param desc
* {@link HTableDescriptor} to read
* @param clazz
* to search for
* @return the {@link Pair} of <key, value> in the table, if that class is
* present. <tt>null</tt> otherwise.
*/
private static Pair<String, String> getKeyValueForClass(
HTableDescriptor desc, Class<? extends Constraint> clazz) {
// get the serialized version of the constraint
String key = serializeConstraintClass(clazz);
String value = desc.getValue(key);
return value == null ? null : new Pair<String, String>(key, value);
}