Package org.apache.hadoop.io

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


          byte [] val = curVals.get(col);
          int curval =
            Integer.parseInt(new String(val, HConstants.UTF8_ENCODING).trim());

          for (int j = 0; j < cols.length; j++) {
            if (col.compareTo(cols[j]) == 0) {
              assertEquals("Value for " + col + " should be: " + k
                  + ", but was fetched as: " + curval, curval, k);
              numFetched++;
            }
          }
View Full Code Here


        int k = 0;
        while(s.next(curKey, curVals)) {
          for(Iterator<Text> it = curVals.keySet().iterator(); it.hasNext(); ) {
            Text col = it.next();
            byte [] val = curVals.get(col);
            assertTrue(col.compareTo(CONTENTS_BODY) == 0);
            assertNotNull(val);
            numFetched++;
          }
          curVals.clear();
          k++;
View Full Code Here

        for(Iterator<Text> it = curVals.keySet().iterator(); it.hasNext(); ) {
          Text col = it.next();
          byte val[] = curVals.get(col);
          String curval = new String(val, HConstants.UTF8_ENCODING).trim();

          if(col.compareTo(CONTENTS_BASIC) == 0) {
            assertTrue("Error at:" + curKey.getRow() + "/" + curKey.getTimestamp()
                + ", Value for " + col + " should start with: " + CONTENTSTR
                + ", but was fetched as: " + curval,
                curval.startsWith(CONTENTSTR));
            contentsFetched++;
View Full Code Here

          break;
        }

        // otherwise, we need to check if it's the max and move to the next
        if (closestKey != null
          && (key == null || closestKey.compareTo(key.getRow()) > 0) ) {
          key = new HStoreKey(closestKey, ts);
        }
      }

      if (key == null) {
View Full Code Here

        finally {
          if (scannerId != -1L) {
            server.close(scannerId);
          }
        }
      } while (startRow.compareTo(EMPTY_START_ROW) != 0);
     
      return uniqueTables.toArray(new HTableDescriptor[uniqueTables.size()]);
    }

    public HRegionLocation locateRegion(Text tableName, Text row)
View Full Code Here

          // make sure that the end key is greater than the row we're looking
          // for, otherwise the row actually belongs in the next region, not
          // this one. the exception case is when the endkey is EMPTY_START_ROW,
          // signifying that the region we're checking is actually the last
          // region in the table.
          if (endKey.equals(EMPTY_TEXT) || endKey.compareTo(row) > 0) {
            return possibleRegion;
          }
        }
      }
     
View Full Code Here

         
          Text endKey = possibleRegion.getRegionInfo().getEndKey();
         
          // by nature of the map, we know that the start key has to be <
          // otherwise it wouldn't be in the headMap.
          if (endKey.compareTo(row) <= 0) {
            // delete any matching entry
            tableLocations.remove(matchingRegions.lastKey());
          }
        }
      }     
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

        row = reader.getTopKey().getRow();
        TabletLocation tabletLocation = locator.locateTablet(row, false, true, credentials);
        // 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

    if (ptl != null) {
      TabletLocations locations = locationObtainer.lookupTablet(ptl, metadataRow, lastTabletRow, parent, credentials);
      while (locations != null && locations.getLocations().isEmpty() && locations.getLocationless().isEmpty() && !ptl.tablet_extent.isRootTablet()) {
        // 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, credentials);
          if (ptl != null)
            locations = locationObtainer.lookupTablet(ptl, metadataRow, lastTabletRow, parent, credentials);
          else
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.