ddanielr commented on code in PR #5949:
URL: https://github.com/apache/accumulo/pull/5949#discussion_r2658407638
##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/Utils.java:
##########
@@ -86,7 +86,7 @@ public static <T extends AbstractId<T>> T getNextId(String
name, ServerContext c
}
}
- private static KeyExtent findContaining(Ample ample, TableId tableId, Text
row) {
+ public static KeyExtent findContaining(Ample ample, TableId tableId, Text
row) {
Review Comment:
```suggestion
/**
* Find all tablets that are contained within the provided table row
*/
public static KeyExtent findContaining(Ample ample, TableId tableId, Text
row) {
```
Since this is now public and used outside of Utils it should probably get a
javadoc entry
##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/availability/LockTable.java:
##########
@@ -66,4 +76,35 @@ public void undo(FateId fateId, FateEnv env) throws
Exception {
Utils.unreserveTable(env.getContext(), tableId, fateId,
DistributedReadWriteLock.LockType.WRITE);
}
+
+ /**
+ * Get the LockRange for {@code this} object using its tRange field.
Converts the key-range to a
+ * row-range which is needed for the LockRange. We do a safe conversion
meaning potentially
+ * locking slightly more than is needed so we have at least what we need. If
the key-range can't
+ * be converted to a RowRange, an infinite LockRange is returned.
+ */
+ private LockRange getLockRange(FateEnv env) {
+ Range range = new Range(tRange);
Review Comment:
Avoid the range conversions if the tRange is already infinite.
```suggestion
if (tRange.infiniteStartKey && tRange.infiniteStopKey) {
return LockRange.infinite();
}
Range range = new Range(tRange);
```
--
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]