Class LockServiceClient
java.lang.Object
org.apache.hadoop.hbase.client.locking.LockServiceClient
Helper class to create "master locks" for namespaces, tables and regions. DEV-NOTE: At the moment
this class is used only by the RS for MOB, to prevent other MOB compaction to conflict. The RS
has already the stub of the LockService, so we have only one constructor that takes the
LockService stub. If in the future we are going to use this in other places we should add a
constructor that from conf or connection, creates the stub.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.apache.hadoop.conf.Configuration
private final NonceGenerator
private final org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockService.BlockingInterface
-
Constructor Summary
ConstructorDescriptionLockServiceClient
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockService.BlockingInterface stub, NonceGenerator ng) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest
buildLockRequest
(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockType type, String namespace, TableName tableName, List<RegionInfo> regionInfos, String description, long nonceGroup, long nonce) namespaceLock
(String namespace, String description, Abortable abort) LocCreate a new EntityLock object to acquire exclusive lock on a namespace.regionLock
(List<RegionInfo> regionInfos, String description, Abortable abort) Create a new EntityLock object to acquire exclusive lock on multiple regions of same tables.Create a new EntityLock object to acquire an exclusive or shared lock on a table.
-
Field Details
-
stub
private final org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockService.BlockingInterface stub -
conf
-
ng
-
-
Constructor Details
-
LockServiceClient
public LockServiceClient(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockService.BlockingInterface stub, NonceGenerator ng)
-
-
Method Details
-
tableLock
public EntityLock tableLock(TableName tableName, boolean exclusive, String description, Abortable abort) Create a new EntityLock object to acquire an exclusive or shared lock on a table. Internally, the table namespace will also be locked in shared mode. -
namespaceLock
LocCreate a new EntityLock object to acquire exclusive lock on a namespace. Clients can not acquire shared locks on namespace. -
regionLock
Create a new EntityLock object to acquire exclusive lock on multiple regions of same tables. Internally, the table and its namespace will also be locked in shared mode. -
buildLockRequest
@Private public static org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest buildLockRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockType type, String namespace, TableName tableName, List<RegionInfo> regionInfos, String description, long nonceGroup, long nonce)
-