Exemplo n.º 1
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);
  }
Exemplo n.º 2
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));
  }
Exemplo n.º 3
0
 public static void chopped(KeyExtent extent, ZooLock zooLock) {
   Mutation m = new Mutation(extent.getMetadataEntry());
   ChoppedColumnFamily.CHOPPED_COLUMN.put(m, new Value("chopped".getBytes()));
   update(SystemCredentials.get(), zooLock, m, extent);
 }