OperationStatus status;
while (true) {
assert LatchSupport.countLatchesHeld() == 0;
final CursorImpl dup = beginMoveCursor(true);
try {
if (getMode == GetMode.NEXT) {
status = dup.getNext
(key, data, lockType, true, false);
} else if (getMode == GetMode.PREV) {
status = dup.getNext
(key, data, lockType, false, false);
} else if (getMode == GetMode.NEXT_DUP) {
status = dup.getNextDuplicate
(key, data, lockType, true, false);
} else if (getMode == GetMode.PREV_DUP) {
status = dup.getNextDuplicate
(key, data, lockType, false, false);
} else if (getMode == GetMode.NEXT_NODUP) {
status = dup.getNextNoDup
(key, data, lockType, true, false);
} else if (getMode == GetMode.PREV_NODUP) {
status = dup.getNextNoDup
(key, data, lockType, false, false);
} else {
throw EnvironmentFailureException.unexpectedState
("unknown GetMode: " + getMode);
}