程序包 | 说明 |
---|---|
org.apache.hadoop.hbase | |
org.apache.hadoop.hbase.client |
Provides HBase Client
Table of Contents
Overview
Example API Usage
Overview
To administer HBase, create and drop tables, list and alter tables,
use
Admin . |
org.apache.hadoop.hbase.master | |
org.apache.hadoop.hbase.protobuf |
Holds classes generated from protobuf
src/main/protobuf definition files. |
org.apache.hadoop.hbase.zookeeper |
限定符和类型 | 字段和说明 |
---|---|
static HRegionInfo |
HRegionInfo.FIRST_META_REGIONINFO
HRegionInfo for first meta region
|
限定符和类型 | 方法和说明 |
---|---|
static HRegionInfo |
HRegionInfo.convert(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionInfo proto)
Convert a RegionInfo to a HRegionInfo
|
static HRegionInfo |
MetaTableAccessor.getHRegionInfo(Result data)
Returns HRegionInfo object from the column
HConstants.CATALOG_FAMILY:HConstants.REGIONINFO_QUALIFIER of the catalog
table Result.
|
static HRegionInfo |
HRegionInfo.getHRegionInfo(Result data)
已过时。
use MetaTableAccessor methods for interacting with meta layouts
|
static HRegionInfo |
HRegionInfo.getHRegionInfo(Result r,
byte[] qualifier)
已过时。
use MetaTableAccessor methods for interacting with meta layouts
|
HRegionInfo |
HRegionLocation.getRegionInfo() |
static HRegionInfo |
HRegionInfo.parseFrom(byte[] bytes) |
static HRegionInfo |
HRegionInfo.parseFrom(byte[] bytes,
int offset,
int len) |
static HRegionInfo |
HRegionInfo.parseFrom(DataInputStream in)
Parses an HRegionInfo instance from the passed in stream.
|
static HRegionInfo |
HRegionInfo.parseFromOrNull(byte[] bytes) |
static HRegionInfo |
HRegionInfo.parseFromOrNull(byte[] bytes,
int offset,
int len) |
protected static HRegionInfo |
MetaTableAccessor.parseRegionInfoFromRegionName(byte[] regionName)
Returns an HRI parsed from this regionName.
|
限定符和类型 | 方法和说明 |
---|---|
static PairOfSameType<HRegionInfo> |
MetaTableAccessor.getDaughterRegions(Result data)
Returns the daughter regions by reading the corresponding columns of the catalog table
Result.
|
static PairOfSameType<HRegionInfo> |
HRegionInfo.getDaughterRegions(Result data)
已过时。
use MetaTableAccessor methods for interacting with meta layouts
|
static Pair<HRegionInfo,ServerName> |
HRegionInfo.getHRegionInfoAndServerName(Result r)
已过时。
use MetaTableAccessor methods for interacting with meta layouts
|
static PairOfSameType<HRegionInfo> |
MetaTableAccessor.getMergeRegions(Result data)
Returns the merge regions by reading the corresponding columns of the catalog table
Result.
|
static PairOfSameType<HRegionInfo> |
HRegionInfo.getMergeRegions(Result data)
已过时。
use MetaTableAccessor methods for interacting with meta layouts
|
static Pair<HRegionInfo,ServerName> |
MetaTableAccessor.getRegion(Connection connection,
byte[] regionName)
已过时。
|
static Pair<HRegionInfo,HRegionInfo> |
MetaTableAccessor.getRegionsFromMergeQualifier(Connection connection,
byte[] regionName)
Get regions from the merge qualifier of the specified merged region
|
static Pair<HRegionInfo,HRegionInfo> |
MetaTableAccessor.getRegionsFromMergeQualifier(Connection connection,
byte[] regionName)
Get regions from the merge qualifier of the specified merged region
|
static NavigableMap<HRegionInfo,Result> |
MetaTableAccessor.getServerUserRegions(Connection connection,
ServerName serverName) |
static List<HRegionInfo> |
MetaTableAccessor.getTableRegions(ZooKeeperWatcher zkw,
Connection connection,
TableName tableName)
Gets all of the regions of the specified table.
|
static List<HRegionInfo> |
MetaTableAccessor.getTableRegions(ZooKeeperWatcher zkw,
Connection connection,
TableName tableName,
boolean excludeOfflinedSplitParents)
Gets all of the regions of the specified table.
|
static List<HRegionInfo> |
MetaTableAccessor.getTableRegions(ZooKeeperWatcher zkw,
Connection connection,
TableName tableName,
boolean excludeOfflinedSplitParents,
boolean excludeReplicaRegions)
Gets all of the regions of the specified table.
|
static List<Pair<HRegionInfo,ServerName>> |
MetaTableAccessor.getTableRegionsAndLocations(ZooKeeperWatcher zkw,
Connection connection,
TableName tableName) |
static List<Pair<HRegionInfo,ServerName>> |
MetaTableAccessor.getTableRegionsAndLocations(ZooKeeperWatcher zkw,
Connection connection,
TableName tableName,
boolean excludeOfflinedSplitParents) |
static List<Pair<HRegionInfo,ServerName>> |
MetaTableAccessor.getTableRegionsAndLocations(ZooKeeperWatcher zkw,
Connection connection,
TableName tableName,
boolean excludeOfflinedSplitParents,
boolean excludeReplicaRegions) |
static List<HRegionInfo> |
HRegionInfo.parseDelimitedFrom(byte[] bytes,
int offset,
int length)
Parses all the HRegionInfo instances from the passed in stream until EOF.
|
限定符和类型 | 方法和说明 |
---|---|
static void |
MetaTableAccessor.addDaughter(Connection connection,
HRegionInfo regionInfo,
ServerName sn,
long openSeqNum)
Adds a daughter region entry to meta.
|
static Put |
MetaTableAccessor.addDaughtersToPut(Put put,
HRegionInfo splitA,
HRegionInfo splitB)
Adds split daughters to the Put
|
static void |
MetaTableAccessor.addRegionToMeta(Connection connection,
HRegionInfo regionInfo)
Adds a hbase:meta row for the specified new region.
|
static void |
MetaTableAccessor.addRegionToMeta(Connection connection,
HRegionInfo regionInfo,
HRegionInfo splitA,
HRegionInfo splitB)
Adds a (single) hbase:meta row for the specified new region and its daughters.
|
static void |
MetaTableAccessor.addRegionToMeta(Table meta,
HRegionInfo regionInfo)
Adds a hbase:meta row for the specified new region to the given catalog table.
|
static void |
MetaTableAccessor.addRegionToMeta(Table meta,
HRegionInfo regionInfo,
HRegionInfo splitA,
HRegionInfo splitB)
Adds a (single) hbase:meta row for the specified new region and its daughters.
|
static boolean |
HRegionInfo.areAdjacent(HRegionInfo regionA,
HRegionInfo regionB)
Check whether two regions are adjacent
|
int |
HRegionInfo.compareTo(HRegionInfo o) |
static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionInfo |
HRegionInfo.convert(HRegionInfo info)
Convert a HRegionInfo to a RegionInfo
|
static void |
MetaTableAccessor.deleteMergeQualifiers(Connection connection,
HRegionInfo mergedRegion)
Deletes merge qualifiers for the specified merged region.
|
static void |
MetaTableAccessor.deleteRegion(Connection connection,
HRegionInfo regionInfo)
Deletes the specified region from META.
|
static byte[] |
MetaTableAccessor.getMetaKeyForRegion(HRegionInfo regionInfo)
Returns the row key to use for this regionInfo
|
static HRegionLocation |
MetaTableAccessor.getRegionLocation(Connection connection,
HRegionInfo regionInfo)
Returns the HRegionLocation from meta for the given region
|
static String |
HRegionInfo.getRegionNameAsString(HRegionInfo ri,
byte[] regionName) |
static Delete |
MetaTableAccessor.makeDeleteFromRegionInfo(HRegionInfo regionInfo)
Generates and returns a Delete containing the region info for the catalog
table
|
static Delete |
MetaTableAccessor.makeDeleteFromRegionInfo(HRegionInfo regionInfo,
long ts)
Generates and returns a Delete containing the region info for the catalog
table
|
static Put |
MetaTableAccessor.makePutFromRegionInfo(HRegionInfo regionInfo)
Generates and returns a Put containing the region into for the catalog table
|
static Put |
MetaTableAccessor.makePutFromRegionInfo(HRegionInfo regionInfo,
long ts)
Generates and returns a Put containing the region into for the catalog table
|
static void |
MetaTableAccessor.mergeRegions(Connection connection,
HRegionInfo mergedRegion,
HRegionInfo regionA,
HRegionInfo regionB,
ServerName sn,
int regionReplication,
long masterSystemTime)
Merge the two regions into one in an atomic operation.
|
static void |
MetaTableAccessor.splitRegion(Connection connection,
HRegionInfo parent,
HRegionInfo splitA,
HRegionInfo splitB,
ServerName sn,
int regionReplication)
Splits the region into two in an atomic operation.
|
static byte[] |
HRegionInfo.toDelimitedByteArray(HRegionInfo... infos)
Serializes given HRegionInfo's as a byte array.
|
static void |
MetaTableAccessor.updateRegionLocation(Connection connection,
HRegionInfo regionInfo,
ServerName sn,
long openSeqNum,
long masterSystemTime)
Updates the location of the specified region in hbase:meta to be the specified
server hostname and startcode.
|
限定符和类型 | 方法和说明 |
---|---|
static void |
MetaTableAccessor.addRegionsToMeta(Connection connection,
List<HRegionInfo> regionInfos,
int regionReplication)
Adds a hbase:meta row for each of the specified new regions.
|
static void |
MetaTableAccessor.addRegionsToMeta(Connection connection,
List<HRegionInfo> regionInfos,
int regionReplication,
long ts)
Adds a hbase:meta row for each of the specified new regions.
|
static void |
MetaTableAccessor.deleteRegions(Connection connection,
List<HRegionInfo> regionsInfo)
Deletes the specified regions from META.
|
static void |
MetaTableAccessor.deleteRegions(Connection connection,
List<HRegionInfo> regionsInfo,
long ts)
Deletes the specified regions from META.
|
static void |
MetaTableAccessor.mutateRegions(Connection connection,
List<HRegionInfo> regionsToRemove,
List<HRegionInfo> regionsToAdd)
Adds and Removes the specified regions from hbase:meta
|
static void |
MetaTableAccessor.mutateRegions(Connection connection,
List<HRegionInfo> regionsToRemove,
List<HRegionInfo> regionsToAdd)
Adds and Removes the specified regions from hbase:meta
|
static void |
MetaTableAccessor.overwriteRegions(Connection connection,
List<HRegionInfo> regionInfos,
int regionReplication)
Overwrites the specified regions from hbase:meta
|
构造器和说明 |
---|
HRegionInfo(HRegionInfo other)
Costruct a copy of another HRegionInfo
|
HRegionInfo(HRegionInfo other,
int replicaId) |
HRegionLocation(HRegionInfo regionInfo,
ServerName serverName) |
HRegionLocation(HRegionInfo regionInfo,
ServerName serverName,
long seqNum) |
限定符和类型 | 字段和说明 |
---|---|
protected HRegionInfo |
ClientScanner.currentRegion |
限定符和类型 | 方法和说明 |
---|---|
HRegionInfo |
RegionServerCallable.getHRegionInfo() |
HRegionInfo |
ScannerCallable.getHRegionInfo() |
static HRegionInfo |
MetaScanner.getHRegionInfo(Result data)
|
static HRegionInfo |
RegionReplicaUtil.getRegionInfoForDefaultReplica(HRegionInfo regionInfo)
Returns the HRegionInfo for the default replicaId (0).
|
static HRegionInfo |
RegionReplicaUtil.getRegionInfoForReplica(HRegionInfo regionInfo,
int replicaId)
Returns the HRegionInfo for the given replicaId.
|
限定符和类型 | 方法和说明 |
---|---|
static NavigableMap<HRegionInfo,ServerName> |
MetaScanner.allTableRegions(org.apache.hadoop.conf.Configuration conf,
Connection connection,
TableName tableName,
boolean offlined)
已过时。
|
static NavigableMap<HRegionInfo,ServerName> |
MetaScanner.allTableRegions(Connection connection,
TableName tableName)
Lists all of the table regions currently in META.
|
List<HRegionInfo> |
HBaseAdmin.getOnlineRegions(ServerName sn)
Get all the online regions on a region server.
|
List<HRegionInfo> |
Admin.getOnlineRegions(ServerName sn)
Get all the online regions on a region server.
|
NavigableMap<HRegionInfo,ServerName> |
HTable.getRegionLocations()
已过时。
This is no longer a public API. Use
HTable.getAllRegionLocations() instead. |
List<HRegionInfo> |
HBaseAdmin.getTableRegions(byte[] tableName) |
List<HRegionInfo> |
HBaseAdmin.getTableRegions(TableName tableName)
get the regions of a given table.
|
List<HRegionInfo> |
Admin.getTableRegions(TableName tableName)
Get the regions of a given table.
|
static List<HRegionInfo> |
MetaScanner.listAllRegions(org.apache.hadoop.conf.Configuration conf,
Connection connection,
boolean offlined)
Lists all of the regions currently in META.
|
限定符和类型 | 方法和说明 |
---|---|
void |
MetaCache.clearCache(HRegionInfo hri)
Deletes the cached location of the region if necessary, based on some error from source.
|
void |
HBaseAdmin.closeRegion(ServerName sn,
HRegionInfo hri)
Close a region.
|
void |
Admin.closeRegion(ServerName sn,
HRegionInfo hri)
Close a region.
|
static HRegionInfo |
RegionReplicaUtil.getRegionInfoForDefaultReplica(HRegionInfo regionInfo)
Returns the HRegionInfo for the default replicaId (0).
|
static HRegionInfo |
RegionReplicaUtil.getRegionInfoForReplica(HRegionInfo regionInfo,
int replicaId)
Returns the HRegionInfo for the given replicaId.
|
static boolean |
RegionReplicaUtil.isDefaultReplica(HRegionInfo hri) |
static boolean |
RegionReplicaUtil.isReplicasForSameRegion(HRegionInfo regionInfoA,
HRegionInfo regionInfoB) |
void |
HBaseAdmin.split(ServerName sn,
HRegionInfo hri,
byte[] splitPoint) |
限定符和类型 | 方法和说明 |
---|---|
static void |
RegionReplicaUtil.removeNonDefaultRegions(Collection<HRegionInfo> regions)
Removes the non-default replicas from the passed regions collection
|
构造器和说明 |
---|
FlushRegionCallable(ClusterConnection connection,
RpcControllerFactory rpcControllerFactory,
HRegionInfo regionInfo,
boolean writeFlushWalMarker) |
限定符和类型 | 方法和说明 |
---|---|
HRegionInfo |
RegionState.getRegion() |
构造器和说明 |
---|
RegionState(HRegionInfo region,
RegionState.State state) |
RegionState(HRegionInfo region,
RegionState.State state,
long stamp,
ServerName serverName) |
RegionState(HRegionInfo region,
RegionState.State state,
long stamp,
ServerName serverName,
long ritDuration) |
RegionState(HRegionInfo region,
RegionState.State state,
ServerName serverName) |
限定符和类型 | 方法和说明 |
---|---|
static HRegionInfo |
ProtobufUtil.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 List<HRegionInfo> |
ProtobufUtil.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> |
ProtobufUtil.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 List<HRegionInfo> |
ResponseConverter.getRegionInfos(org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetOnlineRegionResponse proto)
Get the list of region info from a GetOnlineRegionResponse
|
限定符和类型 | 方法和说明 |
---|---|
static org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionRequest |
RequestConverter.buildOpenRegionRequest(ServerName server,
HRegionInfo region,
int versionOfOfflineNode,
List<ServerName> favoredNodes,
Boolean openForReplay)
Create a protocol buffer OpenRegionRequest for a given region
|
static org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WarmupRegionRequest |
RequestConverter.buildWarmupRegionRequest(HRegionInfo regionInfo)
Create a WarmupRegionRequest for a given region name
|
static void |
ProtobufUtil.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 void |
ProtobufUtil.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 void |
ProtobufUtil.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 org.apache.hadoop.hbase.protobuf.generated.WALProtos.CompactionDescriptor |
ProtobufUtil.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 |
ProtobufUtil.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 org.apache.hadoop.hbase.protobuf.generated.WALProtos.FlushDescriptor |
ProtobufUtil.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 org.apache.hadoop.hbase.protobuf.generated.WALProtos.RegionEventDescriptor |
ProtobufUtil.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 void |
ProtobufUtil.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
|
限定符和类型 | 方法和说明 |
---|---|
static org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetOnlineRegionResponse |
ResponseConverter.buildGetOnlineRegionResponse(List<HRegionInfo> regions)
A utility to build a GetOnlineRegionResponse.
|
static org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionRequest |
RequestConverter.buildOpenRegionRequest(ServerName server,
List<Triple<HRegionInfo,Integer,List<ServerName>>> regionOpenInfos,
Boolean openForReplay)
Create a protocol buffer OpenRegionRequest to open a list of regions
|
static org.apache.hadoop.hbase.protobuf.generated.AdminProtos.UpdateFavoredNodesRequest |
RequestConverter.buildUpdateFavoredNodesRequest(List<Pair<HRegionInfo,List<ServerName>>> updateRegionInfos)
Create a protocol buffer UpdateFavoredNodesRequest to update a list of favorednode mappings
|
限定符和类型 | 方法和说明 |
---|---|
List<HRegionInfo> |
MetaTableLocator.getMetaRegions(ZooKeeperWatcher zkw) |
List<HRegionInfo> |
MetaTableLocator.getMetaRegions(ZooKeeperWatcher zkw,
int replicaId) |
List<Pair<HRegionInfo,ServerName>> |
MetaTableLocator.getMetaRegionsAndLocations(ZooKeeperWatcher zkw) |
List<Pair<HRegionInfo,ServerName>> |
MetaTableLocator.getMetaRegionsAndLocations(ZooKeeperWatcher zkw,
int replicaId) |
限定符和类型 | 方法和说明 |
---|---|
static void |
ZKAssign.asyncCreateNodeOffline(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName,
org.apache.zookeeper.AsyncCallback.StringCallback cb,
Object ctx)
Creates an unassigned node in the OFFLINE state for the specified region.
|
static boolean |
ZKAssign.checkClosingState(ZooKeeperWatcher zkw,
HRegionInfo region,
int expectedVersion) |
static int |
ZKAssign.confirmNodeOpening(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName,
int expectedVersion)
Confirm an existing unassigned node for the specified region which is
currently in the OPENING state to be still in the OPENING state on
the specified server.
|
static int |
ZKAssign.createNodeClosing(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName)
Creates a new unassigned node in the CLOSING state for the specified
region.
|
static void |
ZKAssign.createNodeOffline(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName)
Creates a new unassigned node in the OFFLINE state for the specified region.
|
static void |
ZKAssign.createNodeOffline(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName,
EventType event) |
static int |
ZKAssign.createOrForceNodeOffline(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName)
Creates or force updates an unassigned node to the OFFLINE state for the
specified region.
|
static boolean |
ZKAssign.deleteClosingNode(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName sn)
Deletes an existing unassigned node that is in the CLOSING state for the
specified region.
|
static void |
ZKAssign.deleteNodeFailSilent(ZooKeeperWatcher watcher,
HRegionInfo regionInfo)
Delete the assignment node regardless of its current state.
|
static int |
ZKAssign.getVersion(ZooKeeperWatcher zkw,
HRegionInfo region)
Get the version of the specified znode
|
static int |
ZKAssign.transitionNode(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName,
EventType beginState,
EventType endState,
int expectedVersion)
Method that actually performs unassigned node transitions.
|
static int |
ZKAssign.transitionNode(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName,
EventType beginState,
EventType endState,
int expectedVersion,
byte[] payload) |
static int |
ZKAssign.transitionNodeClosed(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName,
int expectedVersion)
Transitions an existing unassigned node for the specified region which is
currently in the CLOSING state to be in the CLOSED state.
|
static int |
ZKAssign.transitionNodeOpened(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName,
int expectedVersion)
Transitions an existing unassigned node for the specified region which is
currently in the OPENING state to be in the OPENED state.
|
static int |
ZKAssign.transitionNodeOpening(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName)
Transitions an existing unassigned node for the specified region which is
currently in the OFFLINE state to be in the OPENING state.
|
static int |
ZKAssign.transitionNodeOpening(ZooKeeperWatcher zkw,
HRegionInfo region,
ServerName serverName,
EventType beginState) |
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.