@InterfaceAudience.Private public final class ProtobufUtil extends Object
public static boolean isClassLoaderLoaded()
public static byte[] prependPBMagic(byte[] bytes)
ProtobufMagic.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 ProtobufMagic.PB_MAGIC
.length.public static boolean isPBMagicPrefix(byte[] bytes)
bytes
- Bytes to check.bytes
has ProtobufMagic.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 ProtobufMagic.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()
ProtobufMagic.lengthOfPBMagic()
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ComparatorProtos.ByteArrayComparable toByteArrayComparable(byte[] value)
public static IOException getRemoteException(org.apache.hbase.thirdparty.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.shaded.protobuf.generated.HBaseProtos.ServerName toServerName(ServerName serverName)
serverName
- the ServerName to converttoServerName(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName)
public static ServerName toServerName(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName proto)
proto
- the protocol buffer ServerName to convertpublic static List<ServerName> toServerNameList(List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName> proto)
proto
- protocol buffer ServerNameListpublic static List<NamespaceDescriptor> toNamespaceDescriptorList(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListNamespaceDescriptorsResponse proto)
proto
- the ListNamespaceDescriptorsResponsepublic static List<TableDescriptor> toTableDescriptorList(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetTableDescriptorsResponse proto)
proto
- the GetTableDescriptorsResponsepublic static List<TableDescriptor> toTableDescriptorList(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListTableDescriptorsByNamespaceResponse proto)
proto
- the ListTableDescriptorsByNamespaceResponsepublic static byte[][] getSplitKeysArray(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.CreateTableRequest proto)
proto
- the CreateTableRequestpublic static Durability toDurability(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.Durability proto)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.Durability toDurability(Durability d)
public static Get toGet(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Get proto) throws IOException
proto
- the protocol buffer Get to convertIOException
public static Consistency toConsistency(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Consistency consistency)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Consistency toConsistency(Consistency consistency)
public static Put toPut(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto proto) throws IOException
proto
- The protocol buffer MutationProto to convertIOException
public static Put toPut(org.apache.hadoop.hbase.shaded.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.IOException
public static Delete toDelete(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto proto) throws IOException
proto
- the protocol buffer Mutate to convertIOException
public static Delete toDelete(org.apache.hadoop.hbase.shaded.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.IOException
public static Append toAppend(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto proto, CellScanner cellScanner) throws IOException
cellScanner
- proto
- the protocol buffer Mutate to convertIOException
public static Increment toIncrement(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto proto, CellScanner cellScanner) throws IOException
proto
- the protocol buffer Mutate to convertIOException
public static Mutation toMutation(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto proto) throws IOException
proto
- the protocol buffer Mutate to convertIOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Scan.ReadType toReadType(Scan.ReadType readType)
public static Scan.ReadType toReadType(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Scan.ReadType readType)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Scan toScan(Scan scan) throws IOException
scan
- the client Scan to convertIOException
public static Scan toScan(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Scan proto) throws IOException
proto
- the protocol buffer Scan to convertIOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Cursor toCursor(Cursor cursor)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Cursor toCursor(Cell cell)
public static Cursor toCursor(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Cursor cursor)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Get toGet(Get get) throws IOException
get
- the client GetIOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto toMutation(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.MutationType type, Mutation mutation) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto toMutation(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.MutationType type, Mutation mutation, long nonce) throws IOException
type
- mutation
- IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto toMutation(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.MutationType type, Mutation mutation, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.Builder builder) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto toMutation(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.MutationType type, Mutation mutation, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.Builder builder, long nonce) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto toMutationNoData(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.MutationType type, Mutation mutation, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.Builder builder) throws IOException
type
- mutation
- builder
- IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto toMutationNoData(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.MutationType type, Mutation mutation) throws IOException
type
- mutation
- IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto toMutationNoData(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.MutationType type, Mutation mutation, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.Builder builder, long nonce) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Result toResult(Result result)
result
- the client Result to convertpublic static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Result toResult(Result result, boolean encodeTags)
result
- the client Result to convertencodeTags
- whether to includeTags in converted protobuf result or not
When @encodeTags is set to true, it will return all the tags in the response.
These tags may contain some sensitive data like acl permissions, etc.
Only the tools like Export, Import which needs to take backup needs to set
it to true so that cell tags are persisted in backup.
Refer to HBASE-25246 for more context.public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Result toResult(boolean existence, boolean stale)
existence
- the client existence to sendpublic static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Result toResultNoData(Result result)
result
- the client Result to convertpublic static Result toResult(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Result proto)
proto
- the protocol buffer Result to convertpublic static Result toResult(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Result proto, boolean decodeTags)
proto
- the protocol buffer Result to convertdecodeTags
- whether to decode tags into converted client Result
When @decodeTags is set to true, it will decode all the tags from the
response. These tags may contain some sensitive data like acl permissions,
etc. Only the tools like Export, Import which needs to take backup needs to
set it to true so that cell tags are persisted in backup.
Refer to HBASE-25246 for more context.public static Result toResult(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Result proto, CellScanner scanner) throws IOException
proto
- the protocol buffer Result to convertscanner
- Optional cell scanner.IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ComparatorProtos.Comparator toComparator(ByteArrayComparable comparator)
comparator
- the ByteArrayComparable to convertpublic static ByteArrayComparable toComparator(org.apache.hadoop.hbase.shaded.protobuf.generated.ComparatorProtos.Comparator proto) throws IOException
proto
- the protocol buffer Comparator to convertIOException
public static Filter toFilter(org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos.Filter proto) throws IOException
proto
- the protocol buffer Filter to convertIOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos.Filter toFilter(Filter filter) throws IOException
filter
- the Filter to convertIOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.DeleteType toDeleteType(KeyValue.Type type) throws IOException
type
- IOException
public static KeyValue.Type fromDeleteType(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto.DeleteType type) throws IOException
type
- The DeleteTypeIOException
public static Throwable toException(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameBytesPair parameter) throws IOException
parameter
- the protocol buffer Parameter to convertIOException
- if failed to deserialize the parameterpublic static <T extends org.apache.hbase.thirdparty.com.google.protobuf.Service> T newServiceStub(Class<T> service, org.apache.hbase.thirdparty.com.google.protobuf.RpcChannel channel) throws Exception
Exception
public static RegionInfo getRegionInfo(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin, byte[] regionName) throws IOException
IOException
public static List<RegionLoad> getRegionLoadInfo(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionLoadResponse regionLoadResponse)
public static void closeRegion(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin, ServerName server, byte[] regionName) throws IOException
admin
- regionName
- IOException
public static void warmupRegion(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin, RegionInfo regionInfo) throws IOException
admin
- regionInfo
- IOException
public static void openRegion(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin, ServerName server, RegionInfo region) throws IOException
admin
- region
- IOException
public static List<RegionInfo> getOnlineRegions(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin) throws IOException
admin
- IOException
public static List<RegionInfo> getOnlineRegions(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin) throws IOException
IOException
public static List<RegionInfo> getRegionInfos(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetOnlineRegionResponse proto)
proto
- the GetOnlineRegionResponseproto
is nullpublic static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ServerInfo getServerInfo(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin) throws IOException
IOException
public static List<String> getStoreFiles(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin, byte[] regionName, byte[] family) throws IOException
IOException
public static List<String> getStoreFiles(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin, byte[] regionName, byte[] family) throws IOException
IOException
public static long getTotalRequestsCount(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad rl)
public static byte[] toDelimitedByteArray(org.apache.hbase.thirdparty.com.google.protobuf.Message m) throws IOException
m
- Message to get delimited pb serialization of (with pb magic prefix)IOException
public static String getRegionEncodedName(org.apache.hadoop.hbase.shaded.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.shaded.protobuf.generated.MapReduceProtos.ScanMetrics toScanMetrics(ScanMetrics scanMetrics, boolean reset)
public static void toIOException(org.apache.hbase.thirdparty.com.google.protobuf.ServiceException se) throws IOException
se
- the ServiceException
instance to convert into an IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.CellProtos.Cell toCell(Cell kv, boolean encodeTags)
public static Cell toCell(ExtendedCellBuilder cellBuilder, org.apache.hadoop.hbase.shaded.protobuf.generated.CellProtos.Cell cell, boolean decodeTags)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NamespaceDescriptor toProtoNamespaceDescriptor(NamespaceDescriptor ns)
public static NamespaceDescriptor toNamespaceDescriptor(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NamespaceDescriptor desc)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.CompactionDescriptor toCompactionDescriptor(RegionInfo 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.shaded.protobuf.generated.WALProtos.CompactionDescriptor toCompactionDescriptor(RegionInfo 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.shaded.protobuf.generated.WALProtos.FlushDescriptor toFlushDescriptor(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor.FlushAction action, RegionInfo hri, long flushSeqId, Map<byte[],List<org.apache.hadoop.fs.Path>> committedFiles)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.RegionEventDescriptor toRegionEventDescriptor(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.RegionEventDescriptor.EventType eventType, RegionInfo hri, long seqId, ServerName server, Map<byte[],List<org.apache.hadoop.fs.Path>> storeFiles)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.RegionEventDescriptor toRegionEventDescriptor(org.apache.hadoop.hbase.shaded.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(org.apache.hbase.thirdparty.com.google.protobuf.Message m)
m
- m
public static SlowLogParams getSlowLogParams(org.apache.hbase.thirdparty.com.google.protobuf.Message message)
message
- Message object Message
public static TableName toTableName(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName tableNamePB)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName toProtoTableName(TableName tableName)
public static List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName> toProtoTableNameList(List<TableName> tableNameList)
public static List<TableName> toTableNameList(List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName> tableNamesList)
public static TableName[] getTableNameArray(List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName> tableNamesList)
public static CellVisibility toCellVisibility(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CellVisibility proto)
proto
- public static CellVisibility toCellVisibility(byte[] protoBytes) throws DeserializationException
protoBytes
- DeserializationException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CellVisibility toCellVisibility(CellVisibility cellVisibility)
cellVisibility
- public static Authorizations toAuthorizations(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Authorizations proto)
proto
- public static Authorizations toAuthorizations(byte[] protoBytes) throws DeserializationException
protoBytes
- DeserializationException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Authorizations toAuthorizations(Authorizations authorizations)
authorizations
- public static TimeUnit toTimeUnit(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TimeUnit proto)
proto
- public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TimeUnit toProtoTimeUnit(TimeUnit timeUnit)
timeUnit
- public static ThrottleType toThrottleType(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleType proto)
proto
- public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleType toProtoThrottleType(ThrottleType type)
type
- public static QuotaScope toQuotaScope(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.QuotaScope proto)
proto
- public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.QuotaScope toProtoQuotaScope(QuotaScope scope)
scope
- public static QuotaType toQuotaScope(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.QuotaType proto)
proto
- public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.QuotaType toProtoQuotaScope(QuotaType type)
type
- public static SpaceViolationPolicy toViolationPolicy(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceViolationPolicy proto)
proto
- The protocol buffer space violation policy.public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceViolationPolicy toProtoViolationPolicy(SpaceViolationPolicy policy)
policy
- The client SpaceViolationPolicy object.public static org.apache.hadoop.hbase.shaded.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.shaded.protobuf.generated.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 org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.BulkLoadDescriptor toBulkLoadDescriptor(TableName tableName, org.apache.hbase.thirdparty.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.shaded.protobuf.generated.WALProtos.BulkLoadDescriptor toBulkLoadDescriptor(TableName tableName, org.apache.hbase.thirdparty.com.google.protobuf.ByteString encodedRegionName, Map<byte[],List<org.apache.hadoop.fs.Path>> storeFiles, Map<String,Long> storeFilesSize, long bulkloadSeqId, List<String> clusterIds, boolean replicate)
public static void mergeDelimitedFrom(org.apache.hbase.thirdparty.com.google.protobuf.Message.Builder builder, InputStream in) throws IOException
builder
- current message builderin
- Inputsream with delimited protobuf dataIOException
public static void mergeFrom(org.apache.hbase.thirdparty.com.google.protobuf.Message.Builder builder, InputStream in, int size) throws IOException
builder
- current message builderin
- InputStream containing protobuf datasize
- known size of protobuf dataIOException
public static void mergeFrom(org.apache.hbase.thirdparty.com.google.protobuf.Message.Builder builder, InputStream in) throws IOException
builder
- current message builderin
- InputStream containing protobuf dataIOException
public static void mergeFrom(org.apache.hbase.thirdparty.com.google.protobuf.Message.Builder builder, org.apache.hbase.thirdparty.com.google.protobuf.ByteString bs) throws IOException
builder
- current message builderbs
- ByteString containing theIOException
public static void mergeFrom(org.apache.hbase.thirdparty.com.google.protobuf.Message.Builder builder, byte[] b) throws IOException
builder
- current message builderb
- byte arrayIOException
public static void mergeFrom(org.apache.hbase.thirdparty.com.google.protobuf.Message.Builder builder, byte[] b, int offset, int length) throws IOException
builder
- current message builderb
- byte arrayoffset
- length
- IOException
public static void mergeFrom(org.apache.hbase.thirdparty.com.google.protobuf.Message.Builder builder, org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream codedInput, int length) throws IOException
IOException
public static ReplicationLoadSink toReplicationLoadSink(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.ReplicationLoadSink rls)
public static ReplicationLoadSource toReplicationLoadSource(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.ReplicationLoadSource rls)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo getVersionInfo()
public static List<SecurityCapability> toSecurityCapabilityList(List<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SecurityCapabilitiesResponse.Capability> capabilities)
capabilities
- capabilities returned in the SecurityCapabilitiesResponse messagepublic static TimeRange toTimeRange(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TimeRange timeRange)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ColumnFamilySchema toColumnFamilySchema(ColumnFamilyDescriptor hcd)
hcd
- the ColumnFamilySchemapublic static ColumnFamilyDescriptor toColumnFamilyDescriptor(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ColumnFamilySchema cfs)
cfs
- the ColumnFamilySchemaColumnFamilyDescriptor
made from the passed in cfs
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableSchema toTableSchema(TableDescriptor htd)
htd
- the TableDescriptorTableDescriptor
into a pb TableSchema instance.public static TableDescriptor toTableDescriptor(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableSchema ts)
ts
- A pb TableSchema instance.TableDescriptor
made from the passed in pb ts
.public static CompactionState createCompactionState(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState state)
CompactionState
from
AdminProtos.GetRegionInfoResponse.CompactionState
statestate
- the protobuf CompactionStatepublic static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState createCompactionState(CompactionState state)
public static CompactionState createCompactionStateForRegionLoad(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad.CompactionState state)
CompactionState
from
.RegionLoad.CompactionState
statestate
- the protobuf CompactionStatepublic static org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad.CompactionState createCompactionStateForRegionLoad(CompactionState state)
public static Optional<Long> toOptionalTimestamp(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MajorCompactionTimestampResponse resp)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription.Type createProtosSnapShotDescType(SnapshotType type)
HBaseProtos.SnapshotDescription.Type
from SnapshotType
type
- the SnapshotDescription typepublic static org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription.Type createProtosSnapShotDescType(String snapshotDesc)
HBaseProtos.SnapshotDescription.Type
from the type of SnapshotDescription stringsnapshotDesc
- string representing the snapshot description typepublic static SnapshotType createSnapshotType(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription.Type type)
SnapshotType
from the type of
HBaseProtos.SnapshotDescription
type
- the snapshot description typepublic static org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription createHBaseProtosSnapshotDesc(SnapshotDescription snapshotDesc)
SnapshotDescription
to
HBaseProtos.SnapshotDescription
snapshotDesc
- the POJO SnapshotDescriptionpublic static SnapshotDescription createSnapshotDesc(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshotDesc)
HBaseProtos.SnapshotDescription
to
SnapshotDescription
snapshotDesc
- the protobuf SnapshotDescriptionpublic static RegionLoadStats createRegionLoadStats(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.RegionLoadStats stats)
public static String toText(org.apache.hbase.thirdparty.com.google.protobuf.Message msg)
msg
- msg
public static byte[] toBytes(org.apache.hbase.thirdparty.com.google.protobuf.ByteString bs)
public static <T> T call(Callable<T> callable) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetStoreFileRequest buildGetStoreFileRequest(byte[] regionName, byte[] family)
regionName
- the name of the region to get infofamily
- the family to get store file listpublic static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionRequest buildCloseRegionRequest(ServerName server, byte[] regionName)
regionName
- the name of the region to closepublic static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionRequest buildCloseRegionRequest(ServerName server, byte[] regionName, ServerName destinationServer)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionRequest buildCloseRegionRequest(ServerName server, byte[] regionName, ServerName destinationServer, long closeProcId)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription buildProcedureDescription(String signature, String instance, Map<String,String> props)
public static RegionState parseMetaRegionStateFrom(byte[] data, int replicaId) throws DeserializationException
data
- protobuf serialized data with meta server name.replicaId
- replica ID for this regionDeserializationException
- if the data is invalid.public static ServerName parseServerNameFrom(byte[] data) throws DeserializationException
data
- Data with a serialize server name in it; can handle the old style
servername where servername was host and port. Works too with data that
begins w/ the pb 'PBUF' magic and that is then followed by a protobuf that
has a serialized ServerName
in it.data
is null else converts passed data
to a ServerName instance.DeserializationException
public static String toProcedureJson(List<org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure> procProtos)
public static String toLockJson(List<org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockedResource> lockedResourceProtos)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionInfo toRegionInfo(RegionInfo info)
info
- the RegionInfo to convertpublic static RegionInfo toRegionInfo(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionInfo proto)
proto
- the RegionInfo to convertpublic static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionLocation toRegionLocation(HRegionLocation loc)
public static HRegionLocation toRegionLocation(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionLocation proto)
public static List<SnapshotDescription> toSnapshotDescriptionList(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetCompletedSnapshotsResponse response, Pattern pattern)
public static CacheEvictionStats toCacheEvictionStats(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.CacheEvictionStats stats) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.CacheEvictionStats toCacheEvictionStats(CacheEvictionStats cacheEvictionStats)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.ReplicationLoadSource toReplicationLoadSource(ReplicationLoadSource rls)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.ReplicationLoadSink toReplicationLoadSink(ReplicationLoadSink rls)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TimeRange toTimeRange(TimeRange timeRange)
public static byte[] toCompactionEventTrackerBytes(Set<String> storeFiles)
public static Set<String> toCompactedStoreFiles(byte[] bytes) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionStatesCount toTableRegionStatesCount(RegionStatesCount regionStatesCount)
public static RegionStatesCount toTableRegionStatesCount(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionStatesCount regionStatesCount)
public static List<LogEntry> toSlowLogPayloads(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LogEntry logEntry)
OnlineLogRecord
logEntry
- slowlog response protobuf instancepublic static boolean toClearSlowLogPayload(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearSlowLogResponses clearSlowLogResponses)
AdminProtos.ClearSlowLogResponses
to booleanclearSlowLogResponses
- Clear slowlog response protobuf instancepublic static CheckAndMutate toCheckAndMutate(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Condition condition, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MutationProto mutation, CellScanner cellScanner) throws IOException
IOException
public static CheckAndMutate toCheckAndMutate(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Condition condition, List<Mutation> mutations) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Condition toCondition(byte[] row, byte[] family, byte[] qualifier, CompareOperator op, byte[] value, Filter filter, TimeRange timeRange) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Condition toCondition(byte[] row, Filter filter, TimeRange timeRange) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Condition toCondition(byte[] row, byte[] family, byte[] qualifier, CompareOperator op, byte[] value, TimeRange timeRange) throws IOException
IOException
public static List<LogEntry> toBalancerDecisionResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LogEntry logEntry)
public static List<LogEntry> toBalancerRejectionResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LogEntry logEntry)
public static List<LogEntry> getBalancerDecisionEntries(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.BalancerDecisionsResponse response)
public static List<LogEntry> getBalancerRejectionEntries(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.BalancerRejectionsResponse response)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LogRequest toBalancerDecisionRequest(int limit)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LogRequest toBalancerRejectionRequest(int limit)
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.