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