HBASE-22064 Remove Admin.deleteSnapshot(byte[])

Signed-off-by: zhangduo <zhangduo@apache.org>
This commit is contained in:
pingsutw 2019-03-23 21:27:12 +08:00 committed by zhangduo
parent 7e3ca7063c
commit 21cb00eef6
7 changed files with 6 additions and 26 deletions

View File

@ -1509,16 +1509,6 @@ public interface Admin extends Abortable, Closeable {
List<SnapshotDescription> listTableSnapshots(Pattern tableNamePattern, List<SnapshotDescription> listTableSnapshots(Pattern tableNamePattern,
Pattern snapshotNamePattern) throws IOException; Pattern snapshotNamePattern) throws IOException;
/**
* Delete an existing snapshot.
*
* @param snapshotName name of the snapshot
* @throws IOException if a remote or network exception occurs
* @deprecated Since 2.2.0. Will be removed in 3.0.0. Use {@link #deleteSnapshot(String)} instead.
*/
@Deprecated
void deleteSnapshot(byte[] snapshotName) throws IOException;
/** /**
* Delete an existing snapshot. * Delete an existing snapshot.
* *

View File

@ -2472,11 +2472,6 @@ public class HBaseAdmin implements Admin {
return tableSnapshots; return tableSnapshots;
} }
@Override
public void deleteSnapshot(final byte[] snapshotName) throws IOException {
deleteSnapshot(Bytes.toString(snapshotName));
}
@Override @Override
public void deleteSnapshot(final String snapshotName) throws IOException { public void deleteSnapshot(final String snapshotName) throws IOException {
// make sure the snapshot is possibly valid // make sure the snapshot is possibly valid

View File

@ -216,7 +216,7 @@ public class TestSnapshotFromClient {
// take a snapshot of the disabled table // take a snapshot of the disabled table
final String SNAPSHOT_NAME = "offlineTableSnapshot"; final String SNAPSHOT_NAME = "offlineTableSnapshot";
byte[] snapshot = Bytes.toBytes(SNAPSHOT_NAME); String snapshot = SNAPSHOT_NAME;
admin.snapshot(new SnapshotDescription(SNAPSHOT_NAME, TABLE_NAME, admin.snapshot(new SnapshotDescription(SNAPSHOT_NAME, TABLE_NAME,
SnapshotType.DISABLED, null, -1, SnapshotManifestV1.DESCRIPTOR_VERSION)); SnapshotType.DISABLED, null, -1, SnapshotManifestV1.DESCRIPTOR_VERSION));

View File

@ -306,7 +306,7 @@ public class TestSnapshotTemporaryDirectory {
// take a snapshot of the disabled table // take a snapshot of the disabled table
final String SNAPSHOT_NAME = "offlineTableSnapshot"; final String SNAPSHOT_NAME = "offlineTableSnapshot";
byte[] snapshot = Bytes.toBytes(SNAPSHOT_NAME); String snapshot = SNAPSHOT_NAME;
takeSnapshot(TABLE_NAME, SNAPSHOT_NAME, true); takeSnapshot(TABLE_NAME, SNAPSHOT_NAME, true);
LOG.debug("Snapshot completed."); LOG.debug("Snapshot completed.");
@ -390,8 +390,8 @@ public class TestSnapshotTemporaryDirectory {
LOG); LOG);
// take a snapshot of the disabled table // take a snapshot of the disabled table
byte[] snapshot = Bytes.toBytes("testOfflineTableSnapshotWithEmptyRegion"); String snapshot = "testOfflineTableSnapshotWithEmptyRegion";
takeSnapshot(TABLE_NAME, Bytes.toString(snapshot), true); takeSnapshot(TABLE_NAME, snapshot, true);
LOG.debug("Snapshot completed."); LOG.debug("Snapshot completed.");
// make sure we have the snapshot // make sure we have the snapshot

View File

@ -313,7 +313,7 @@ public class TestSnapshotFromMaster {
// take a snapshot of the table // take a snapshot of the table
String snapshotName = "snapshot"; String snapshotName = "snapshot";
byte[] snapshotNameBytes = Bytes.toBytes(snapshotName); String snapshotNameBytes = snapshotName;
admin.snapshot(snapshotName, TABLE_NAME); admin.snapshot(snapshotName, TABLE_NAME);
LOG.info("After snapshot File-System state"); LOG.info("After snapshot File-System state");

View File

@ -186,7 +186,7 @@ public class TestFlushSnapshotFromClient {
// take a snapshot of the enabled table // take a snapshot of the enabled table
String snapshotString = "skipFlushTableSnapshot"; String snapshotString = "skipFlushTableSnapshot";
byte[] snapshot = Bytes.toBytes(snapshotString); String snapshot = snapshotString;
admin.snapshot(snapshotString, TABLE_NAME, SnapshotType.SKIPFLUSH); admin.snapshot(snapshotString, TABLE_NAME, SnapshotType.SKIPFLUSH);
LOG.debug("Snapshot completed."); LOG.debug("Snapshot completed.");

View File

@ -854,11 +854,6 @@ public class ThriftAdmin implements Admin {
throw new NotImplementedException("listTableSnapshots not supported in ThriftAdmin"); throw new NotImplementedException("listTableSnapshots not supported in ThriftAdmin");
} }
@Override
public void deleteSnapshot(byte[] snapshotName) {
throw new NotImplementedException("deleteSnapshot not supported in ThriftAdmin");
}
@Override @Override
public void deleteSnapshot(String snapshotName) { public void deleteSnapshot(String snapshotName) {
throw new NotImplementedException("deleteSnapshot not supported in ThriftAdmin"); throw new NotImplementedException("deleteSnapshot not supported in ThriftAdmin");