Package org.apache.accumulo.core.data

Examples of org.apache.accumulo.core.data.Key.compareTo()


      for (int i = 0; i < lgReaders.length; i++) {
        if (maxKey == null) {
          maxKey = lgReaders[i].getLastKey();
        } else {
          Key lastKey = lgReaders[i].getLastKey();
          if (lastKey != null && lastKey.compareTo(maxKey) > 0)
            maxKey = lastKey;
        }
      }
     
      return maxKey;
View Full Code Here


    if (log.isTraceEnabled())
      log.trace("using top key to seek for doc: " + topKey.toString());
    Key docKey = buildDocKey();
    docSource.seek(new Range(docKey, true, null, false), docColfSet, true);
    log.debug("got doc key: " + docSource.getTopKey().toString());
    if (docSource.hasTop() && docKey.compareTo(docSource.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL) == 0) {
      value = docSource.getTopValue();
    }
    log.debug("got doc value: " + value.toString());
  }
 
View Full Code Here

        throw new RuntimeException("First key out of order " + reader.getFirstKey() + " " + lastKey);
     
      indexIter.next();
     
      while (indexIter.hasTop()) {
        if (lastKey.compareTo(indexIter.getTopKey()) > 0)
          throw new RuntimeException("Indext out of order " + lastKey + " " + indexIter.getTopKey());
       
        lastKey = new Key(indexIter.getTopKey());
        indexIter.next();
       
View Full Code Here

    s.setRanges(Collections.singletonList(new Range()));
    Key key = null;
    int count = 0;
    for (Entry<Key,Value> entry : s) {
      if (key != null)
        assertTrue(key.compareTo(entry.getKey()) < 0);
      assertEquals(entry.getKey().getRow(), new Text(entry.getValue().get()));
      key = entry.getKey();
      count++;
    }
    assertEquals(100, count);
View Full Code Here

    s.setRanges(Collections.singletonList(new Range()));
    Key key = null;
    int count = 0;
    for (Entry<Key,Value> entry : s) {
      if (key != null)
        assertTrue(key.compareTo(entry.getKey()) < 0);
      assertEquals(entry.getKey().getRow(), new Text(entry.getValue().get()));
      key = entry.getKey();
      count++;
    }
    assertEquals(100, count);
View Full Code Here

        if (summarize) {
          if (count > 0) {
            if (max == null || max.compareTo(key) < 0) {
              max = new Key(key);
            }
            if (tabletMax == null || tabletMax.compareTo(key) < 0) {
              tabletMax = new Key(key);
            }
            System.out.printf("%20s) ", "" + key);
          }
         
View Full Code Here

      long t1 = System.currentTimeMillis();
      int count = 0;
      int misses = 0;
      for (Key key : queries) {
        Key key2 = (Key) mr.getClosest(key, value);
        if (key2.compareTo(key) != 0) {
          misses++;
        }
        count++;
      }
     
View Full Code Here

  public Key getNextRow(
      final Key currentRow ) {
    final Iterator<Key> rowIdIt = rowIdToPixelsMap.keySet().iterator();
    while (rowIdIt.hasNext()) {
      final Key rowId = rowIdIt.next();
      if (rowId.compareTo(currentRow) < 0) {
        rowIdIt.remove();
      }
      else {
        return rowId;
      }
View Full Code Here

    if (sk != null && sk.getColumnFamilyData().length() == 0 && sk.getColumnQualifierData().length() == 0 && sk.getColumnVisibilityData().length() == 0
        && sk.getTimestamp() == Long.MAX_VALUE && !range.isStartKeyInclusive()) {
      // assuming that we are seeking using a key previously returned by this iterator
      // therefore go to the next row
      Key followingRowKey = sk.followingKey(PartialKey.ROW);
      if (range.getEndKey() != null && followingRowKey.compareTo(range.getEndKey()) > 0)
        return;
     
      range = new Range(sk.followingKey(PartialKey.ROW), true, range.getEndKey(), range.isEndKeyInclusive());
    }
   
View Full Code Here

          // range is between the two keys in the file where the last range seeked to stopped, so there is
          // nothing to do
          reseek = false;
        }
       
        if (startKey.compareTo(getTopKey()) <= 0 && startKey.compareTo(prevKey) > 0) {
          // current location in file can satisfy this request, no need to seek
          reseek = false;
        }
       
        if (startKey.compareTo(index.get(block).getKey()) <= 0 && startKey.compareTo(getTopKey()) >= 0) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.