本文整理汇总了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);
}