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


Java Tag.getTag方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.Tag.getTag方法的典型用法代码示例。如果您正苦于以下问题:Java Tag.getTag方法的具体用法?Java Tag.getTag怎么用?Java Tag.getTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.Tag的用法示例。


在下文中一共展示了Tag.getTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verifyTags

import org.apache.hadoop.hbase.Tag; //导入方法依赖的package包/类
/**
 * This verifies that each cell has a tag that is equal to its rowkey name.  For this to work
 * the hbase instance must have HConstants.RPC_CODEC_CONF_KEY set to
 * KeyValueCodecWithTags.class.getCanonicalName());
 * @param table table containing tagged cells
 * @throws IOException if problems reading table
 */
public static void verifyTags(Table table) throws IOException {
  ResultScanner s = table.getScanner(new Scan());
  for (Result r : s) {
    for (Cell c : r.listCells()) {
      byte[] ta = c.getTagsArray();
      int toff = c.getTagsOffset();
      int tlen = c.getTagsLength();
      Tag t = Tag.getTag(ta, toff, tlen, TagType.ACL_TAG_TYPE);
      if (t == null) {
        fail(c.toString() + " has null tag");
        continue;
      }
      byte[] tval = t.getValue();
      assertArrayEquals(c.toString() + " has tag" + Bytes.toString(tval),
          r.getRow(), tval);
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:26,代码来源:HFileTestUtil.java

示例2: tagReplayLogSequenceNumber

import org.apache.hadoop.hbase.Tag; //导入方法依赖的package包/类
/**
* Tag original sequence number for each edit to be replayed
* @param entry
* @param cell
* @return
*/
private static Cell tagReplayLogSequenceNumber(WALEntry entry, Cell cell) {
  // Tag puts with original sequence number if there is no LOG_REPLAY_TAG yet
  boolean needAddRecoveryTag = true;
  if (cell.getTagsLength() > 0) {
    Tag tmpTag = Tag.getTag(cell.getTagsArray(), cell.getTagsOffset(), cell.getTagsLength(),
      TagType.LOG_REPLAY_TAG_TYPE);
    if (tmpTag != null) {
      // found an existing log replay tag so reuse it
      needAddRecoveryTag = false;
    }
  }
  if (needAddRecoveryTag) {
    List<Tag> newTags = new ArrayList<Tag>();
    Tag replayTag = new Tag(TagType.LOG_REPLAY_TAG_TYPE, Bytes.toBytes(entry.getKey()
        .getLogSequenceNumber()));
    newTags.add(replayTag);
    return KeyValue.cloneAndAddTags(cell, newTags);
  }
  return cell;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:27,代码来源:HLogSplitter.java


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