Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

HBase Java APIs

Updated on 2024-08-16 GMT+08:00

HBase adopts the same APIs as those of Apache HBase. For details, visit http://hbase.apache.org/apidocs/index.html.

Newly Added or Modified APIs

  • org.apache.hadoop.hbase.Cell of HBase 0.98.3 rather than org.apache.hadoop.hbase.KeyValue of HBase 0.94 is recommended as the key-value data object.
  • It is recommended that HConnection connection = HConnectionManager.createConnection(conf) be used to create a connection pool in HBase 0.98.3. The HTablePool is abandoned.
  • For details about the new EndPoint API, visit http://hbase.apache.org/book/cp.html.
  • The isReversed() and setReversed(boolean reversed) reversed scan methods are added to org.apache.hadoop.hbase.client.Scan.
  • For details about API changes from HBase 0.98 to HBase 1.0, visit https://issues.apache.org/jira/browse/hbase-10602.
  • org.apache.hadoop.hbase.mapreduce rather than org.apache.hadoop.hbase.mapred is recommended for HBase 1.0.
  • For details about the version, visit https://blogs.apache.org/hbase/entry/start_of_a_new_era.
  • New APIs added to obtain HBase replication metrics
    Table 1 org.apache.hadoop.hbase.client.replication.ReplicationAdmin

    Method

    Description

    getSourceMetricsSummary(String id)

    Parameter type: String

    The source metric summary of the peer ID needs to be obtained.

    Return type: Map<String, String>

    Returned: A map, where the key is the RegionServer name and the value is the source cluster metric summary of the specified peer ID. Summary metrics are sizeOfLogToReplicate and timeForLogToReplicate.

    getSourceMetrics(String id)

    Parameter type: String

    The source metric summary of the peer ID needs to be obtained.

    Return type: Map<String, String>

    Returned: A map, where the key is the RegionServer name and the value is the source cluster metric of the specified peer ID.

    getSinkMetrics()

    Return type: Map<String, String>

    Returned: A map, where the key is the RegionServer name and the value is the source cluster sink metric of the specified peer ID.

    getPeerSinkMetrics(String id)

    Parameter type: String

    The source metric summary of the peer ID needs to be obtained.

    Return type: Map<String, String>

    Returned: A map, where the key is the RegionServer name and the value is the source cluster sink metric of the specified peer ID.

    NOTE:

    All methods return a Map, where the key is "RegionServer name (IP/Host)" and the value is the string containing all the metrics in format of 'Metric Name'='Metric Value' [, 'Metric Name'= 'Metric Value']*.

    Example: SizeOfHFileRefsQueue=0, AgeOfLastShippedOp=0

    Table 2 org.apache.hadoop.hbase.replication.ReplicationLoadSource

    Method

    Description

    getPeerID()

    Return type: String

    Returned: peer cluster ID

    getAgeOfLastShippedOp()

    Return type: long

    Returned: milliseconds that the last successful replication request lasts

    getSizeOfLogQueue()

    Return type: long

    Returned: write-ahead logs (WALs) waiting for replication in the queue

    getTimeStampOfLastShippedOp()

    Return type: long

    Returned: timestamp of the last successful replication request

    getReplicationLag()

    Return type: long

    Returned: interval between current time and the time of the last successful replication request

    getShippedOps()

    Return type: long

    Returned: total number of data ops transferred

    getShippedBytes()

    Return type: long

    Returned: total number of data bytes transferred

    getShippedBatches()

    Return type: long

    Returned: total number of data batches transferred

    getLogReadInBytes()

    Return type: long

    Returned: total number of bytes read from WAL

    getLogEditsRead()

    Return type: long

    Returned: total number of edits read from WAL

    getSizeOfLogToReplicate()

    Return type: long

    Returned: total size of WALs waiting to be replicated in the queue

    getTimeForLogToReplicate()

    Return type: long

    Returned: seconds spent in replicating WALs in the queue

    getShippedHFiles()

    Return type: long

    Returned: total number of HFiles transferred

    getSizeOfHFileRefsQueue()

    Return type: long

    Returned: total number of HFiles waiting to be replicated

    getLogEditsFiltered()

    Return type: long

    Returned: total number of WAL edits filtered

    getFailedReplicationAttempts()

    Return type: long

    Returned: times failed to replicate data for a single request

    Table 3 org.apache.hadoop.hbase.replication.ReplicationLoadSink

    Method

    Description

    getAgeOfLastAppliedOp()

    Return type: long

    Returned: milliseconds that the last successful applied WAL edits last

    getTimeStampsOfLastAppliedOp()

    Return type: long

    Returned: timestamp of the last successful applied WAL edit

    getAppliedBatches()

    Return type: long

    Returned: total number of data batches applied

    getAppliedOps()

    Return type: long

    Returned: total number of data ops applied

    getAppliedHFiles()

    Return type: long

    Returned: total number of HFiles applied

    NOTE:

    The new API OF Replication Admin obtains the metric values from HMaster. Each RegionServer reports status to HMaster at every heartbeat interval, which is 3 seconds by default. Therefore, this API reports the latest metric value at the last heartbeat by using the RegionServer.

    If you need the latest metric value, use the JMX API provided by the RegionServer.

  • 1.3.1 (MRS 1.9.2) API Changes
    • Added HIndex API
    Table 4 org.apache.hadoop.hbase.hindex.client.HIndexAdmin

    Method

    Description

    addIndices(TableName tablename,TableIndices tableIndices)

    Parameter: TableName

    Name of the table to which the user wants to add a specified index.

    Parameter: TableIndices

    Table index to be added to the table

    Return type: void

    addIndicesWithData(TableName tablename,TableIndices tableIndices)

    Parameter: TableName

    Name of the table to which the user wants to add a specified index

    Parameter: TableIndices

    Table index to be added to the table

    Return type: void

    dropIndices(TableName tableName,List <String> list)

    Parameter: TableName

    Name of the table from which the user wants to delete an index

    Parameter: List<String>

    Contains the list of indexes to be deleted.

    Return type: void

    dropIndicesWithData(TableName tableName,List <String> list)

    Parameter: TableName

    Name of the table from which the user wants to delete a specified index

    Parameter: List<String>

    Contains the list of indexes to be deleted.

    Return type: void

    disableIndices(TableName tableName,List <String> list)

    Parameter: TableName

    Name of the table for which the user wants to disable a specified index

    Parameter: List<String>

    Contains the list of indexes to be disabled.

    Return type: void

    enableIndices(TableName tableName,List <String> list)

    Parameter: TableName

    Name of the table for which the user wants to enable a specified index

    Parameter: List<String>

    Contains the list of indexes to be enabled.

    Return type: void

    listIndices(TableName tableName)

    Parameter: TableName

    Name of the table for which the user wants to list all indexes

    Return type: List <Pair <HIndexSpecification,IndexState >>

    Return: A secondary index list is returned. The first element is the index specification, and the second element is the current state of the index.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback