예제 #1
0
 public static void rollBackSplit(
     Text metadataEntry, Text oldPrevEndRow, Credentials credentials, ZooLock zooLock) {
   KeyExtent ke = new KeyExtent(metadataEntry, oldPrevEndRow);
   Mutation m = ke.getPrevRowUpdateMutation();
   TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN.putDelete(m);
   TabletsSection.TabletColumnFamily.OLD_PREV_ROW_COLUMN.putDelete(m);
   update(credentials, zooLock, m, new KeyExtent(metadataEntry, (Text) null));
 }
예제 #2
0
  public static void splitTablet(
      KeyExtent extent,
      Text oldPrevEndRow,
      double splitRatio,
      Credentials credentials,
      ZooLock zooLock) {
    Mutation m = extent.getPrevRowUpdateMutation(); //

    TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN.put(
        m, new Value(Double.toString(splitRatio).getBytes()));

    TabletsSection.TabletColumnFamily.OLD_PREV_ROW_COLUMN.put(
        m, KeyExtent.encodePrevEndRow(oldPrevEndRow));
    ChoppedColumnFamily.CHOPPED_COLUMN.putDelete(m);
    update(credentials, zooLock, m, extent);
  }
예제 #3
0
  public static void finishSplit(
      Text metadataEntry,
      Map<FileRef, DataFileValue> datafileSizes,
      List<FileRef> highDatafilesToRemove,
      Credentials credentials,
      ZooLock zooLock) {
    Mutation m = new Mutation(metadataEntry);
    TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN.putDelete(m);
    TabletsSection.TabletColumnFamily.OLD_PREV_ROW_COLUMN.putDelete(m);
    ChoppedColumnFamily.CHOPPED_COLUMN.putDelete(m);

    for (Entry<FileRef, DataFileValue> entry : datafileSizes.entrySet()) {
      m.put(DataFileColumnFamily.NAME, entry.getKey().meta(), new Value(entry.getValue().encode()));
    }

    for (FileRef pathToRemove : highDatafilesToRemove) {
      m.putDelete(DataFileColumnFamily.NAME, pathToRemove.meta());
    }

    update(credentials, zooLock, m, new KeyExtent(metadataEntry, (Text) null));
  }