reflected code review comments
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_lsm_stabilization_kisskys@1697 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManager.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManager.java
index a861894..b1a28ca 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManager.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManager.java
@@ -212,6 +212,7 @@
if (!isInstant) {
if (doEscalate) {
//jobInfo must not be null.
+ assert jobInfo != null;
jobInfo.increaseDatasetISLockCount(dId);
//release pre-acquired locks
releaseDatasetISLocks(jobInfo, jobId, datasetId, txnContext);
@@ -219,6 +220,7 @@
if (jobInfo == null) {
jobInfo = jobHT.get(jobId);
//jobInfo must not be null;
+ assert jobInfo != null;
}
jobInfo.increaseDatasetISLockCount(dId);
}
@@ -1072,6 +1074,8 @@
if (!isInstant && datasetLockMode == LockMode.IS) {
jobInfo.increaseDatasetISLockCount(dId);
if (doEscalate) {
+ //This exception is thrown when the threshold value is set to 1.
+ //We don't want to allow the lock escalation when there is a first lock request on a dataset.
throw new IllegalStateException("ESCALATE_TRHESHOLD_ENTITY_TO_DATASET should not be set to "
+ ESCALATE_TRHESHOLD_ENTITY_TO_DATASET);
}
@@ -1107,6 +1111,7 @@
if (!isInstant) {
if (doEscalate) {
//jobInfo must not be null.
+ assert jobInfo != null;
jobInfo.increaseDatasetISLockCount(dId);
//release pre-acquired locks
releaseDatasetISLocks(jobInfo, jobId, datasetId, txnContext);
@@ -1114,6 +1119,7 @@
if (jobInfo == null) {
jobInfo = jobHT.get(jobId);
//jobInfo must not be null;
+ assert jobInfo != null;
}
jobInfo.increaseDatasetISLockCount(dId);
}
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerDeterministicUnitTest.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerDeterministicUnitTest.java
index cdc3ded..c3b47bc 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerDeterministicUnitTest.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerDeterministicUnitTest.java
@@ -453,7 +453,6 @@
request.txnContext);
break;
case RequestType.UNLOCK:
- //Set the isInstant flag properly
lockMgr.unlock(request.datasetIdObj, request.entityHashValue, request.txnContext);
break;
case RequestType.RELEASE_LOCKS:
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerRandomUnitTest.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerRandomUnitTest.java
index 4bb2419..89a15ef 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerRandomUnitTest.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerRandomUnitTest.java
@@ -476,8 +476,6 @@
request.txnContext);
break;
case RequestType.UNLOCK:
- //TODO
- //Set the isInstant flag properly
lockMgr.unlock(request.datasetIdObj, request.entityHashValue, request.txnContext);
break;
case RequestType.RELEASE_LOCKS: