HBASE-19579 Add peer lock test for shell command list_locks
Signed-off-by: zhangduo <zhangduo@apache.org>
This commit is contained in:
parent
15055a421b
commit
59cad95b58
|
@ -77,6 +77,7 @@ enum LockedResourceType {
|
||||||
NAMESPACE = 2;
|
NAMESPACE = 2;
|
||||||
TABLE = 3;
|
TABLE = 3;
|
||||||
REGION = 4;
|
REGION = 4;
|
||||||
|
PEER = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message LockedResource {
|
message LockedResource {
|
||||||
|
|
|
@ -67,6 +67,25 @@ module Hbase
|
||||||
proc_id)
|
proc_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
define_test 'list peer locks' do
|
||||||
|
lock = create_exclusive_lock(0)
|
||||||
|
peer_id = '1'
|
||||||
|
|
||||||
|
@scheduler.waitPeerExclusiveLock(lock, peer_id)
|
||||||
|
output = capture_stdout { @list_locks.command }
|
||||||
|
@scheduler.wakePeerExclusiveLock(lock, peer_id)
|
||||||
|
|
||||||
|
assert_equal(
|
||||||
|
"PEER(1)\n" \
|
||||||
|
"Lock type: EXCLUSIVE, procedure: {" \
|
||||||
|
"\"className\"=>\"org.apache.hadoop.hbase.master.locking.LockProcedure\", " \
|
||||||
|
"\"procId\"=>\"0\", \"submittedTime\"=>\"0\", \"state\"=>\"RUNNABLE\", " \
|
||||||
|
"\"lastUpdate\"=>\"0\", " \
|
||||||
|
"\"stateMessage\"=>[{\"lockType\"=>\"EXCLUSIVE\", \"description\"=>\"description\"}]" \
|
||||||
|
"}\n\n",
|
||||||
|
output)
|
||||||
|
end
|
||||||
|
|
||||||
define_test 'list server locks' do
|
define_test 'list server locks' do
|
||||||
lock = create_exclusive_lock(0)
|
lock = create_exclusive_lock(0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue