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


Java Tag.getBuffer方法代码示例

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


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

示例1: extractVisibilityTags

import org.apache.hadoop.hbase.Tag; //导入方法依赖的package包/类
/**
 * Extract the visibility tags of the given Cell into the given List
 * @param cell - the cell
 * @param tags - the array that will be populated if visibility tags are present
 * @return The visibility tags serialization format
 */
public static Byte extractVisibilityTags(Cell cell, List<Tag> tags) {
  Byte serializationFormat = null;
  if (cell.getTagsLength() > 0) {
    Iterator<Tag> tagsIterator = CellUtil.tagsIterator(cell.getTagsArray(), cell.getTagsOffset(),
        cell.getTagsLength());
    while (tagsIterator.hasNext()) {
      Tag tag = tagsIterator.next();
      if (tag.getType() == TagType.VISIBILITY_EXP_SERIALIZATION_FORMAT_TAG_TYPE) {
        serializationFormat = tag.getBuffer()[tag.getTagOffset()];
      } else if (tag.getType() == VISIBILITY_TAG_TYPE) {
        tags.add(tag);
      }
    }
  }
  return serializationFormat;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:23,代码来源:VisibilityUtils.java

示例2: extractAndPartitionTags

import org.apache.hadoop.hbase.Tag; //导入方法依赖的package包/类
/**
 * Extracts and partitions the visibility tags and nonVisibility Tags
 *
 * @param cell - the cell for which we would extract and partition the
 * visibility and non visibility tags
 * @param visTags
 *          - all the visibilty tags of type TagType.VISIBILITY_TAG_TYPE would
 *          be added to this list
 * @param nonVisTags - all the non visibility tags would be added to this list
 * @return - the serailization format of the tag. Can be null if no tags are found or
 * if there is no visibility tag found
 */
public static Byte extractAndPartitionTags(Cell cell, List<Tag> visTags,
    List<Tag> nonVisTags) {
  Byte serializationFormat = null;
  if (cell.getTagsLength() > 0) {
    Iterator<Tag> tagsIterator = CellUtil.tagsIterator(cell.getTagsArray(), cell.getTagsOffset(),
        cell.getTagsLength());
    while (tagsIterator.hasNext()) {
      Tag tag = tagsIterator.next();
      if (tag.getType() == TagType.VISIBILITY_EXP_SERIALIZATION_FORMAT_TAG_TYPE) {
        serializationFormat = tag.getBuffer()[tag.getTagOffset()];
      } else if (tag.getType() == VISIBILITY_TAG_TYPE) {
        visTags.add(tag);
      } else {
        // ignore string encoded visibility expressions, will be added in replication handling
        nonVisTags.add(tag);
      }
    }
  }
  return serializationFormat;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:33,代码来源:VisibilityUtils.java


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