当前位置: 首页>>代码示例>>Java>>正文


Java HTableDescriptor.getValue方法代码示例

本文整理汇总了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]);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:23,代码来源:CCIndexAdmin.java

示例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;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:Constraints.java

示例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;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:IndexTableRelation.java

示例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;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:CCIndexAdmin.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:Constraints.java


注:本文中的org.apache.hadoop.hbase.HTableDescriptor.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。