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


Java TDeleteType类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.thrift2.generated.TDeleteType的典型用法代码示例。如果您正苦于以下问题:Java TDeleteType类的具体用法?Java TDeleteType怎么用?Java TDeleteType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TDeleteType类属于org.apache.hadoop.hbase.thrift2.generated包,在下文中一共展示了TDeleteType类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteFromThrift

import org.apache.hadoop.hbase.thrift2.generated.TDeleteType; //导入依赖的package包/类
/**
 * Creates a {@link Delete} (HBase) from a {@link TDelete} (Thrift).
 *
 * @param in the <code>TDelete</code> to convert
 *
 * @return converted <code>Delete</code>
 */
public static Delete deleteFromThrift(TDelete in) {
  Delete out;

  if (in.isSetColumns()) {
    out = new Delete(in.getRow());
    for (TColumn column : in.getColumns()) {
      if (column.isSetQualifier()) {
        if (column.isSetTimestamp()) {
          if (in.isSetDeleteType() &&
              in.getDeleteType().equals(TDeleteType.DELETE_COLUMNS))
            out.deleteColumns(column.getFamily(), column.getQualifier(), column.getTimestamp());
          else
            out.deleteColumn(column.getFamily(), column.getQualifier(), column.getTimestamp());
        } else {
          if (in.isSetDeleteType() &&
              in.getDeleteType().equals(TDeleteType.DELETE_COLUMNS))
            out.deleteColumns(column.getFamily(), column.getQualifier());
          else
            out.deleteColumn(column.getFamily(), column.getQualifier());
        }

      } else {
        if (column.isSetTimestamp()) {
          out.deleteFamily(column.getFamily(), column.getTimestamp());
        } else {
          out.deleteFamily(column.getFamily());
        }
      }
    }
  } else {
    if (in.isSetTimestamp()) {
      out = new Delete(in.getRow(), in.getTimestamp());
    } else {
      out = new Delete(in.getRow());
    }
  }

  if (in.isSetAttributes()) {
    addAttributes(out,in.getAttributes());
  }

  if (in.isSetDurability()) {
    out.setDurability(durabilityFromThrift(in.getDurability()));
  }

  return out;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:55,代码来源:ThriftUtilities.java


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