use of org.apache.hadoop.hbase.thrift2.generated.TMutation in project hbase by apache.
the class ThriftUtilities method rowMutationsFromThrift.
/**
* Creates a {@link RowMutations} (HBase) from a {@link TRowMutations} (Thrift)
*
* @param in the <code>TRowMutations</code> to convert
*
* @return converted <code>RowMutations</code>
*/
public static RowMutations rowMutationsFromThrift(TRowMutations in) throws IOException {
List<TMutation> mutations = in.getMutations();
RowMutations out = new RowMutations(in.getRow(), mutations.size());
for (TMutation mutation : mutations) {
if (mutation.isSetPut()) {
out.add(putFromThrift(mutation.getPut()));
}
if (mutation.isSetDeleteSingle()) {
out.add(deleteFromThrift(mutation.getDeleteSingle()));
}
}
return out;
}
Aggregations