@InterfaceAudience.Private public final class ProtobufUtil extends 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(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface client,
List<Pair<byte[],String>> familyPaths,
byte[] regionName,
boolean assignSeqNum)
Deprecated.
use bulkLoadHFile(final ClientService.BlockingInterface client,
final List
|
static boolean |
bulkLoadHFile(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface client,
List<Pair<byte[],String>> familyPaths,
byte[] regionName,
boolean assignSeqNum,
List<String> clusterIds)
A helper to bulk load a list of HFiles using client protocol.
|
static void |
closeRegion(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.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(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.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 org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceResponse |
execRegionServerService(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface client,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceCall call)
Make a region server endpoint call
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceResponse |
execService(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface client,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceCall call,
byte[] regionName) |
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceResponse |
execService(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.MasterService.BlockingInterface client,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceCall call) |
static void |
expectPBMagicPrefix(byte[] bytes) |
static KeyValue.Type |
fromDeleteType(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.DeleteType type)
Convert a protocol buffer DeleteType to delete KeyValue type.
|
static HTableDescriptor[] |
getHTableDescriptorArray(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.GetTableDescriptorsResponse proto)
Get HTableDescriptor[] from GetTableDescriptorsResponse protobuf
|
static List<HRegionInfo> |
getOnlineRegions(org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin)
A helper to get the all the online regions on a region
server using admin protocol.
|
static List<HRegionInfo> |
getOnlineRegions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin)
A helper to get the all the online regions on a region
server using admin protocol.
|
static <T extends com.google.protobuf.Message> |
getParsedGenericInstance(Class<?> runtimeClass,
int position,
com.google.protobuf.ByteString b)
Get an instance of the argument type declared in a class's signature.
|
static String |
getRegionEncodedName(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier regionSpecifier)
Find the HRegion encoded name based on a region specifier
|
static HRegionInfo |
getRegionInfo(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin,
byte[] regionName)
A helper to retrieve region info given a region name
using admin protocol.
|
static IOException |
getRemoteException(com.google.protobuf.ServiceException se)
Return the IOException thrown by the remote server wrapped in
ServiceException as cause.
|
static Result |
getRowOrBefore(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface client,
byte[] regionName,
byte[] row,
byte[] family)
Deprecated.
since 0.99 - use reversed scanner instead.
|
static org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo |
getServerInfo(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin)
A helper to get the info of a region server using admin protocol.
|
static IOException |
getServiceException(com.google.protobuf.ServiceException se)
Return the Exception thrown by the remote server wrapped in
ServiceException as cause.
|
static String |
getShortTextFormat(com.google.protobuf.Message m)
Return short version of Message toString'd, shorter than TextFormat#shortDebugString.
|
static byte[][] |
getSplitKeysArray(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.CreateTableRequest proto)
get the split keys in form "byte [][]" from a CreateTableRequest proto
|
static List<String> |
getStoreFiles(org.apache.hadoop.hbase.protobuf.generated.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 List<String> |
getStoreFiles(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.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(List<org.apache.hadoop.hbase.protobuf.generated.TableProtos.TableName> tableNamesList) |
static long |
getTotalRequestsCount(org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad rl) |
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol)
A utility used to get user's global permissions.
|
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
byte[] namespace)
A utility used to get permissions for selected namespace.
|
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
TableName t)
A utility used to get user table permissions.
|
static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.VersionInfo |
getVersionInfo()
Get a protocol buffer VersionInfo
|
static void |
grant(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
boolean mergeExistingPermissions,
Permission.Action... actions)
A utility used to grant a user global permissions.
|
static void |
grant(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
String namespace,
boolean mergeExistingPermissions,
Permission.Action... actions)
A utility used to grant a user namespace permissions.
|
static void |
grant(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
TableName tableName,
byte[] f,
byte[] q,
boolean mergeExistingPermissions,
Permission.Action... actions)
A utility used to grant a user table permissions.
|
static IOException |
handleRemoteException(Exception e)
Like
getRemoteException(ServiceException) but more generic, able to handle more than
just ServiceException. |
static boolean |
isPBMagicPrefix(byte[] bytes) |
static boolean |
isPBMagicPrefix(byte[] bytes,
int offset,
int len) |
static int |
lengthOfPBMagic() |
static void |
mergeDelimitedFrom(com.google.protobuf.Message.Builder builder,
InputStream in)
This version of protobuf's mergeDelimitedFrom avoids the hard-coded 64MB limit for decoding
buffers
|
static void |
mergeFrom(com.google.protobuf.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(com.google.protobuf.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(com.google.protobuf.Message.Builder builder,
com.google.protobuf.ByteString bs)
This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
buffers when working with ByteStrings
|
static void |
mergeFrom(com.google.protobuf.Message.Builder builder,
com.google.protobuf.CodedInputStream codedInput,
int length) |
static void |
mergeFrom(com.google.protobuf.Message.Builder builder,
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(com.google.protobuf.Message.Builder builder,
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(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo region_a,
HRegionInfo region_b,
boolean forcible,
User user)
A helper to merge regions using admin protocol.
|
static <T extends com.google.protobuf.Service> |
newServiceStub(Class<T> service,
com.google.protobuf.RpcChannel channel) |
static void |
openRegion(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.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(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
Permission.Action... actions)
A utility used to revoke a user's global permissions.
|
static void |
revoke(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
String namespace,
Permission.Action... actions)
A utility used to revoke a user's namespace permissions.
|
static void |
revoke(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
TableName tableName,
byte[] f,
byte[] q,
Permission.Action... actions)
A utility used to revoke a user's table permissions.
|
static void |
split(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo hri,
byte[] splitPoint)
A helper to split a region using admin protocol.
|
static Append |
toAppend(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto,
CellScanner cellScanner)
Convert a protocol buffer Mutate to an Append
|
static org.apache.hadoop.hbase.protobuf.generated.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(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Authorizations proto)
Convert a protocol buffer Authorizations to a client Authorizations
|
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.BulkLoadDescriptor |
toBulkLoadDescriptor(TableName tableName,
com.google.protobuf.ByteString encodedRegionName,
Map<byte[],List<org.apache.hadoop.fs.Path>> storeFiles,
Map<String,Long> storeFilesSize,
long bulkloadSeqId)
Deprecated.
use toBulkLoadDescriptor(TableName tableName, ByteString encodedRegionName,
Map
|
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.BulkLoadDescriptor |
toBulkLoadDescriptor(TableName tableName,
com.google.protobuf.ByteString encodedRegionName,
Map<byte[],List<org.apache.hadoop.fs.Path>> storeFiles,
Map<String,Long> storeFilesSize,
long bulkloadSeqId,
List<String> clusterIds)
Generates a marker for the WAL so that we propagate the notion of a bulk region load
throughout the WAL, keeping track of clusters who already applied the bulk event via
the passed clusterIds parameter.
|
static org.apache.hadoop.hbase.protobuf.generated.CellProtos.Cell |
toCell(Cell kv) |
static Cell |
toCell(org.apache.hadoop.hbase.protobuf.generated.CellProtos.Cell cell) |
static CellVisibility |
toCellVisibility(byte[] protoBytes)
Convert a protocol buffer CellVisibility bytes to a client CellVisibility
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CellVisibility |
toCellVisibility(CellVisibility cellVisibility)
Create a protocol buffer CellVisibility based on a client CellVisibility.
|
static CellVisibility |
toCellVisibility(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CellVisibility proto)
Convert a protocol buffer CellVisibility to a client CellVisibility
|
static Set<String> |
toCompactedStoreFiles(byte[] bytes) |
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.CompactionDescriptor |
toCompactionDescriptor(HRegionInfo info,
byte[] regionName,
byte[] family,
List<org.apache.hadoop.fs.Path> inputPaths,
List<org.apache.hadoop.fs.Path> outputPaths,
org.apache.hadoop.fs.Path storeDir) |
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.CompactionDescriptor |
toCompactionDescriptor(HRegionInfo info,
byte[] family,
List<org.apache.hadoop.fs.Path> inputPaths,
List<org.apache.hadoop.fs.Path> outputPaths,
org.apache.hadoop.fs.Path storeDir) |
static byte[] |
toCompactionEventTrackerBytes(Set<String> storeFiles) |
static org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos.Comparator |
toComparator(ByteArrayComparable comparator)
Convert a ByteArrayComparable to a protocol buffer Comparator
|
static ByteArrayComparable |
toComparator(org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos.Comparator proto)
Convert a protocol buffer Comparator to a ByteArrayComparable
|
static Consistency |
toConsistency(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Consistency consistency) |
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Consistency |
toConsistency(Consistency consistency) |
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Cursor |
toCursor(Cell cell) |
static Cursor |
toCursor(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Cursor cursor) |
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Cursor |
toCursor(Cursor cursor) |
static Delete |
toDelete(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto)
Convert a protocol buffer Mutate to a Delete
|
static Delete |
toDelete(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto,
CellScanner cellScanner)
Convert a protocol buffer Mutate to a Delete
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.DeleteType |
toDeleteType(KeyValue.Type type)
Convert a delete KeyValue type to protocol buffer DeleteType.
|
static byte[] |
toDelimitedByteArray(com.google.protobuf.Message m) |
static Durability |
toDurability(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Durability proto)
Convert a protobuf Durability into a client Durability
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Durability |
toDurability(Durability d)
Convert a client Durability into a protbuf Durability
|
static Throwable |
toException(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NameBytesPair parameter)
Convert a stringified protocol buffer exception Parameter to a Java Exception
|
static org.apache.hadoop.hbase.protobuf.generated.FilterProtos.Filter |
toFilter(Filter filter)
Convert a client Filter to a protocol buffer Filter
|
static Filter |
toFilter(org.apache.hadoop.hbase.protobuf.generated.FilterProtos.Filter proto)
Convert a protocol buffer Filter to a client Filter
|
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.FlushDescriptor |
toFlushDescriptor(org.apache.hadoop.hbase.protobuf.generated.WALProtos.FlushDescriptor.FlushAction action,
HRegionInfo hri,
long flushSeqId,
Map<byte[],List<org.apache.hadoop.fs.Path>> committedFiles) |
static Get |
toGet(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Get proto)
Convert a protocol buffer Get to a client Get
|
static Get |
toGet(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto,
CellScanner cellScanner)
Convert a protocol buffer Mutate to a Get.
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Get |
toGet(Get get)
Create a protocol buffer Get based on a client Get.
|
static Increment |
toIncrement(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto,
CellScanner cellScanner)
Convert a protocol buffer Mutate to an Increment
|
static void |
toIOException(com.google.protobuf.ServiceException se)
Unwraps an exception from a protobuf service into the underlying (expected) IOException.
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto |
toMutation(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation) |
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto |
toMutation(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builder) |
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto |
toMutation(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builder,
long nonce) |
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto |
toMutation(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation,
long nonce)
Create a protocol buffer Mutate based on a client Mutation
|
static Mutation |
toMutation(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto)
Convert a MutateRequest to Mutation
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto |
toMutation(Increment increment,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builder,
long nonce)
Convert a client Increment to a protobuf Mutate.
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto |
toMutationNoData(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation)
Create a protocol buffer MutationProto based on a client Mutation.
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto |
toMutationNoData(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builder)
Create a protocol buffer MutationProto based on a client Mutation.
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto |
toMutationNoData(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builder,
long nonce) |
static NamespaceDescriptor |
toNamespaceDescriptor(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NamespaceDescriptor desc) |
static Permission |
toPermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission proto)
Converts a Permission proto to a client Permission object.
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission |
toPermission(Permission perm)
Convert a client Permission to a Permission proto
|
static Permission.Action |
toPermissionAction(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action action)
Converts a Permission.Action proto to a client Permission.Action object.
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action |
toPermissionAction(Permission.Action action)
Convert a client Permission.Action to a Permission.Action proto
|
static List<Permission.Action> |
toPermissionActions(List<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action> protoActions)
Converts a list of Permission.Action proto to a list of client Permission.Action objects.
|
static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NamespaceDescriptor |
toProtoNamespaceDescriptor(NamespaceDescriptor ns) |
static org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.QuotaScope |
toProtoQuotaScope(QuotaScope scope)
Convert a client QuotaScope to a protocol buffer QuotaScope
|
static org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.QuotaType |
toProtoQuotaScope(QuotaType type)
Convert a client QuotaType to a protocol buffer QuotaType
|
static org.apache.hadoop.hbase.protobuf.generated.TableProtos.TableName |
toProtoTableName(TableName tableName) |
static org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.ThrottleType |
toProtoThrottleType(ThrottleType type)
Convert a client ThrottleType to a protocol buffer ThrottleType
|
static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeUnit |
toProtoTimeUnit(TimeUnit timeUnit)
Convert a client TimeUnit to a protocol buffer TimeUnit
|
static Put |
toPut(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto)
Convert a protocol buffer Mutate to a Put.
|
static Put |
toPut(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto,
CellScanner cellScanner)
Convert a protocol buffer Mutate to a Put.
|
static QuotaScope |
toQuotaScope(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.QuotaScope proto)
Convert a protocol buffer QuotaScope to a client QuotaScope
|
static QuotaType |
toQuotaScope(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.QuotaType proto)
Convert a protocol buffer QuotaType to a client QuotaType
|
static Scan.ReadType |
toReadType(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Scan.ReadType readType) |
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Scan.ReadType |
toReadType(Scan.ReadType readType) |
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor |
toRegionEventDescriptor(org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor.EventType eventType,
byte[] tableNameAsBytes,
byte[] encodedNameAsBytes,
byte[] regionNameAsBytes,
long seqId,
ServerName server,
Map<byte[],List<org.apache.hadoop.fs.Path>> storeFiles) |
static org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor |
toRegionEventDescriptor(org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor.EventType eventType,
HRegionInfo hri,
long seqId,
ServerName server,
Map<byte[],List<org.apache.hadoop.fs.Path>> storeFiles) |
static ReplicationLoadSink |
toReplicationLoadSink(org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.ReplicationLoadSink cls) |
static ReplicationLoadSource |
toReplicationLoadSource(org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.ReplicationLoadSource cls) |
static List<ReplicationLoadSource> |
toReplicationLoadSourceList(List<org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.ReplicationLoadSource> clsList) |
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result |
toResult(boolean existence,
boolean stale)
Convert a client Result to a protocol buffer Result
|
static Result |
toResult(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result proto)
Convert a protocol buffer Result to a client Result
|
static Result |
toResult(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result proto,
CellScanner scanner)
Convert a protocol buffer Result to a client Result
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result |
toResult(Result result)
Convert a client Result to a protocol buffer Result
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result |
toResultNoData(Result result)
Convert a client Result to a protocol buffer Result.
|
static Scan |
toScan(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Scan proto)
Convert a protocol buffer Scan to a client Scan
|
static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Scan |
toScan(Scan scan)
Convert a client Scan to a protocol buffer Scan
|
static ScanMetrics |
toScanMetrics(byte[] bytes) |
static org.apache.hadoop.hbase.protobuf.generated.MapReduceProtos.ScanMetrics |
toScanMetrics(ScanMetrics scanMetrics,
boolean reset) |
static List<SecurityCapability> |
toSecurityCapabilityList(List<org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SecurityCapabilitiesResponse.Capability> capabilities)
Convert SecurityCapabilitiesResponse.Capability to SecurityCapability
|
static ServerName |
toServerName(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName proto)
Convert a protocol buffer ServerName to a ServerName
|
static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName |
toServerName(ServerName serverName)
Convert a ServerName to a protocol buffer ServerName
|
static List<ServerName> |
toServerNameList(List<org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName> proto)
Convert a list of protocol buffer ServerName to a list of ServerName
|
static TableName |
toTableName(org.apache.hadoop.hbase.protobuf.generated.TableProtos.TableName tableNamePB) |
static TablePermission |
toTablePermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission proto)
Converts a Permission proto to a client TablePermission object.
|
static ThrottleType |
toThrottleType(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.ThrottleType proto)
Convert a protocol buffer ThrottleType to a client ThrottleType
|
static org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.TimedQuota |
toTimedQuota(long limit,
TimeUnit timeUnit,
QuotaScope scope)
Build a protocol buffer TimedQuota
|
static TimeUnit |
toTimeUnit(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeUnit proto)
Convert a protocol buffer TimeUnit to a client TimeUnit
|
static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> |
toToken(org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token proto)
Converts a protobuf Token message back into a Token instance.
|
static org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token |
toToken(org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> token)
Converts a Token instance (with embedded identifier) to the protobuf representation.
|
static UserPermission |
toUserPermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UserPermission proto)
Converts a user permission proto to a client user permission object.
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UserPermission |
toUserPermission(UserPermission perm)
Convert a client user permission to a user permission proto
|
static com.google.common.collect.ListMultimap<String,Permission> |
toUsersAndPermissions(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions proto) |
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions |
toUsersAndPermissions(com.google.common.collect.ListMultimap<String,Permission> perms) |
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions |
toUsersAndPermissions(String user,
Permission perms) |
static com.google.common.collect.ListMultimap<String,TablePermission> |
toUserTablePermissions(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions proto)
Convert a protobuf UserTablePermissions to a
ListMultimap<String, TablePermission> where key is username.
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions |
toUserTablePermissions(com.google.common.collect.ListMultimap<String,TablePermission> perm)
Convert a ListMultimap<String, TablePermission> where key is username
to a protobuf UserPermission
|
static void |
warmupRegion(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.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.offset - offset to start atlen - length to usebytes has PB_MAGIC for a prefix.public static void expectPBMagicPrefix(byte[] bytes)
throws DeserializationException
bytes - bytes to checkDeserializationException - if we are missing the pb magic prefixpublic static int lengthOfPBMagic()
PB_MAGICpublic static IOException getRemoteException(com.google.protobuf.ServiceException se)
se - ServiceException that wraps IO exception thrown by the serverpublic static IOException getServiceException(com.google.protobuf.ServiceException se)
se - ServiceException that wraps IO exception thrown by the serverpublic static IOException handleRemoteException(Exception e)
getRemoteException(ServiceException) but more generic, able to handle more than
just ServiceException. Prefer this method to
getRemoteException(ServiceException) because trying to
contain direct protobuf references.e - public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName toServerName(ServerName serverName)
serverName - the ServerName to converttoServerName(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName)public static ServerName toServerName(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName proto)
proto - the protocol buffer ServerName to convertpublic static List<ServerName> toServerNameList(List<org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName> proto)
proto - protocol buffer ServerNameListpublic static HTableDescriptor[] getHTableDescriptorArray(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.GetTableDescriptorsResponse proto)
proto - the GetTableDescriptorsResponsepublic static byte[][] getSplitKeysArray(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.CreateTableRequest proto)
proto - the CreateTableRequestpublic static Durability toDurability(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Durability proto)
public static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Durability toDurability(Durability d)
public static Get toGet(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Get proto) throws IOException
proto - the protocol buffer Get to convertIOExceptionpublic static Consistency toConsistency(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Consistency consistency)
public static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Consistency toConsistency(Consistency consistency)
public static Put toPut(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto) throws IOException
proto - The protocol buffer MutationProto to convertIOExceptionpublic static Put toPut(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto, CellScanner cellScanner) throws IOException
proto - The protocol buffer MutationProto to convertcellScanner - If non-null, the Cell data that goes with this proto.IOExceptionpublic static Delete toDelete(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto) throws IOException
proto - the protocol buffer Mutate to convertIOExceptionpublic static Delete toDelete(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto, CellScanner cellScanner) throws IOException
proto - the protocol buffer Mutate to convertcellScanner - if non-null, the data that goes with this delete.IOExceptionpublic static Append toAppend(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto, CellScanner cellScanner) throws IOException
cellScanner - proto - the protocol buffer Mutate to convertIOExceptionpublic static Mutation toMutation(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto) throws IOException
proto - the protocol buffer Mutate to convertIOExceptionpublic static Increment toIncrement(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto, CellScanner cellScanner) throws IOException
proto - the protocol buffer Mutate to convertIOExceptionpublic static Get toGet(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto proto, CellScanner cellScanner) throws IOException
proto - the protocol buffer Mutate to convert.cellScanner - IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Scan.ReadType toReadType(Scan.ReadType readType)
public static Scan.ReadType toReadType(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Scan.ReadType readType)
public static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Scan toScan(Scan scan) throws IOException
scan - the client Scan to convertIOExceptionpublic static Scan toScan(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Scan proto) throws IOException
proto - the protocol buffer Scan to convertIOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Cursor toCursor(Cursor cursor)
public static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Cursor toCursor(Cell cell)
public static Cursor toCursor(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Cursor cursor)
public static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Get toGet(Get get) throws IOException
get - the client GetIOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto toMutation(Increment increment, org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builder, long nonce)
increment - public static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto toMutation(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation)
throws IOException
IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto toMutation(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation,
long nonce)
throws IOException
type - mutation - IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto toMutation(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builder)
throws IOException
IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto toMutation(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builder,
long nonce)
throws IOException
IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto toMutationNoData(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builder)
throws IOException
type - mutation - builder - IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto toMutationNoData(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation)
throws IOException
type - mutation - IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto toMutationNoData(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType type,
Mutation mutation,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Builder builder,
long nonce)
throws IOException
IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result toResult(Result result)
result - the client Result to convertpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result toResult(boolean existence,
boolean stale)
existence - the client existence to sendpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result toResultNoData(Result result)
result - the client Result to convertpublic static Result toResult(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result proto)
proto - the protocol buffer Result to convertpublic static Result toResult(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result proto, CellScanner scanner) throws IOException
proto - the protocol buffer Result to convertscanner - Optional cell scanner.IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos.Comparator toComparator(ByteArrayComparable comparator)
comparator - the ByteArrayComparable to convertpublic static ByteArrayComparable toComparator(org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos.Comparator proto) throws IOException
proto - the protocol buffer Comparator to convertIOExceptionpublic static Filter toFilter(org.apache.hadoop.hbase.protobuf.generated.FilterProtos.Filter proto) throws IOException
proto - the protocol buffer Filter to convertIOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.FilterProtos.Filter toFilter(Filter filter) throws IOException
filter - the Filter to convertIOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.DeleteType toDeleteType(KeyValue.Type type) throws IOException
type - IOExceptionpublic static KeyValue.Type fromDeleteType(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.DeleteType type) throws IOException
type - The DeleteTypeIOExceptionpublic static Throwable toException(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NameBytesPair parameter) throws IOException
parameter - the protocol buffer Parameter to convertIOException - if failed to deserialize the parameter@Deprecated public static Result getRowOrBefore(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface client, byte[] regionName, byte[] row, byte[] family) throws IOException
client - regionName - row - family - IOExceptionpublic static boolean bulkLoadHFile(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface client,
List<Pair<byte[],String>> familyPaths,
byte[] regionName,
boolean assignSeqNum)
throws IOException
client - familyPaths - regionName - assignSeqNum - IOExceptionpublic static boolean bulkLoadHFile(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface client,
List<Pair<byte[],String>> familyPaths,
byte[] regionName,
boolean assignSeqNum,
List<String> clusterIds)
throws IOException
client - familyPaths - regionName - assignSeqNum - IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceResponse execService(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface client,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceCall call,
byte[] regionName)
throws IOException
IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceResponse execService(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.MasterService.BlockingInterface client,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceCall call)
throws IOException
IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceResponse execRegionServerService(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface client,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceCall call)
throws IOException
client - call - IOExceptionpublic static <T extends com.google.protobuf.Service> T newServiceStub(Class<T> service, com.google.protobuf.RpcChannel channel) throws Exception
Exceptionpublic static HRegionInfo getRegionInfo(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin, byte[] regionName) throws IOException
admin - regionName - IOExceptionpublic static void closeRegion(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin,
ServerName server,
byte[] regionName,
boolean transitionInZK)
throws IOException
admin - regionName - transitionInZK - IOExceptionpublic static boolean closeRegion(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin,
ServerName server,
byte[] regionName,
int versionOfClosingNode,
ServerName destinationServer,
boolean transitionInZK)
throws IOException
admin - regionName - versionOfClosingNode - IOExceptionpublic static void warmupRegion(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo regionInfo)
throws IOException
admin - regionInfo - IOExceptionpublic static void openRegion(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin,
ServerName server,
HRegionInfo region)
throws IOException
admin - region - IOExceptionpublic static List<HRegionInfo> getOnlineRegions(org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin) throws IOException
admin - IOExceptionpublic static List<HRegionInfo> getOnlineRegions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin) throws IOException
IOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo getServerInfo(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin)
throws IOException
IOExceptionpublic static List<String> getStoreFiles(org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin, byte[] regionName, byte[] family) throws IOException
IOExceptionpublic static List<String> getStoreFiles(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin, byte[] regionName, byte[] family) throws IOException
IOExceptionpublic static void split(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo hri,
byte[] splitPoint)
throws IOException
admin - hri - splitPoint - IOExceptionpublic static void mergeRegions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin,
HRegionInfo region_a,
HRegionInfo region_b,
boolean forcible,
User user)
throws IOException
admin - region_a - region_b - forcible - true if do a compulsory merge, otherwise we will only merge
two adjacent regionsuser - effective userIOExceptionpublic static long getTotalRequestsCount(org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad rl)
public static byte[] toDelimitedByteArray(com.google.protobuf.Message m)
throws IOException
m - Message to get delimited pb serialization of (with pb magic prefix)IOExceptionpublic static Permission toPermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission proto)
proto - the protobuf Permissionpublic static TablePermission toTablePermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission proto)
proto - the protobuf Permissionpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission toPermission(Permission perm)
perm - the client Permissionpublic static List<Permission.Action> toPermissionActions(List<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action> protoActions)
protoActions - the list of protobuf Actionspublic static Permission.Action toPermissionAction(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action action)
action - the protobuf Actionpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action toPermissionAction(Permission.Action action)
action - the client Actionpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UserPermission toUserPermission(UserPermission perm)
perm - the client UserPermissionpublic static UserPermission toUserPermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UserPermission proto)
proto - the protobuf UserPermissionpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions toUserTablePermissions(com.google.common.collect.ListMultimap<String,TablePermission> perm)
perm - the list of user and table permissionspublic static void grant(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
boolean mergeExistingPermissions,
Permission.Action... actions)
throws com.google.protobuf.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 grantedcom.google.protobuf.ServiceExceptionpublic static void grant(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
TableName tableName,
byte[] f,
byte[] q,
boolean mergeExistingPermissions,
Permission.Action... actions)
throws com.google.protobuf.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 grantedcom.google.protobuf.ServiceExceptionpublic static void grant(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
String namespace,
boolean mergeExistingPermissions,
Permission.Action... actions)
throws com.google.protobuf.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 grantedcom.google.protobuf.ServiceExceptionpublic static void revoke(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
Permission.Action... actions)
throws com.google.protobuf.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 revokedcom.google.protobuf.ServiceExceptionpublic static void revoke(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
TableName tableName,
byte[] f,
byte[] q,
Permission.Action... actions)
throws com.google.protobuf.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 revokedcom.google.protobuf.ServiceExceptionpublic static void revoke(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
String namespace,
Permission.Action... actions)
throws com.google.protobuf.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 revokedcom.google.protobuf.ServiceExceptionpublic static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol) throws com.google.protobuf.ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxycom.google.protobuf.ServiceExceptionpublic static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName t) throws com.google.protobuf.ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxyt - optional table namecom.google.protobuf.ServiceExceptionpublic static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, byte[] namespace) throws com.google.protobuf.ServiceException
It's also called by the shell, in case you want to find references.
protocol - the AccessControlService protocol proxynamespace - name of the namespacecom.google.protobuf.ServiceExceptionpublic static com.google.common.collect.ListMultimap<String,TablePermission> toUserTablePermissions(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions proto)
proto - the protobuf UserPermissionpublic static org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token toToken(org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> token)
token - the Token instance to copypublic static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> toToken(org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token proto)
proto - the protobuf Token messagepublic static String getRegionEncodedName(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier regionSpecifier) throws DoNotRetryIOException
regionSpecifier - the region specifierDoNotRetryIOException - if the specifier type is unsupportedpublic static ScanMetrics toScanMetrics(byte[] bytes)
public static org.apache.hadoop.hbase.protobuf.generated.MapReduceProtos.ScanMetrics toScanMetrics(ScanMetrics scanMetrics, boolean reset)
public static void toIOException(com.google.protobuf.ServiceException se)
throws IOException
se - the ServiceException instance to convert into an IOExceptionIOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.CellProtos.Cell toCell(Cell kv)
public static Cell toCell(org.apache.hadoop.hbase.protobuf.generated.CellProtos.Cell cell)
public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NamespaceDescriptor toProtoNamespaceDescriptor(NamespaceDescriptor ns)
public static NamespaceDescriptor toNamespaceDescriptor(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NamespaceDescriptor desc) throws IOException
IOExceptionpublic static <T extends com.google.protobuf.Message> T getParsedGenericInstance(Class<?> runtimeClass, int position, com.google.protobuf.ByteString b) throws 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 createdIOExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.WALProtos.CompactionDescriptor toCompactionDescriptor(HRegionInfo info, byte[] family, List<org.apache.hadoop.fs.Path> inputPaths, List<org.apache.hadoop.fs.Path> outputPaths, org.apache.hadoop.fs.Path storeDir)
public static org.apache.hadoop.hbase.protobuf.generated.WALProtos.CompactionDescriptor toCompactionDescriptor(HRegionInfo info, byte[] regionName, byte[] family, List<org.apache.hadoop.fs.Path> inputPaths, List<org.apache.hadoop.fs.Path> outputPaths, org.apache.hadoop.fs.Path storeDir)
public static org.apache.hadoop.hbase.protobuf.generated.WALProtos.FlushDescriptor toFlushDescriptor(org.apache.hadoop.hbase.protobuf.generated.WALProtos.FlushDescriptor.FlushAction action,
HRegionInfo hri,
long flushSeqId,
Map<byte[],List<org.apache.hadoop.fs.Path>> committedFiles)
public static org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor toRegionEventDescriptor(org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor.EventType eventType,
HRegionInfo hri,
long seqId,
ServerName server,
Map<byte[],List<org.apache.hadoop.fs.Path>> storeFiles)
public static org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor toRegionEventDescriptor(org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor.EventType eventType,
byte[] tableNameAsBytes,
byte[] encodedNameAsBytes,
byte[] regionNameAsBytes,
long seqId,
ServerName server,
Map<byte[],List<org.apache.hadoop.fs.Path>> storeFiles)
public static String getShortTextFormat(com.google.protobuf.Message m)
m - mpublic static TableName toTableName(org.apache.hadoop.hbase.protobuf.generated.TableProtos.TableName tableNamePB)
public static org.apache.hadoop.hbase.protobuf.generated.TableProtos.TableName toProtoTableName(TableName tableName)
public static TableName[] getTableNameArray(List<org.apache.hadoop.hbase.protobuf.generated.TableProtos.TableName> tableNamesList)
public static CellVisibility toCellVisibility(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CellVisibility proto)
proto - public static CellVisibility toCellVisibility(byte[] protoBytes) throws DeserializationException
protoBytes - DeserializationExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CellVisibility toCellVisibility(CellVisibility cellVisibility)
cellVisibility - public static Authorizations toAuthorizations(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Authorizations proto)
proto - public static Authorizations toAuthorizations(byte[] protoBytes) throws DeserializationException
protoBytes - DeserializationExceptionpublic static org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Authorizations toAuthorizations(Authorizations authorizations)
authorizations - public static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions toUsersAndPermissions(String user, Permission perms)
public static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions toUsersAndPermissions(com.google.common.collect.ListMultimap<String,Permission> perms)
public static com.google.common.collect.ListMultimap<String,Permission> toUsersAndPermissions(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions proto)
public static TimeUnit toTimeUnit(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeUnit proto)
proto - public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeUnit toProtoTimeUnit(TimeUnit timeUnit)
timeUnit - public static ThrottleType toThrottleType(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.ThrottleType proto)
proto - public static org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.ThrottleType toProtoThrottleType(ThrottleType type)
type - public static QuotaScope toQuotaScope(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.QuotaScope proto)
proto - public static org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.QuotaScope toProtoQuotaScope(QuotaScope scope)
scope - public static QuotaType toQuotaScope(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.QuotaType proto)
proto - public static org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.QuotaType toProtoQuotaScope(QuotaType type)
type - public static org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.TimedQuota toTimedQuota(long limit,
TimeUnit timeUnit,
QuotaScope scope)
limit - the allowed number of request/data per timeUnittimeUnit - the limit time unitscope - the quota scopepublic static org.apache.hadoop.hbase.protobuf.generated.WALProtos.BulkLoadDescriptor toBulkLoadDescriptor(TableName tableName, com.google.protobuf.ByteString encodedRegionName, Map<byte[],List<org.apache.hadoop.fs.Path>> storeFiles, Map<String,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 org.apache.hadoop.hbase.protobuf.generated.WALProtos.BulkLoadDescriptor toBulkLoadDescriptor(TableName tableName, com.google.protobuf.ByteString encodedRegionName, Map<byte[],List<org.apache.hadoop.fs.Path>> storeFiles, Map<String,Long> storeFilesSize, long bulkloadSeqId, List<String> clusterIds)
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 nameclusterIds - The list of cluster Ids with the clusters where the bulk even had
already been processed.public static void mergeDelimitedFrom(com.google.protobuf.Message.Builder builder,
InputStream in)
throws IOException
builder - current message builderin - Inputsream with delimited protobuf dataIOExceptionpublic static void mergeFrom(com.google.protobuf.Message.Builder builder,
InputStream in,
int size)
throws IOException
builder - current message builderin - InputStream containing protobuf datasize - known size of protobuf dataIOExceptionpublic static void mergeFrom(com.google.protobuf.Message.Builder builder,
InputStream in)
throws IOException
builder - current message builderin - InputStream containing protobuf dataIOExceptionpublic static void mergeFrom(com.google.protobuf.Message.Builder builder,
com.google.protobuf.ByteString bs)
throws IOException
builder - current message builderbs - ByteString containing theIOExceptionpublic static void mergeFrom(com.google.protobuf.Message.Builder builder,
byte[] b)
throws IOException
builder - current message builderb - byte arrayIOExceptionpublic static void mergeFrom(com.google.protobuf.Message.Builder builder,
byte[] b,
int offset,
int length)
throws IOException
builder - current message builderb - byte arrayoffset - length - IOExceptionpublic static void mergeFrom(com.google.protobuf.Message.Builder builder,
com.google.protobuf.CodedInputStream codedInput,
int length)
throws IOException
IOExceptionpublic static ReplicationLoadSink toReplicationLoadSink(org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.ReplicationLoadSink cls)
public static ReplicationLoadSource toReplicationLoadSource(org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.ReplicationLoadSource cls)
public static List<ReplicationLoadSource> toReplicationLoadSourceList(List<org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.ReplicationLoadSource> clsList)
public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.VersionInfo getVersionInfo()
public static List<SecurityCapability> toSecurityCapabilityList(List<org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SecurityCapabilitiesResponse.Capability> capabilities)
capabilities - capabilities returned in the SecurityCapabilitiesResponse messagepublic static byte[] toCompactionEventTrackerBytes(Set<String> storeFiles)
public static Set<String> toCompactedStoreFiles(byte[] bytes) throws IOException
IOExceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.