Search in sources :

Example 1 with RegionSpecifier

use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.

the class ProtobufUtil method buildGetStoreFileRequest.

/**
    * Create a protocol buffer GetStoreFileRequest for a given region name
    *
    * @param regionName the name of the region to get info
    * @param family the family to get store file list
    * @return a protocol buffer GetStoreFileRequest
    */
public static GetStoreFileRequest buildGetStoreFileRequest(final byte[] regionName, final byte[] family) {
    GetStoreFileRequest.Builder builder = GetStoreFileRequest.newBuilder();
    RegionSpecifier region = RequestConverter.buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
    builder.setRegion(region);
    builder.addFamily(UnsafeByteOperations.unsafeWrap(family));
    return builder.build();
}
Also used : GetStoreFileRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetStoreFileRequest) RegionSpecifier(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier)

Example 2 with RegionSpecifier

use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.

the class ProtobufUtil method buildCloseRegionForSplitOrMergeRequest.

/**
   * Create a CloseRegionForSplitOrMergeRequest for given regions
   *
   * @param server the RS server that hosts the region
   * @param regionsToClose the info of the regions to close
   * @return a CloseRegionForSplitRequest
   */
public static CloseRegionForSplitOrMergeRequest buildCloseRegionForSplitOrMergeRequest(final ServerName server, final HRegionInfo... regionsToClose) {
    CloseRegionForSplitOrMergeRequest.Builder builder = CloseRegionForSplitOrMergeRequest.newBuilder();
    for (int i = 0; i < regionsToClose.length; i++) {
        RegionSpecifier regionToClose = RequestConverter.buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionsToClose[i].getRegionName());
        builder.addRegion(regionToClose);
    }
    return builder.build();
}
Also used : CloseRegionForSplitOrMergeRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionForSplitOrMergeRequest) RegionSpecifier(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier)

Example 3 with RegionSpecifier

use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.

the class ProtobufUtil method buildCloseRegionRequest.

/**
    * Create a CloseRegionRequest for a given encoded region name
    *
    * @param encodedRegionName the name of the region to close
    * @return a CloseRegionRequest
    */
public static CloseRegionRequest buildCloseRegionRequest(ServerName server, final String encodedRegionName) {
    CloseRegionRequest.Builder builder = CloseRegionRequest.newBuilder();
    RegionSpecifier region = RequestConverter.buildRegionSpecifier(RegionSpecifierType.ENCODED_REGION_NAME, Bytes.toBytes(encodedRegionName));
    builder.setRegion(region);
    if (server != null) {
        builder.setServerStartCode(server.getStartcode());
    }
    return builder.build();
}
Also used : CloseRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionRequest) RegionSpecifier(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier)

Example 4 with RegionSpecifier

use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.

the class RequestConverter method buildGetRegionInfoRequest.

/**
   * Create a protocol buffer GetRegionInfoRequest for a given region name
   *
   * @param regionName the name of the region to get info
   * @param includeCompactionState indicate if the compaction state is requested
   * @return a protocol buffer GetRegionInfoRequest
   */
public static GetRegionInfoRequest buildGetRegionInfoRequest(final byte[] regionName, final boolean includeCompactionState) {
    GetRegionInfoRequest.Builder builder = GetRegionInfoRequest.newBuilder();
    RegionSpecifier region = buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
    builder.setRegion(region);
    if (includeCompactionState) {
        builder.setCompactionState(includeCompactionState);
    }
    return builder.build();
}
Also used : GetRegionInfoRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoRequest) RegionSpecifier(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier)

Example 5 with RegionSpecifier

use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.

the class RequestConverter method getRegionActionBuilderWithRegion.

private static RegionAction.Builder getRegionActionBuilderWithRegion(final RegionAction.Builder regionActionBuilder, final byte[] regionName) {
    RegionSpecifier region = buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
    regionActionBuilder.setRegion(region);
    return regionActionBuilder;
}
Also used : RegionSpecifier(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier)

Aggregations

RegionSpecifier (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier)27 MutateRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutateRequest)7 IOException (java.io.IOException)4 Condition (org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Condition)3 InterruptedIOException (java.io.InterruptedIOException)2 ArrayList (java.util.ArrayList)2 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)2 HBaseIOException (org.apache.hadoop.hbase.HBaseIOException)2 ServiceException (org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException)2 CloseRegionRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionRequest)2 ClientProtos (org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos)2 GetRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.GetRequest)2 ScanRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest)2 RegionLoad (org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad)2 Test (org.junit.Test)2 RatioGauge (com.codahale.metrics.RatioGauge)1 MemoryUsage (java.lang.management.MemoryUsage)1 Method (java.lang.reflect.Method)1 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1