hash = (53 * hash) + getTable().hashCode();
@Override public List<SnapshotDescription> listTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) throws IOException { List<SnapshotDescription> response = new ArrayList<>(); for (SnapshotDescription snapshotDescription : listSnapshots(snapshotNamePattern)) { if (tableNamePattern.matcher(snapshotDescription.getTable()).matches()) { response.add(snapshotDescription); } } return response; }
/** * Check that the table descriptor for the snapshot is a valid table descriptor * @param manifest snapshot manifest to inspect */ private void verifyTableInfo(final SnapshotManifest manifest) throws IOException { HTableDescriptor htd = manifest.getTableDescriptor(); if (htd == null) { throw new CorruptedSnapshotException("Missing Table Descriptor", snapshot); } if (!htd.getNameAsString().equals(snapshot.getTable())) { throw new CorruptedSnapshotException("Invalid Table Descriptor. Expected " + snapshot.getTable() + " name, got " + htd.getNameAsString(), snapshot); } }
/** * Returns a single line (no \n) representation of snapshot metadata. Use this instead of * {@link SnapshotDescription#toString()}. We don't replace SnapshotDescrpition's toString * because it is auto-generated by protoc. * @param ssd * @return Single line string with a summary of the snapshot parameters */ public static String toString(SnapshotDescription ssd) { if (ssd == null) { return null; } return "{ ss=" + ssd.getName() + " table=" + ssd.getTable() + " type=" + ssd.getType() + " }"; } }
/** * <code>optional string table = 2;</code> * * <pre> * not needed for delete, but checked for in taking snapshot * </pre> */ public Builder clearTable() { bitField0_ = (bitField0_ & ~0x00000002); table_ = getDefaultInstance().getTable(); onChanged(); return this; } /**
public String getTable() { return this.proto.getTable(); }
/** * <code>optional string table = 2;</code> * * <pre> * not needed for delete, but checked for in taking snapshot * </pre> */ public Builder clearTable() { bitField0_ = (bitField0_ & ~0x00000002); table_ = getDefaultInstance().getTable(); onChanged(); return this; } /**
/** * Dump the {@link SnapshotDescription} */ private void printInfo() { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); System.out.println("Snapshot Info"); System.out.println("----------------------------------------"); System.out.println(" Name: " + snapshotDesc.getName()); System.out.println(" Type: " + snapshotDesc.getType()); System.out.println(" Table: " + snapshotDesc.getTable()); System.out.println(" Format: " + snapshotDesc.getVersion()); System.out.println("Created: " + df.format(new Date(snapshotDesc.getCreationTime()))); System.out.println(); }
/** * <code>optional string table = 2;</code> * * <pre> * not needed for delete, but checked for in taking snapshot * </pre> */ public Builder clearTable() { bitField0_ = (bitField0_ & ~0x00000002); table_ = getDefaultInstance().getTable(); onChanged(); return this; } /**
SnapshotStats(final Configuration conf, final FileSystem fs, final SnapshotDescription snapshot) { this.snapshot = snapshot; this.snapshotTable = TableName.valueOf(snapshot.getTable()); this.conf = conf; this.fs = fs; }
/** * @param services services for the master * @param snapshot snapshot to check * @param rootDir root directory of the hbase installation. */ public MasterSnapshotVerifier(MasterServices services, SnapshotDescription snapshot, Path rootDir) { this.fs = services.getMasterFileSystem().getFileSystem(); this.services = services; this.snapshot = snapshot; this.rootDir = rootDir; this.tableName = snapshot.getTable(); }
/** * @param services services for the master * @param snapshot snapshot to check * @param rootDir root directory of the hbase installation. */ public MasterSnapshotVerifier(MasterServices services, SnapshotDescription snapshot, Path rootDir) { this.fs = services.getMasterFileSystem().getFileSystem(); this.services = services; this.snapshot = snapshot; this.rootDir = rootDir; this.tableName = TableName.valueOf(snapshot.getTable()); }
/** {@inheritDoc} */ @Override public MasterProtos.SnapshotResponse takeSnapshotAsync( HBaseProtos.SnapshotDescription snapshot) throws IOException, SnapshotCreationException { snapshotTable(snapshot.getName(), TableName.valueOf(snapshot.getTable())); LOG.warn("isSnapshotFinished() is not currently supported by BigtableAdmin.\n" + "You may poll for existence of the snapshot with listSnapshots(snpashotName)"); return MasterProtos.SnapshotResponse.newBuilder() .setExpectedTimeout(TimeUnit.MINUTES.toMillis(5)).build(); }
/** {@inheritDoc} */ @Override public void snapshot(HBaseProtos.SnapshotDescription snapshot) throws IOException, SnapshotCreationException, IllegalArgumentException { snapshot(snapshot.getName(), TableName.valueOf(snapshot.getTable())); }
protected void deleteSnapshots(String tableName) throws Exception { for (HBaseProtos.SnapshotDescription snapshotDescription : admin.listSnapshots(".*" + tableName + ".*")) { if (snapshotDescription.getTable().equals(tableName) || snapshotDescription.getTable().equals(TEST_NAMESPACE + ":" + tableName)) { admin.deleteSnapshots(snapshotDescription.getName()); } } }
private HTableDescriptor loadTableDescriptor() throws FileNotFoundException, IOException { final String name = snapshot.getTable(); HTableDescriptor htd = this.master.getTableDescriptors().get(name); if (htd == null) { throw new IOException("HTableDescriptor missing for " + name); } return htd; }
public Builder clearTable() { bitField0_ = (bitField0_ & ~0x00000002); table_ = getDefaultInstance().getTable(); onChanged(); return this; } void setTable(com.google.protobuf.ByteString value) {
/** * Check to see if the specified table has a snapshot in progress. Currently we have a * limitation only allowing a single snapshot attempt at a time. * @param tableName name of the table being snapshotted. * @return <tt>true</tt> if there is a snapshot in progress on the specified table. */ private boolean isTakingSnapshot(final String tableName) { if (handler != null && handler.getSnapshot().getTable().equals(tableName)) { return !handler.isFinished(); } return false; }
/** * <code>optional string table = 2;</code> * * <pre> * not needed for delete, but checked for in taking snapshot * </pre> */ public Builder clearTable() { bitField0_ = (bitField0_ & ~0x00000002); table_ = getDefaultInstance().getTable(); onChanged(); return this; } /**