use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.
the class RequestConverter method buildMutateRequest.
/**
* Create a protocol buffer MutateRequest for a conditioned delete
*
* @param regionName
* @param row
* @param family
* @param qualifier
* @param comparator
* @param compareType
* @param delete
* @return a mutate request
* @throws IOException
*/
public static MutateRequest buildMutateRequest(final byte[] regionName, final byte[] row, final byte[] family, final byte[] qualifier, final ByteArrayComparable comparator, final CompareType compareType, final Delete delete) throws IOException {
MutateRequest.Builder builder = MutateRequest.newBuilder();
RegionSpecifier region = buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
builder.setRegion(region);
Condition condition = buildCondition(row, family, qualifier, comparator, compareType);
builder.setMutation(ProtobufUtil.toMutation(MutationType.DELETE, delete, MutationProto.newBuilder()));
builder.setCondition(condition);
return builder.build();
}
use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.
the class ProtobufUtil method buildSplitRegionRequest.
/**
* Create a SplitRegionRequest for a given region name
*
* @param regionName the name of the region to split
* @param splitPoint the split point
* @return a SplitRegionRequest
*/
public static SplitRegionRequest buildSplitRegionRequest(final byte[] regionName, final byte[] splitPoint) {
SplitRegionRequest.Builder builder = SplitRegionRequest.newBuilder();
RegionSpecifier region = RequestConverter.buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
builder.setRegion(region);
if (splitPoint != null) {
builder.setSplitPoint(UnsafeByteOperations.unsafeWrap(splitPoint));
}
return builder.build();
}
use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.
the class ProtobufUtil method buildCloseRegionRequest.
public static CloseRegionRequest buildCloseRegionRequest(ServerName server, final byte[] regionName, ServerName destinationServer) {
CloseRegionRequest.Builder builder = CloseRegionRequest.newBuilder();
RegionSpecifier region = RequestConverter.buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
builder.setRegion(region);
if (destinationServer != null) {
builder.setDestinationServer(toServerName(destinationServer));
}
if (server != null) {
builder.setServerStartCode(server.getStartcode());
}
return builder.build();
}
use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.
the class RequestConverter method buildMutateRequest.
/**
* Create a protocol buffer MutateRequest for a conditioned put
*
* @param regionName
* @param row
* @param family
* @param qualifier
* @param comparator
* @param compareType
* @param put
* @return a mutate request
* @throws IOException
*/
public static MutateRequest buildMutateRequest(final byte[] regionName, final byte[] row, final byte[] family, final byte[] qualifier, final ByteArrayComparable comparator, final CompareType compareType, final Put put) throws IOException {
MutateRequest.Builder builder = MutateRequest.newBuilder();
RegionSpecifier region = buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
builder.setRegion(region);
Condition condition = buildCondition(row, family, qualifier, comparator, compareType);
builder.setMutation(ProtobufUtil.toMutation(MutationType.PUT, put, MutationProto.newBuilder()));
builder.setCondition(condition);
return builder.build();
}
use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.
the class RequestConverter method buildCompactRegionRequest.
/**
* Create a CompactRegionRequest for a given region name
*
* @param regionName the name of the region to get info
* @param major indicator if it is a major compaction
* @return a CompactRegionRequest
*/
public static CompactRegionRequest buildCompactRegionRequest(final byte[] regionName, final boolean major, final byte[] family) {
CompactRegionRequest.Builder builder = CompactRegionRequest.newBuilder();
RegionSpecifier region = buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
builder.setRegion(region);
builder.setMajor(major);
if (family != null) {
builder.setFamily(UnsafeByteOperations.unsafeWrap(family));
}
return builder.build();
}
Aggregations