Package org.apache.hadoop.io

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


    if (firstLong >= 0)
      first = new Text(String.format("%016x", firstLong & 0x7fffffffffffffffl));
    if (secondLong >= 0)
      second = new Text(String.format("%016x", secondLong & 0x7fffffffffffffffl));

    if (first != null && second != null && first.compareTo(second) > 0) {
      Text swap = first;
      first = second;
      second = swap;
    }
   
View Full Code Here


      }
    }
   
    if (count != numVerifications && curRow != null) {
      Text lastRow = (Text) state.get("lastIndexRow");
      if (lastRow.compareTo(curRow) != 0) {
        log.error("Verified only " + count + " of " + numVerifications + " - curRow " + curRow + " lastKey " + lastRow);
      }
    }
   
    int verified = ((Integer) state.get("verified")).intValue() + numVerifications;
View Full Code Here

    m.put(META_COLUMN_FAMILY, UUID_COLUMN_QUALIFIER, new Value(uuid.getBytes(Constants.UTF8)));
   
    indexBW.addMutation(m);
   
    Text lastRow = (Text) state.get("lastIndexRow");
    if (lastRow.compareTo(row) < 0) {
      state.set("lastIndexRow", new Text(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

            && (violations == null || !violations.contains((short) 4))) {
          KeyExtent ke = new KeyExtent(new Text(mutation.getRow()), (Text) null);
         
          Text per = KeyExtent.decodePrevEndRow(new Value(columnUpdate.getValue()));
         
          boolean prevEndRowLessThanEndRow = per == null || ke.getEndRow() == null || per.compareTo(ke.getEndRow()) < 0;
         
          if (!prevEndRowLessThanEndRow) {
            violations = addViolation(violations, 3);
          }
        } else if (new ColumnFQ(columnUpdate).equals(Constants.METADATA_LOCK_COLUMN)) {
View Full Code Here

            }
           
            tabletCount++;
           
            Text tabletEndRow = new KeyExtent(entry.getKey().getRow(), (Text) null).getEndRow();
            if (tabletEndRow == null || (ert != null && tabletEndRow.compareTo(ert) >= 0))
              break;
          }
         
          if (tabletsToWaitFor == 0)
            break;
View Full Code Here

          Text endRow = ByteBufferUtil.toText(arguments.get(2));
          final String tableId = checkTableId(tableName, TableOperation.MERGE);
          if (tableName.equals(Constants.METADATA_TABLE_NAME)) {
            if (startRow.compareTo(new Text("0")) < 0) {
              startRow = new Text("0");
              if (endRow.getLength() != 0 && endRow.compareTo(startRow) < 0)
                throw new ThriftTableOperationException(null, tableName, TableOperation.MERGE, TableOperationExceptionType.OTHER,
                    "end-row specification is in the root tablet, which cannot be merged or split");
            }
          }
          log.debug("Creating merge op: " + tableId + " " + startRow + " " + endRow);
View Full Code Here

      }
     
      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

      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

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.