private void findTop()

in modules/accumulo/src/main/java/org/apache/fluo/accumulo/iterators/OpenReadLockIterator.java [40:82]


  private void findTop() throws IOException {
    while (source.hasTop()) {

      ColumnType colType = ColumnType.from(source.getTopKey());

      switch (colType) {
        case TX_DONE:
        case WRITE:
        case DEL_LOCK: {
          source.skipToPrefix(source.getTopKey(), ColumnType.RLOCK);
          break;
        }
        case RLOCK: {
          if (ReadLockUtil.isDelete(source.getTopKey())) {
            lastDelete.set(source.getTopKey());
          } else {
            if (lastDelete.equals(source.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS)) {
              long ts1 = ReadLockUtil.decodeTs(source.getTopKey().getTimestamp() & TIMESTAMP_MASK);
              long ts2 = ReadLockUtil.decodeTs(lastDelete.getTimestamp() & TIMESTAMP_MASK);

              if (ts1 != ts2) {
                // found a read lock that is not suppressed by a delete read lock entry
                return;
              }
            } else {
              // found a read lock that is not suppressed by a delete read lock entry
              return;
            }
          }
          source.next();
          break;
        }
        case DATA:
        case LOCK:
        case ACK: {
          source.skipColumn(source.getTopKey());
          break;
        }
        default:
          throw new IllegalArgumentException("Unknown column type " + source.getTopKey());
      }
    }
  }