HBASE-7969 Rename HBaseAdmin#getCompletedSnapshots as HBaseAdmin#listSnapshots (Ted Yu)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1451625 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2013-03-01 15:58:57 +00:00
parent 26d688ff95
commit 5dbc35782a
7 changed files with 12 additions and 12 deletions

View File

@ -2331,7 +2331,7 @@ public class HBaseAdmin implements Abortable, Closeable {
String rollbackSnapshot = snapshotName + "-" + EnvironmentEdgeManager.currentTimeMillis();
String tableName = null;
for (SnapshotDescription snapshotInfo: getCompletedSnapshots()) {
for (SnapshotDescription snapshotInfo: listSnapshots()) {
if (snapshotInfo.getName().equals(snapshotName)) {
tableName = snapshotInfo.getTable();
break;
@ -2477,7 +2477,7 @@ public class HBaseAdmin implements Abortable, Closeable {
* @return a list of snapshot descriptors for completed snapshots
* @throws IOException if a network error occurs
*/
public List<SnapshotDescription> getCompletedSnapshots() throws IOException {
public List<SnapshotDescription> listSnapshots() throws IOException {
return execute(new MasterAdminCallable<List<SnapshotDescription>>() {
@Override
public List<SnapshotDescription> call() throws ServiceException {

View File

@ -319,7 +319,7 @@ org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
<%def userSnapshots>
<%java>
List<SnapshotDescription> snapshots = admin.getCompletedSnapshots();
List<SnapshotDescription> snapshots = admin.listSnapshots();
</%java>
<%if (snapshots != null && snapshots.size() > 0)%>
<table class="table table-striped">

View File

@ -41,7 +41,7 @@
boolean readOnly = conf.getBoolean("hbase.master.ui.readonly", false);
String snapshotName = request.getParameter("name");
SnapshotDescription snapshot = null;
for (SnapshotDescription snapshotDesc: hbadmin.getCompletedSnapshots()) {
for (SnapshotDescription snapshotDesc: hbadmin.listSnapshots()) {
if (snapshotName.equals(snapshotDesc.getName())) {
snapshot = snapshotDesc;
break;

View File

@ -688,7 +688,7 @@ module Hbase
#----------------------------------------------------------------------------------------------
# Returns a list of snapshots
def list_snapshot
@admin.getCompletedSnapshots
@admin.listSnapshots
end
# Apply config specific to a table/column to its descriptor

View File

@ -194,7 +194,7 @@ public class TestSnapshotFromClient {
admin, fs, false, new Path(rootDir, HConstants.HREGION_LOGDIR_NAME), snapshotServers);
admin.deleteSnapshot(snapshot);
snapshots = admin.getCompletedSnapshots();
snapshots = admin.listSnapshots();
SnapshotTestingUtils.assertNoSnapshots(admin);
}

View File

@ -68,7 +68,7 @@ public class SnapshotTestingUtils {
* if the admin operation fails
*/
public static void assertNoSnapshots(HBaseAdmin admin) throws IOException {
assertEquals("Have some previous snapshots", 0, admin.getCompletedSnapshots()
assertEquals("Have some previous snapshots", 0, admin.listSnapshots()
.size());
}
@ -80,7 +80,7 @@ public class SnapshotTestingUtils {
HBaseAdmin admin, String snapshotName, String tableName)
throws IOException {
// list the snapshot
List<SnapshotDescription> snapshots = admin.getCompletedSnapshots();
List<SnapshotDescription> snapshots = admin.listSnapshots();
List<SnapshotDescription> returnedSnapshots = new ArrayList<SnapshotDescription>();
for (SnapshotDescription sd : snapshots) {
@ -109,7 +109,7 @@ public class SnapshotTestingUtils {
HBaseAdmin admin, String snapshotName, String tableName)
throws IOException {
// list the snapshot
List<SnapshotDescription> snapshots = admin.getCompletedSnapshots();
List<SnapshotDescription> snapshots = admin.listSnapshots();
assertEquals("Should only have 1 snapshot", 1, snapshots.size());
assertEquals(snapshotName, snapshots.get(0).getName());

View File

@ -179,7 +179,7 @@ public class TestFlushSnapshotFromClient {
admin, fs, false, new Path(rootDir, HConstants.HREGION_LOGDIR_NAME), snapshotServers);
admin.deleteSnapshot(snapshot);
snapshots = admin.getCompletedSnapshots();
snapshots = admin.listSnapshots();
SnapshotTestingUtils.assertNoSnapshots(admin);
}
@ -385,7 +385,7 @@ public class TestFlushSnapshotFromClient {
// dump for debugging
logFSTree(new Path(UTIL.getConfiguration().get(HConstants.HBASE_DIR)));
List<SnapshotDescription> taken = admin.getCompletedSnapshots();
List<SnapshotDescription> taken = admin.listSnapshots();
int takenSize = taken.size();
LOG.info("Taken " + takenSize + " snapshots: " + taken);
assertTrue("We expect at least 1 request to be rejected because of we concurrently" +
@ -399,4 +399,4 @@ public class TestFlushSnapshotFromClient {
private void logFSTree(Path root) throws IOException {
FSUtils.logFileSystemState(UTIL.getDFSCluster().getFileSystem(), root, LOG);
}
}
}