keith-turner commented on code in PR #4297:
URL: https://github.com/apache/accumulo/pull/4297#discussion_r1503057721


##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/Utils.java:
##########
@@ -163,27 +161,30 @@ public static void unreserveHdfsDirectory(Manager env, 
String directory, long ti
   }
 
   private static Lock getLock(ServerContext context, AbstractId<?> id, long 
tid,
-      boolean writeLock) {
+      LockType lockType) {
     byte[] lockData = FastFormat.toZeroPaddedHex(tid);
     var fLockPath =
         FateLock.path(context.getZooKeeperRoot() + Constants.ZTABLE_LOCKS + 
"/" + id.canonical());
     FateLock qlock = new FateLock(context.getZooReaderWriter(), fLockPath);
     DistributedLock lock = DistributedReadWriteLock.recoverLock(qlock, 
lockData);
     if (lock != null) {
-
       // Validate the recovered lock type
-      boolean isWriteLock = lock.getType() == LockType.WRITE;
-      if (writeLock != isWriteLock) {
+      if (!lock.getType().equals(lockType)) {

Review Comment:
   If these enums should be able to use `!=`
   ```suggestion
         if (lock.getType()!= lockType) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to