@InterfaceAudience.Private public final class ProtobufUtil extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
PB_MAGIC
Magic we put ahead of a serialized protobuf message.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
bulkLoadHFile(ClientProtos.ClientService.BlockingInterface client,
java.util.List<Pair<byte[],java.lang.String>> familyPaths,
byte[] regionName,
boolean assignSeqNum)
A helper to bulk load a list of HFiles using client protocol.
|
static void |
closeRegion(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
ServerName server,
byte[] regionName,
boolean transitionInZK)
A helper to close a region given a region name
using admin protocol.
|
static boolean |
closeRegion(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
ServerName server,
byte[] regionName,
int versionOfClosingNode,
ServerName destinationServer,
boolean transitionInZK)
A helper to close a region given a region name
using admin protocol.
|
static ClientProtos.CoprocessorServiceResponse |
execRegionServerService(RpcController controller,
ClientProtos.ClientService.BlockingInterface client,
ClientProtos.CoprocessorServiceCall call)
Make a region server endpoint call
|
static ClientProtos.CoprocessorServiceResponse |
execService(RpcController controller,
ClientProtos.ClientService.BlockingInterface client,
ClientProtos.CoprocessorServiceCall call,
byte[] regionName) |
static ClientProtos.CoprocessorServiceResponse |
execService(RpcController controller,
MasterProtos.MasterService.BlockingInterface client,
ClientProtos.CoprocessorServiceCall call) |
static void |
expectPBMagicPrefix(byte[] bytes) |
static KeyValue.Type |
fromDeleteType(ClientProtos.MutationProto.DeleteType type)
Convert a protocol buffer DeleteType to delete KeyValue type.
|
static HTableDescriptor[] |
getHTableDescriptorArray(MasterProtos.GetTableDescriptorsResponse proto)
Get HTableDescriptor[] from GetTableDescriptorsResponse protobuf
|
static java.util.List<HRegionInfo> |
getOnlineRegions(AdminProtos.AdminService.BlockingInterface admin)
A helper to get the all the online regions on a region
server using admin protocol.
|
static java.util.List<HRegionInfo> |
getOnlineRegions(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin)
A helper to get the all the online regions on a region
server using admin protocol.
|
static <T extends Message> |
getParsedGenericInstance(java.lang.Class<?> runtimeClass,
int position,
ByteString b)
Get an instance of the argument type declared in a class's signature.
|
static java.lang.String |
getRegionEncodedName(HBaseProtos.RegionSpecifier regionSpecifier)
Find the HRegion encoded name based on a region specifier
|
static HRegionInfo |
getRegionInfo(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
byte[] regionName)
A helper to retrieve region info given a region name
using admin protocol.
|
static java.io.IOException |
getRemoteException(ServiceException se)
Return the IOException thrown by the remote server wrapped in
ServiceException as cause.
|
static Result |
getRowOrBefore(ClientProtos.ClientService.BlockingInterface client,
byte[] regionName,
byte[] row,
byte[] family)
Deprecated.
since 0.99 - use reversed scanner instead.
|
static AdminProtos.ServerInfo |
getServerInfo(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin)
A helper to get the info of a region server using admin protocol.
|
static java.lang.String |
getShortTextFormat(Message m)
Return short version of Message toString'd, shorter than TextFormat#shortDebugString.
|
static byte[][] |
getSplitKeysArray(MasterProtos.CreateTableRequest proto)
get the split keys in form "byte [][]" from a CreateTableRequest proto
|
static java.util.List<java.lang.String> |
getStoreFiles(AdminProtos.AdminService.BlockingInterface admin,
byte[] regionName,
byte[] family)
A helper to get the list of files of a column family
on a given region using admin protocol.
|
static java.util.List<java.lang.String> |
getStoreFiles(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
byte[] regionName,
byte[] family)
A helper to get the list of files of a column family
on a given region using admin protocol.
|
static TableName[] |
getTableNameArray(java.util.List<TableProtos.TableName> tableNamesList) |
static long |
getTotalRequestsCount(ClusterStatusProtos.RegionLoad rl) |
static java.util.List<UserPermission> |
getUserPermissions(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol)
A utility used to get user's global permissions.
|
static java.util.List<UserPermission> |
getUserPermissions(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
byte[] namespace)
A utility used to get permissions for selected namespace.
|
static java.util.List<UserPermission> |
getUserPermissions(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
TableName t)
A utility used to get user table permissions.
|
static RPCProtos.VersionInfo |
getVersionInfo()
Get a protocol buffer VersionInfo
|
static void |
grant(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
Permission.Action... actions)
A utility used to grant a user global permissions.
|
static void |
grant(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
java.lang.String namespace,
Permission.Action... actions)
A utility used to grant a user namespace permissions.
|
static void |
grant(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
TableName tableName,
byte[] f,
byte[] q,
Permission.Action... actions)
A utility used to grant a user table permissions.
|
static boolean |
isPBMagicPrefix(byte[] bytes) |
static boolean |
isPBMagicPrefix(byte[] bytes,
int offset,
int len) |
static int |
lengthOfPBMagic() |
static void |
mergeDelimitedFrom(Message.Builder builder,
java.io.InputStream in)
This version of protobuf's mergeDelimitedFrom avoids the hard-coded 64MB limit for decoding
buffers
|
static void |
mergeFrom(Message.Builder builder,
byte[] b)
This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
buffers when working with byte arrays
|
static void |
mergeFrom(Message.Builder builder,
byte[] b,
int offset,
int length)
This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
buffers when working with byte arrays
|
static void |
mergeFrom(Message.Builder builder,
ByteString bs)
This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
buffers when working with ByteStrings
|
static void |
mergeFrom(Message.Builder builder,
CodedInputStream codedInput,
int length) |
static void |
mergeFrom(Message.Builder builder,
java.io.InputStream in)
This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
buffers where the message size is not known
|
static void |
mergeFrom(Message.Builder builder,
java.io.InputStream in,
int size)
This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
buffers where the message size is known
|
static void |
mergeRegions(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo region_a,
HRegionInfo region_b,
boolean forcible)
A helper to merge regions using admin protocol.
|
static <T extends Service> |
newServiceStub(java.lang.Class<T> service,
RpcChannel channel) |
static void |
openRegion(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
ServerName server,
HRegionInfo region)
A helper to open a region using admin protocol.
|
static byte[] |
prependPBMagic(byte[] bytes)
Prepend the passed bytes with four bytes of magic,
PB_MAGIC, to flag what
follows as a protobuf in hbase. |
static void |
revoke(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
Permission.Action... actions)
A utility used to revoke a user's global permissions.
|
static void |
revoke(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
java.lang.String namespace,
Permission.Action... actions)
A utility used to revoke a user's namespace permissions.
|
static void |
revoke(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
TableName tableName,
byte[] f,
byte[] q,
Permission.Action... actions)
A utility used to revoke a user's table permissions.
|
static void |
split(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo hri,
byte[] splitPoint)
A helper to split a region using admin protocol.
|
static Append |
toAppend(ClientProtos.MutationProto proto,
CellScanner cellScanner)
Convert a protocol buffer Mutate to an Append
|
static ClientProtos.Authorizations |
toAuthorizations(Authorizations authorizations)
Create a protocol buffer Authorizations based on a client Authorizations.
|
static Authorizations |
toAuthorizations(byte[] protoBytes)
Convert a protocol buffer Authorizations bytes to a client Authorizations
|
static Authorizations |
toAuthorizations(ClientProtos.Authorizations proto)
Convert a protocol buffer Authorizations to a client Authorizations
|
static WALProtos.BulkLoadDescriptor |
toBulkLoadDescriptor(TableName tableName,
ByteString encodedRegionName,
java.util.Map<byte[],java.util.List<Path>> storeFiles,
java.util.Map<java.lang.String,java.lang.Long> storeFilesSize,
long bulkloadSeqId)
Generates a marker for the WAL so that we propagate the notion of a bulk region load
throughout the WAL.
|
static CellProtos.Cell |
toCell(Cell kv) |
static Cell |
toCell(CellProtos.Cell cell) |
static CellVisibility |
toCellVisibility(byte[] protoBytes)
Convert a protocol buffer CellVisibility bytes to a client CellVisibility
|
static ClientProtos.CellVisibility |
toCellVisibility(CellVisibility cellVisibility)
Create a protocol buffer CellVisibility based on a client CellVisibility.
|
static CellVisibility |
toCellVisibility(ClientProtos.CellVisibility proto)
Convert a protocol buffer CellVisibility to a client CellVisibility
|
static WALProtos.CompactionDescriptor |
toCompactionDescriptor(HRegionInfo info,
byte[] regionName,
byte[] family,
java.util.List<Path> inputPaths,
java.util.List<Path> outputPaths,
Path storeDir) |
static WALProtos.CompactionDescriptor |
toCompactionDescriptor(HRegionInfo info,
byte[] family,
java.util.List<Path> inputPaths,
java.util.List<Path> outputPaths,
Path storeDir) |
static ComparatorProtos.Comparator |
toComparator(ByteArrayComparable comparator)
Convert a ByteArrayComparable to a protocol buffer Comparator
|
static ByteArrayComparable |
toComparator(ComparatorProtos.Comparator proto)
Convert a protocol buffer Comparator to a ByteArrayComparable
|
static Consistency |
toConsistency(ClientProtos.Consistency consistency) |
static ClientProtos.Consistency |
toConsistency(Consistency consistency) |
static Delete |
toDelete(ClientProtos.MutationProto proto)
Convert a protocol buffer Mutate to a Delete
|
static Delete |
toDelete(ClientProtos.MutationProto proto,
CellScanner cellScanner)
Convert a protocol buffer Mutate to a Delete
|
static ClientProtos.MutationProto.DeleteType |
toDeleteType(KeyValue.Type type)
Convert a delete KeyValue type to protocol buffer DeleteType.
|
static byte[] |
toDelimitedByteArray(Message m) |
static Durability |
toDurability(ClientProtos.MutationProto.Durability proto)
Convert a protobuf Durability into a client Durability
|
static ClientProtos.MutationProto.Durability |
toDurability(Durability d)
Convert a client Durability into a protbuf Durability
|
static java.lang.Throwable |
toException(HBaseProtos.NameBytesPair parameter)
Convert a stringified protocol buffer exception Parameter to a Java Exception
|
static FilterProtos.Filter |
toFilter(Filter filter)
Convert a client Filter to a protocol buffer Filter
|
static Filter |
toFilter(FilterProtos.Filter proto)
Convert a protocol buffer Filter to a client Filter
|
static WALProtos.FlushDescriptor |
toFlushDescriptor(WALProtos.FlushDescriptor.FlushAction action,
HRegionInfo hri,
long flushSeqId,
java.util.Map<byte[],java.util.List<Path>> committedFiles) |
static Get |
toGet(ClientProtos.Get proto)
Convert a protocol buffer Get to a client Get
|
static ClientProtos.Get |
toGet(Get get)
Create a protocol buffer Get based on a client Get.
|
static RSGroupInfo |
toGroupInfo(RSGroupProtos.RSGroupInfo proto) |
static Increment |
toIncrement(ClientProtos.MutationProto proto,
CellScanner cellScanner)
Convert a protocol buffer Mutate to an Increment
|
static void |
toIOException(ServiceException se)
Unwraps an exception from a protobuf service into the underlying (expected) IOException.
|
static ClientProtos.MutationProto |
toMutation(ClientProtos.MutationProto.MutationType type,
Mutation mutation) |
static ClientProtos.MutationProto |
toMutation(ClientProtos.MutationProto.MutationType type,
Mutation mutation,
ClientProtos.MutationProto.Builder builder) |
static ClientProtos.MutationProto |
toMutation(ClientProtos.MutationProto.MutationType type,
Mutation mutation,
ClientProtos.MutationProto.Builder builder,
long nonce) |
static ClientProtos.MutationProto |
toMutation(ClientProtos.MutationProto.MutationType type,
Mutation mutation,
long nonce)
Create a protocol buffer Mutate based on a client Mutation
|
static Mutation |
toMutation(ClientProtos.MutationProto proto)
Convert a MutateRequest to Mutation
|
static ClientProtos.MutationProto |
toMutation(Increment increment,
ClientProtos.MutationProto.Builder builder,
long nonce)
Convert a client Increment to a protobuf Mutate.
|
static ClientProtos.MutationProto |
toMutationNoData(ClientProtos.MutationProto.MutationType type,
Mutation mutation)
Create a protocol buffer MutationProto based on a client Mutation.
|
static ClientProtos.MutationProto |
toMutationNoData(ClientProtos.MutationProto.MutationType type,
Mutation mutation,
ClientProtos.MutationProto.Builder builder)
Create a protocol buffer MutationProto based on a client Mutation.
|
static ClientProtos.MutationProto |
toMutationNoData(ClientProtos.MutationProto.MutationType type,
Mutation mutation,
ClientProtos.MutationProto.Builder builder,
long nonce) |
static NamespaceDescriptor |
toNamespaceDescriptor(HBaseProtos.NamespaceDescriptor desc) |
static Permission |
toPermission(AccessControlProtos.Permission proto)
Converts a Permission proto to a client Permission object.
|
static AccessControlProtos.Permission |
toPermission(Permission perm)
Convert a client Permission to a Permission proto
|
static Permission.Action |
toPermissionAction(AccessControlProtos.Permission.Action action)
Converts a Permission.Action proto to a client Permission.Action object.
|
static AccessControlProtos.Permission.Action |
toPermissionAction(Permission.Action action)
Convert a client Permission.Action to a Permission.Action proto
|
static java.util.List<Permission.Action> |
toPermissionActions(java.util.List<AccessControlProtos.Permission.Action> protoActions)
Converts a list of Permission.Action proto to a list of client Permission.Action objects.
|
static BackupProtos.BackupType |
toProtoBackupType(BackupType type) |
static RSGroupProtos.RSGroupInfo |
toProtoGroupInfo(RSGroupInfo pojo) |
static HBaseProtos.NamespaceDescriptor |
toProtoNamespaceDescriptor(NamespaceDescriptor ns) |
static QuotaProtos.QuotaScope |
toProtoQuotaScope(QuotaScope scope)
Convert a client QuotaScope to a protocol buffer QuotaScope
|
static QuotaProtos.QuotaType |
toProtoQuotaScope(QuotaType type)
Convert a client QuotaType to a protocol buffer QuotaType
|
static QuotaProtos.SpaceQuota |
toProtoSpaceQuota(long limit,
SpaceViolationPolicy violationPolicy)
Builds a protocol buffer SpaceQuota.
|
static TableProtos.TableName |
toProtoTableName(TableName tableName) |
static QuotaProtos.ThrottleType |
toProtoThrottleType(ThrottleType type)
Convert a client ThrottleType to a protocol buffer ThrottleType
|
static HBaseProtos.TimeUnit |
toProtoTimeUnit(java.util.concurrent.TimeUnit timeUnit)
Convert a client TimeUnit to a protocol buffer TimeUnit
|
static QuotaProtos.SpaceViolationPolicy |
toProtoViolationPolicy(SpaceViolationPolicy policy)
Converts a client SpaceViolationPolicy to a protocol buffer SpaceViolationPolicy.
|
static Put |
toPut(ClientProtos.MutationProto proto)
Convert a protocol buffer Mutate to a Put.
|
static Put |
toPut(ClientProtos.MutationProto proto,
CellScanner cellScanner)
Convert a protocol buffer Mutate to a Put.
|
static QuotaScope |
toQuotaScope(QuotaProtos.QuotaScope proto)
Convert a protocol buffer QuotaScope to a client QuotaScope
|
static QuotaType |
toQuotaScope(QuotaProtos.QuotaType proto)
Convert a protocol buffer QuotaType to a client QuotaType
|
static WALProtos.RegionEventDescriptor |
toRegionEventDescriptor(WALProtos.RegionEventDescriptor.EventType eventType,
HRegionInfo hri,
long seqId,
ServerName server,
java.util.Map<byte[],java.util.List<Path>> storeFiles) |
static ReplicationLoadSink |
toReplicationLoadSink(ClusterStatusProtos.ReplicationLoadSink cls) |
static ReplicationLoadSource |
toReplicationLoadSource(ClusterStatusProtos.ReplicationLoadSource cls) |
static java.util.List<ReplicationLoadSource> |
toReplicationLoadSourceList(java.util.List<ClusterStatusProtos.ReplicationLoadSource> clsList) |
static ClientProtos.Result |
toResult(boolean existence,
boolean stale)
Convert a client Result to a protocol buffer Result
|
static Result |
toResult(ClientProtos.Result proto)
Convert a protocol buffer Result to a client Result
|
static Result |
toResult(ClientProtos.Result proto,
CellScanner scanner)
Convert a protocol buffer Result to a client Result
|
static ClientProtos.Result |
toResult(Result result)
Convert a client Result to a protocol buffer Result
|
static ClientProtos.Result |
toResultNoData(Result result)
Convert a client Result to a protocol buffer Result.
|
static Scan |
toScan(ClientProtos.Scan proto)
Convert a protocol buffer Scan to a client Scan
|
static ClientProtos.Scan |
toScan(Scan scan)
Convert a client Scan to a protocol buffer Scan
|
static ScanMetrics |
toScanMetrics(byte[] bytes) |
static MapReduceProtos.ScanMetrics |
toScanMetrics(ScanMetrics scanMetrics) |
static ServerName |
toServerName(HBaseProtos.ServerName proto)
Convert a protocol buffer ServerName to a ServerName
|
static HBaseProtos.ServerName |
toServerName(ServerName serverName)
Convert a ServerName to a protocol buffer ServerName
|
static TableName |
toTableName(TableProtos.TableName tableNamePB) |
static TablePermission |
toTablePermission(AccessControlProtos.Permission proto)
Converts a Permission proto to a client TablePermission object.
|
static ThrottleType |
toThrottleType(QuotaProtos.ThrottleType proto)
Convert a protocol buffer ThrottleType to a client ThrottleType
|
static QuotaProtos.TimedQuota |
toTimedQuota(long limit,
java.util.concurrent.TimeUnit timeUnit,
QuotaScope scope)
Build a protocol buffer TimedQuota
|
static java.util.concurrent.TimeUnit |
toTimeUnit(HBaseProtos.TimeUnit proto)
Convert a protocol buffer TimeUnit to a client TimeUnit
|
static AuthenticationProtos.Token |
toToken(<any> token)
Converts a Token instance (with embedded identifier) to the protobuf representation.
|
static <any> |
toToken(AuthenticationProtos.Token proto)
Converts a protobuf Token message back into a Token instance.
|
static UserPermission |
toUserPermission(AccessControlProtos.UserPermission proto)
Converts a user permission proto to a client user permission object.
|
static AccessControlProtos.UserPermission |
toUserPermission(UserPermission perm)
Convert a client user permission to a user permission proto
|
static AccessControlProtos.UsersAndPermissions |
toUsersAndPermissions(<any> perms) |
static <any> |
toUsersAndPermissions(AccessControlProtos.UsersAndPermissions proto) |
static AccessControlProtos.UsersAndPermissions |
toUsersAndPermissions(java.lang.String user,
Permission perms) |
static AccessControlProtos.UsersAndPermissions |
toUserTablePermissions(<any> perm)
Convert a ListMultimap
|
static <any> |
toUserTablePermissions(AccessControlProtos.UsersAndPermissions proto)
Convert a protobuf UserTablePermissions to a
ListMultimap
|
static SpaceViolationPolicy |
toViolationPolicy(QuotaProtos.SpaceViolationPolicy proto)
Converts a protocol buffer SpaceViolationPolicy to a client SpaceViolationPolicy.
|
static void |
warmupRegion(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo regionInfo)
A helper to warmup a region given a region name
using admin protocol
|
public static final byte[] PB_MAGIC
public static byte[] prependPBMagic(byte[] bytes)
PB_MAGIC, to flag what
follows as a protobuf in hbase. Prepend these bytes to all content written to znodes, etc.bytes - Bytes to decoratebytes with magic prepended (Creates a new
byte array that is bytes.length plus PB_MAGIC.length.public static boolean isPBMagicPrefix(byte[] bytes)
bytes - Bytes to check.bytes has PB_MAGIC for a prefix.public static boolean isPBMagicPrefix(byte[] bytes,
int offset,
int len)
bytes - Bytes to check.bytes has PB_MAGIC for a prefix.public static void expectPBMagicPrefix(byte[] bytes)
throws DeserializationException
bytes - DeserializationException - if we are missing the pb magic prefixpublic static int lengthOfPBMagic()
PB_MAGICpublic static java.io.IOException getRemoteException(ServiceException se)
se - ServiceException that wraps IO exception thrown by the serverpublic static HBaseProtos.ServerName toServerName(ServerName serverName)
serverName - the ServerName to converttoServerName(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName)public static ServerName toServerName(HBaseProtos.ServerName proto)
proto - the protocol buffer ServerName to convertpublic static HTableDescriptor[] getHTableDescriptorArray(MasterProtos.GetTableDescriptorsResponse proto)
proto - the GetTableDescriptorsResponsepublic static byte[][] getSplitKeysArray(MasterProtos.CreateTableRequest proto)
proto - the CreateTableRequestpublic static Durability toDurability(ClientProtos.MutationProto.Durability proto)
public static ClientProtos.MutationProto.Durability toDurability(Durability d)
public static Get toGet(ClientProtos.Get proto) throws java.io.IOException
proto - the protocol buffer Get to convertjava.io.IOExceptionpublic static Consistency toConsistency(ClientProtos.Consistency consistency)
public static ClientProtos.Consistency toConsistency(Consistency consistency)
public static Put toPut(ClientProtos.MutationProto proto) throws java.io.IOException
proto - The protocol buffer MutationProto to convertjava.io.IOExceptionpublic static Put toPut(ClientProtos.MutationProto proto, CellScanner cellScanner) throws java.io.IOException
proto - The protocol buffer MutationProto to convertcellScanner - If non-null, the Cell data that goes with this proto.java.io.IOExceptionpublic static Delete toDelete(ClientProtos.MutationProto proto) throws java.io.IOException
proto - the protocol buffer Mutate to convertjava.io.IOExceptionpublic static Delete toDelete(ClientProtos.MutationProto proto, CellScanner cellScanner) throws java.io.IOException
proto - the protocol buffer Mutate to convertcellScanner - if non-null, the data that goes with this delete.java.io.IOExceptionpublic static Append toAppend(ClientProtos.MutationProto proto, CellScanner cellScanner) throws java.io.IOException
cellScanner - proto - the protocol buffer Mutate to convertjava.io.IOExceptionpublic static Mutation toMutation(ClientProtos.MutationProto proto) throws java.io.IOException
proto - the protocol buffer Mutate to convertjava.io.IOExceptionpublic static Increment toIncrement(ClientProtos.MutationProto proto, CellScanner cellScanner) throws java.io.IOException
proto - the protocol buffer Mutate to convertjava.io.IOExceptionpublic static ClientProtos.Scan toScan(Scan scan) throws java.io.IOException
scan - the client Scan to convertjava.io.IOExceptionpublic static Scan toScan(ClientProtos.Scan proto) throws java.io.IOException
proto - the protocol buffer Scan to convertjava.io.IOExceptionpublic static ClientProtos.Get toGet(Get get) throws java.io.IOException
get - the client Getjava.io.IOExceptionpublic static ClientProtos.MutationProto toMutation(Increment increment, ClientProtos.MutationProto.Builder builder, long nonce)
increment - public static ClientProtos.MutationProto toMutation(ClientProtos.MutationProto.MutationType type, Mutation mutation) throws java.io.IOException
java.io.IOExceptionpublic static ClientProtos.MutationProto toMutation(ClientProtos.MutationProto.MutationType type, Mutation mutation, long nonce) throws java.io.IOException
type - mutation - java.io.IOExceptionpublic static ClientProtos.MutationProto toMutation(ClientProtos.MutationProto.MutationType type, Mutation mutation, ClientProtos.MutationProto.Builder builder) throws java.io.IOException
java.io.IOExceptionpublic static ClientProtos.MutationProto toMutation(ClientProtos.MutationProto.MutationType type, Mutation mutation, ClientProtos.MutationProto.Builder builder, long nonce) throws java.io.IOException
java.io.IOExceptionpublic static ClientProtos.MutationProto toMutationNoData(ClientProtos.MutationProto.MutationType type, Mutation mutation, ClientProtos.MutationProto.Builder builder) throws java.io.IOException
type - mutation - builder - java.io.IOExceptionpublic static ClientProtos.MutationProto toMutationNoData(ClientProtos.MutationProto.MutationType type, Mutation mutation) throws java.io.IOException
type - mutation - java.io.IOExceptionpublic static ClientProtos.MutationProto toMutationNoData(ClientProtos.MutationProto.MutationType type, Mutation mutation, ClientProtos.MutationProto.Builder builder, long nonce) throws java.io.IOException
java.io.IOExceptionpublic static ClientProtos.Result toResult(Result result)
result - the client Result to convertpublic static ClientProtos.Result toResult(boolean existence, boolean stale)
existence - the client existence to sendpublic static ClientProtos.Result toResultNoData(Result result)
result - the client Result to convertpublic static Result toResult(ClientProtos.Result proto)
proto - the protocol buffer Result to convertpublic static Result toResult(ClientProtos.Result proto, CellScanner scanner) throws java.io.IOException
proto - the protocol buffer Result to convertscanner - Optional cell scanner.java.io.IOExceptionpublic static ComparatorProtos.Comparator toComparator(ByteArrayComparable comparator)
comparator - the ByteArrayComparable to convertpublic static ByteArrayComparable toComparator(ComparatorProtos.Comparator proto) throws java.io.IOException
proto - the protocol buffer Comparator to convertjava.io.IOExceptionpublic static Filter toFilter(FilterProtos.Filter proto) throws java.io.IOException
proto - the protocol buffer Filter to convertjava.io.IOExceptionpublic static FilterProtos.Filter toFilter(Filter filter) throws java.io.IOException
filter - the Filter to convertjava.io.IOExceptionpublic static ClientProtos.MutationProto.DeleteType toDeleteType(KeyValue.Type type) throws java.io.IOException
type - java.io.IOExceptionpublic static KeyValue.Type fromDeleteType(ClientProtos.MutationProto.DeleteType type) throws java.io.IOException
type - The DeleteTypejava.io.IOExceptionpublic static java.lang.Throwable toException(HBaseProtos.NameBytesPair parameter) throws java.io.IOException
parameter - the protocol buffer Parameter to convertjava.io.IOException - if failed to deserialize the parameter@Deprecated public static Result getRowOrBefore(ClientProtos.ClientService.BlockingInterface client, byte[] regionName, byte[] row, byte[] family) throws java.io.IOException
client - regionName - row - family - java.io.IOExceptionpublic static boolean bulkLoadHFile(ClientProtos.ClientService.BlockingInterface client, java.util.List<Pair<byte[],java.lang.String>> familyPaths, byte[] regionName, boolean assignSeqNum) throws java.io.IOException
client - familyPaths - regionName - assignSeqNum - java.io.IOExceptionpublic static ClientProtos.CoprocessorServiceResponse execService(RpcController controller, ClientProtos.ClientService.BlockingInterface client, ClientProtos.CoprocessorServiceCall call, byte[] regionName) throws java.io.IOException
java.io.IOExceptionpublic static ClientProtos.CoprocessorServiceResponse execService(RpcController controller, MasterProtos.MasterService.BlockingInterface client, ClientProtos.CoprocessorServiceCall call) throws java.io.IOException
java.io.IOExceptionpublic static ClientProtos.CoprocessorServiceResponse execRegionServerService(RpcController controller, ClientProtos.ClientService.BlockingInterface client, ClientProtos.CoprocessorServiceCall call) throws java.io.IOException
client - call - java.io.IOExceptionpublic static <T extends Service> T newServiceStub(java.lang.Class<T> service,
RpcChannel channel)
throws java.lang.Exception
java.lang.Exceptionpublic static HRegionInfo getRegionInfo(RpcController controller, AdminProtos.AdminService.BlockingInterface admin, byte[] regionName) throws java.io.IOException
admin - regionName - java.io.IOExceptionpublic static void closeRegion(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
ServerName server,
byte[] regionName,
boolean transitionInZK)
throws java.io.IOException
admin - regionName - transitionInZK - java.io.IOExceptionpublic static boolean closeRegion(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
ServerName server,
byte[] regionName,
int versionOfClosingNode,
ServerName destinationServer,
boolean transitionInZK)
throws java.io.IOException
admin - regionName - versionOfClosingNode - java.io.IOExceptionpublic static void warmupRegion(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo regionInfo)
throws java.io.IOException
admin - regionInfo - java.io.IOExceptionpublic static void openRegion(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
ServerName server,
HRegionInfo region)
throws java.io.IOException
admin - region - java.io.IOExceptionpublic static java.util.List<HRegionInfo> getOnlineRegions(AdminProtos.AdminService.BlockingInterface admin) throws java.io.IOException
admin - java.io.IOExceptionpublic static java.util.List<HRegionInfo> getOnlineRegions(RpcController controller, AdminProtos.AdminService.BlockingInterface admin) throws java.io.IOException
java.io.IOExceptionpublic static AdminProtos.ServerInfo getServerInfo(RpcController controller, AdminProtos.AdminService.BlockingInterface admin) throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<java.lang.String> getStoreFiles(AdminProtos.AdminService.BlockingInterface admin, byte[] regionName, byte[] family) throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<java.lang.String> getStoreFiles(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
byte[] regionName,
byte[] family)
throws java.io.IOException
java.io.IOExceptionpublic static void split(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo hri,
byte[] splitPoint)
throws java.io.IOException
admin - hri - splitPoint - java.io.IOExceptionpublic static void mergeRegions(RpcController controller,
AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo region_a,
HRegionInfo region_b,
boolean forcible)
throws java.io.IOException
admin - region_a - region_b - forcible - true if do a compulsory merge, otherwise we will only merge
two adjacent regionsjava.io.IOExceptionpublic static long getTotalRequestsCount(ClusterStatusProtos.RegionLoad rl)
public static byte[] toDelimitedByteArray(Message m)
throws java.io.IOException
m - Message to get delimited pb serialization of (with pb magic prefix)java.io.IOExceptionpublic static Permission toPermission(AccessControlProtos.Permission proto)
proto - the protobuf Permissionpublic static TablePermission toTablePermission(AccessControlProtos.Permission proto)
proto - the protobuf Permissionpublic static AccessControlProtos.Permission toPermission(Permission perm)
perm - the client Permissionpublic static java.util.List<Permission.Action> toPermissionActions(java.util.List<AccessControlProtos.Permission.Action> protoActions)
protoActions - the list of protobuf Actionspublic static Permission.Action toPermissionAction(AccessControlProtos.Permission.Action action)
action - the protobuf Actionpublic static AccessControlProtos.Permission.Action toPermissionAction(Permission.Action action)
action - the client Actionpublic static AccessControlProtos.UserPermission toUserPermission(UserPermission perm)
perm - the client UserPermissionpublic static UserPermission toUserPermission(AccessControlProtos.UserPermission proto)
proto - the protobuf UserPermissionpublic static AccessControlProtos.UsersAndPermissions toUserTablePermissions(<any> perm)
perm - the list of user and table permissionspublic static void grant(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
Permission.Action... actions)
throws ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxyuserShortName - the short name of the user to grant permissionsactions - the permissions to be grantedServiceExceptionpublic static void grant(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
TableName tableName,
byte[] f,
byte[] q,
Permission.Action... actions)
throws ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxyuserShortName - the short name of the user to grant permissionstableName - optional table namef - optional column familyq - optional qualifieractions - the permissions to be grantedServiceExceptionpublic static void grant(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
java.lang.String namespace,
Permission.Action... actions)
throws ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxynamespace - the short name of the user to grant permissionsactions - the permissions to be grantedServiceExceptionpublic static void revoke(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
Permission.Action... actions)
throws ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxyuserShortName - the short name of the user to revoke permissionsactions - the permissions to be revokedServiceExceptionpublic static void revoke(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
TableName tableName,
byte[] f,
byte[] q,
Permission.Action... actions)
throws ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxyuserShortName - the short name of the user to revoke permissionstableName - optional table namef - optional column familyq - optional qualifieractions - the permissions to be revokedServiceExceptionpublic static void revoke(RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
java.lang.String userShortName,
java.lang.String namespace,
Permission.Action... actions)
throws ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxyuserShortName - the short name of the user to revoke permissionsnamespace - optional table nameactions - the permissions to be revokedServiceExceptionpublic static java.util.List<UserPermission> getUserPermissions(RpcController controller, AccessControlProtos.AccessControlService.BlockingInterface protocol) throws ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxyServiceExceptionpublic static java.util.List<UserPermission> getUserPermissions(RpcController controller, AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName t) throws ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxyt - optional table nameServiceExceptionpublic static java.util.List<UserPermission> getUserPermissions(RpcController controller, AccessControlProtos.AccessControlService.BlockingInterface protocol, byte[] namespace) throws ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxynamespace - name of the namespaceServiceExceptionpublic static <any> toUserTablePermissions(AccessControlProtos.UsersAndPermissions proto)
proto - the protobuf UserPermissionpublic static AuthenticationProtos.Token toToken(<any> token)
token - the Token instance to copypublic static <any> toToken(AuthenticationProtos.Token proto)
proto - the protobuf Token messagepublic static java.lang.String getRegionEncodedName(HBaseProtos.RegionSpecifier regionSpecifier) throws DoNotRetryIOException
regionSpecifier - the region specifierDoNotRetryIOException - if the specifier type is unsupportedpublic static ScanMetrics toScanMetrics(byte[] bytes)
public static MapReduceProtos.ScanMetrics toScanMetrics(ScanMetrics scanMetrics)
public static void toIOException(ServiceException se)
throws java.io.IOException
se - the ServiceException instance to convert into an IOExceptionjava.io.IOExceptionpublic static CellProtos.Cell toCell(Cell kv)
public static Cell toCell(CellProtos.Cell cell)
public static HBaseProtos.NamespaceDescriptor toProtoNamespaceDescriptor(NamespaceDescriptor ns)
public static NamespaceDescriptor toNamespaceDescriptor(HBaseProtos.NamespaceDescriptor desc) throws java.io.IOException
java.io.IOExceptionpublic static <T extends Message> T getParsedGenericInstance(java.lang.Class<?> runtimeClass,
int position,
ByteString b)
throws java.io.IOException
runtimeClass - the runtime type of the classposition - the position of the argument in the class declarationb - the ByteString which should be parsed to get the instance createdjava.io.IOExceptionpublic static WALProtos.CompactionDescriptor toCompactionDescriptor(HRegionInfo info, byte[] family, java.util.List<Path> inputPaths, java.util.List<Path> outputPaths, Path storeDir)
public static WALProtos.CompactionDescriptor toCompactionDescriptor(HRegionInfo info, byte[] regionName, byte[] family, java.util.List<Path> inputPaths, java.util.List<Path> outputPaths, Path storeDir)
public static WALProtos.FlushDescriptor toFlushDescriptor(WALProtos.FlushDescriptor.FlushAction action, HRegionInfo hri, long flushSeqId, java.util.Map<byte[],java.util.List<Path>> committedFiles)
public static WALProtos.RegionEventDescriptor toRegionEventDescriptor(WALProtos.RegionEventDescriptor.EventType eventType, HRegionInfo hri, long seqId, ServerName server, java.util.Map<byte[],java.util.List<Path>> storeFiles)
public static java.lang.String getShortTextFormat(Message m)
m - mpublic static TableName toTableName(TableProtos.TableName tableNamePB)
public static TableProtos.TableName toProtoTableName(TableName tableName)
public static TableName[] getTableNameArray(java.util.List<TableProtos.TableName> tableNamesList)
public static BackupProtos.BackupType toProtoBackupType(BackupType type)
public static CellVisibility toCellVisibility(ClientProtos.CellVisibility proto)
proto - public static CellVisibility toCellVisibility(byte[] protoBytes) throws DeserializationException
protoBytes - DeserializationExceptionpublic static ClientProtos.CellVisibility toCellVisibility(CellVisibility cellVisibility)
cellVisibility - public static Authorizations toAuthorizations(ClientProtos.Authorizations proto)
proto - public static Authorizations toAuthorizations(byte[] protoBytes) throws DeserializationException
protoBytes - DeserializationExceptionpublic static ClientProtos.Authorizations toAuthorizations(Authorizations authorizations)
authorizations - public static AccessControlProtos.UsersAndPermissions toUsersAndPermissions(java.lang.String user, Permission perms)
public static AccessControlProtos.UsersAndPermissions toUsersAndPermissions(<any> perms)
public static <any> toUsersAndPermissions(AccessControlProtos.UsersAndPermissions proto)
public static java.util.concurrent.TimeUnit toTimeUnit(HBaseProtos.TimeUnit proto)
proto - public static HBaseProtos.TimeUnit toProtoTimeUnit(java.util.concurrent.TimeUnit timeUnit)
timeUnit - public static ThrottleType toThrottleType(QuotaProtos.ThrottleType proto)
proto - public static QuotaProtos.ThrottleType toProtoThrottleType(ThrottleType type)
type - public static QuotaScope toQuotaScope(QuotaProtos.QuotaScope proto)
proto - public static QuotaProtos.QuotaScope toProtoQuotaScope(QuotaScope scope)
scope - public static QuotaType toQuotaScope(QuotaProtos.QuotaType proto)
proto - public static QuotaProtos.QuotaType toProtoQuotaScope(QuotaType type)
type - public static SpaceViolationPolicy toViolationPolicy(QuotaProtos.SpaceViolationPolicy proto)
proto - The protocol buffer space violation policy.public static QuotaProtos.SpaceViolationPolicy toProtoViolationPolicy(SpaceViolationPolicy policy)
policy - The client SpaceViolationPolicy object.public static QuotaProtos.TimedQuota toTimedQuota(long limit, java.util.concurrent.TimeUnit timeUnit, QuotaScope scope)
limit - the allowed number of request/data per timeUnittimeUnit - the limit time unitscope - the quota scopepublic static QuotaProtos.SpaceQuota toProtoSpaceQuota(long limit, SpaceViolationPolicy violationPolicy)
limit - The maximum space usage for the quota in bytes.violationPolicy - The policy to apply when the quota is violated.public static WALProtos.BulkLoadDescriptor toBulkLoadDescriptor(TableName tableName, ByteString encodedRegionName, java.util.Map<byte[],java.util.List<Path>> storeFiles, java.util.Map<java.lang.String,java.lang.Long> storeFilesSize, long bulkloadSeqId)
tableName - The tableName into which the bulk load is being imported into.encodedRegionName - Encoded region name of the region which is being bulk loaded.storeFiles - A set of store files of a column family are bulk loaded.storeFilesSize - Map of store files and their lengthsbulkloadSeqId - sequence ID (by a force flush) used to create bulk load hfile
namepublic static void mergeDelimitedFrom(Message.Builder builder,
java.io.InputStream in)
throws java.io.IOException
builder - current message builderin - Inputsream with delimited protobuf datajava.io.IOExceptionpublic static void mergeFrom(Message.Builder builder,
java.io.InputStream in,
int size)
throws java.io.IOException
builder - current message builderin - InputStream containing protobuf datasize - known size of protobuf datajava.io.IOExceptionpublic static void mergeFrom(Message.Builder builder,
java.io.InputStream in)
throws java.io.IOException
builder - current message builderin - InputStream containing protobuf datajava.io.IOExceptionpublic static void mergeFrom(Message.Builder builder,
ByteString bs)
throws java.io.IOException
builder - current message builderbs - ByteString containing thejava.io.IOExceptionpublic static void mergeFrom(Message.Builder builder,
byte[] b)
throws java.io.IOException
builder - current message builderb - byte arrayjava.io.IOExceptionpublic static void mergeFrom(Message.Builder builder,
byte[] b,
int offset,
int length)
throws java.io.IOException
builder - current message builderb - byte arrayoffset - length - java.io.IOExceptionpublic static void mergeFrom(Message.Builder builder,
CodedInputStream codedInput,
int length)
throws java.io.IOException
java.io.IOExceptionpublic static ReplicationLoadSink toReplicationLoadSink(ClusterStatusProtos.ReplicationLoadSink cls)
public static ReplicationLoadSource toReplicationLoadSource(ClusterStatusProtos.ReplicationLoadSource cls)
public static java.util.List<ReplicationLoadSource> toReplicationLoadSourceList(java.util.List<ClusterStatusProtos.ReplicationLoadSource> clsList)
public static RPCProtos.VersionInfo getVersionInfo()
public static RSGroupInfo toGroupInfo(RSGroupProtos.RSGroupInfo proto)
public static RSGroupProtos.RSGroupInfo toProtoGroupInfo(RSGroupInfo pojo)