Ejemplo n.º 1
0
  public static void addTablet(
      KeyExtent extent, String path, Credentials credentials, char timeType, ZooLock lock) {
    Mutation m = extent.getPrevRowUpdateMutation();

    TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN.put(m, new Value(path.getBytes()));
    TabletsSection.ServerColumnFamily.TIME_COLUMN.put(m, new Value((timeType + "0").getBytes()));

    update(credentials, lock, m, extent);
  }
Ejemplo n.º 2
0
 private static Scanner createCloneScanner(String tableId, Connector conn)
     throws TableNotFoundException {
   Scanner mscanner =
       new IsolatedScanner(conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY));
   mscanner.setRange(new KeyExtent(new Text(tableId), null, null).toMetadataRange());
   mscanner.fetchColumnFamily(DataFileColumnFamily.NAME);
   mscanner.fetchColumnFamily(TabletsSection.CurrentLocationColumnFamily.NAME);
   mscanner.fetchColumnFamily(TabletsSection.LastLocationColumnFamily.NAME);
   mscanner.fetchColumnFamily(ClonedColumnFamily.NAME);
   TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.fetch(mscanner);
   TabletsSection.ServerColumnFamily.TIME_COLUMN.fetch(mscanner);
   return mscanner;
 }
Ejemplo n.º 3
0
  public static void updateTabletDataFile(
      long tid,
      KeyExtent extent,
      Map<FileRef, DataFileValue> estSizes,
      String time,
      Credentials credentials,
      ZooLock zooLock) {
    Mutation m = new Mutation(extent.getMetadataEntry());
    byte[] tidBytes = Long.toString(tid).getBytes();

    for (Entry<FileRef, DataFileValue> entry : estSizes.entrySet()) {
      Text file = entry.getKey().meta();
      m.put(DataFileColumnFamily.NAME, file, new Value(entry.getValue().encode()));
      m.put(TabletsSection.BulkFileColumnFamily.NAME, file, new Value(tidBytes));
    }
    TabletsSection.ServerColumnFamily.TIME_COLUMN.put(m, new Value(time.getBytes()));
    update(credentials, zooLock, m, extent);
  }