Symbolic constants in lock manager
Change-Id: I774dd40113f5fa4fee94dde72f4ec6a1891c6b6e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/694
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <bamousaa@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/locking/ConcurrentLockManager.java b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/locking/ConcurrentLockManager.java
index faec2ed..280f8d2 100644
--- a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/locking/ConcurrentLockManager.java
+++ b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/locking/ConcurrentLockManager.java
@@ -784,8 +784,8 @@
@Override
public void add(long request, long resource, long job) {
long upgrader = resArenaMgr.getFirstUpgrader(resource);
- reqArenaMgr.setNextRequest(request, -1);
- if (upgrader == -1) {
+ reqArenaMgr.setNextRequest(request, NILL);
+ if (upgrader == NILL) {
resArenaMgr.setFirstUpgrader(resource, request);
} else {
appendToRequestQueue(upgrader, request);
@@ -906,8 +906,8 @@
}
private boolean resourceNotUsed(long resource) {
- return resArenaMgr.getLastHolder(resource) == -1 && resArenaMgr.getFirstUpgrader(resource) == -1
- && resArenaMgr.getFirstWaiter(resource) == -1;
+ return resArenaMgr.getLastHolder(resource) == NILL && resArenaMgr.getFirstUpgrader(resource) == NILL
+ && resArenaMgr.getFirstWaiter(resource) == NILL;
}
private void validateJob(ITransactionContext txnContext) throws ACIDException {