Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.Text.compareTo()


      }
     
      tabletCount++;
     
      Text tabletEndRow = new KeyExtent(entry.getKey().getRow(), (Text) null).getEndRow();
      if (tabletEndRow == null || (endRow != null && tabletEndRow.compareTo(new Text(endRow)) >= 0))
        break;
    }
   
    long scanTime = System.currentTimeMillis() - t1;
   
View Full Code Here


        row = reader.getTopKey().getRow();
        TabletLocation tabletLocation = locator.locateTablet(row, false, true);
        // log.debug(filename + " found row " + row + " at location " + tabletLocation);
        result.add(tabletLocation);
        row = tabletLocation.tablet_extent.getEndRow();
        if (row != null && (endRow == null || row.compareTo(endRow) < 0)) {
          row = new Text(row);
          row.append(byte0, 0, byte0.length);
        } else
          break;
      }
View Full Code Here

      TabletLocations locations = locationObtainer.lookupTablet(ptl, metadataRow, lastTabletRow, parent);
      while (locations != null && locations.getLocations().isEmpty() && locations.getLocationless().isEmpty()
          && !ptl.tablet_extent.equals(Constants.ROOT_TABLET_EXTENT)) {
        // try the next tablet, the current tablet does not have any tablets that overlap the row
        Text er = ptl.tablet_extent.getEndRow();
        if (er != null && er.compareTo(lastTabletRow) < 0) {
          // System.out.println("er "+er+"  ltr "+lastTabletRow);
          ptl = parent.locateTablet(er, true, retry);
          if (ptl != null)
            locations = locationObtainer.lookupTablet(ptl, metadataRow, lastTabletRow, parent);
          else
View Full Code Here

     
      ret.append(ba, 0, ba.length);
    }
   
    // remove trailing 0x0 bytes
    while (ret.getLength() > 0 && ret.getBytes()[ret.getLength() - 1] == 0 && ret.compareTo(minBS) > 0) {
      Text t = new Text();
      t.set(ret.getBytes(), 0, ret.getLength() - 1);
      ret = t;
    }
   
View Full Code Here

      if (rowsKnown && firstRow.compareTo(midRow) > 0) {
        // only in high
        long highSize = entry.getValue().getSize();
        long highEntries = entry.getValue().getNumEntries();
        highDatafileSizes.put(entry.getKey(), new DataFileValue(highSize, highEntries, entry.getValue().getTime()));
      } else if (rowsKnown && lastRow.compareTo(midRow) <= 0) {
        // only in low
        long lowSize = entry.getValue().getSize();
        long lowEntries = entry.getValue().getNumEntries();
        lowDatafileSizes.put(entry.getKey(), new DataFileValue(lowSize, lowEntries, entry.getValue().getTime()));
       
View Full Code Here

    // See that the rows are really deleted
    Scanner scanner = this.getConnector().createScanner(table, Constants.NO_AUTHS);
    int count = 0;
    for (Entry<Key,Value> entry : scanner) {
      Text row = entry.getKey().getRow();
      assertTrue((startText == null || row.compareTo(startText) <= 0) || (endText == null || row.compareTo(endText) > 0));
      assertTrue(startText != null || endText != null);
      count++;
    }
    log.info("Finished table " + table);
    assertEquals(entries, count);
View Full Code Here

    // See that the rows are really deleted
    Scanner scanner = this.getConnector().createScanner(table, Constants.NO_AUTHS);
    int count = 0;
    for (Entry<Key,Value> entry : scanner) {
      Text row = entry.getKey().getRow();
      assertTrue((startText == null || row.compareTo(startText) <= 0) || (endText == null || row.compareTo(endText) > 0));
      assertTrue(startText != null || endText != null);
      count++;
    }
    log.info("Finished table " + table);
    assertEquals(entries, count);
View Full Code Here

        log.debug("next(), key: " + k + " subrange: " + this.currentSubRange);
      }
      // if (this.currentSubRange.contains(k)) {
      keyParser.parse(k);
      Text currentVal = new Text(keyParser.getFieldValue());
      if (k.getRow().equals(currentRow) && k.getColumnFamily().equals(currentFam) && currentVal.compareTo(fieldValueUpperBound) <= 0) {
        topKey = k;
        topValue = source.getTopValue();
        return;
       
      } else { // need to move to next row.
View Full Code Here

      // scan the table
      Scanner scanner = getConnector().createScanner(TABLE, Constants.NO_AUTHS);
      for (Entry<Key,Value> entry : scanner) {
        Text row = entry.getKey().getRow();
        assertTrue(row.compareTo(start) <= 0 || row.compareTo(end) > 0);
      }
     
      // delete the table
      getConnector().tableOperations().delete(TABLE);
    }
View Full Code Here

      // scan the table
      Scanner scanner = getConnector().createScanner(TABLE, Constants.NO_AUTHS);
      for (Entry<Key,Value> entry : scanner) {
        Text row = entry.getKey().getRow();
        assertTrue(row.compareTo(start) <= 0 || row.compareTo(end) > 0);
      }
     
      // delete the table
      getConnector().tableOperations().delete(TABLE);
    }
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.