From 1389bb4595d32baa832ecc6ead99699a8c52b4dc Mon Sep 17 00:00:00 2001 From: Jan Hentschel Date: Sat, 10 Aug 2019 21:32:58 +0200 Subject: [PATCH] HBASE-22829 Removed deprecated methods from SnapshotDescription --- .../hbase/client/SnapshotDescription.java | 57 ------------------- .../security/access/AccessController.java | 3 +- 2 files changed, 2 insertions(+), 58 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/SnapshotDescription.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/SnapshotDescription.java index 4fa825e5f457..872065bb8a69 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/SnapshotDescription.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/SnapshotDescription.java @@ -41,63 +41,18 @@ public SnapshotDescription(String name) { this(name, (TableName)null); } - /** - * @deprecated since 2.0.0 and will be removed in 3.0.0. Use the version with the TableName - * instance instead. - * @see #SnapshotDescription(String, TableName) - * @see HBASE-16892 - */ - @Deprecated - public SnapshotDescription(String name, String table) { - this(name, TableName.valueOf(table)); - } - public SnapshotDescription(String name, TableName table) { this(name, table, SnapshotType.DISABLED, null, -1, -1, null); } - /** - * @deprecated since 2.0.0 and will be removed in 3.0.0. Use the version with the TableName - * instance instead. - * @see #SnapshotDescription(String, TableName, SnapshotType) - * @see HBASE-16892 - */ - @Deprecated - public SnapshotDescription(String name, String table, SnapshotType type) { - this(name, TableName.valueOf(table), type); - } - public SnapshotDescription(String name, TableName table, SnapshotType type) { this(name, table, type, null, -1, -1, null); } - /** - * @see #SnapshotDescription(String, TableName, SnapshotType, String) - * @see HBASE-16892 - * @deprecated since 2.0.0 and will be removed in 3.0.0. Use the version with the TableName - * instance instead. - */ - @Deprecated - public SnapshotDescription(String name, String table, SnapshotType type, String owner) { - this(name, TableName.valueOf(table), type, owner); - } - public SnapshotDescription(String name, TableName table, SnapshotType type, String owner) { this(name, table, type, owner, -1, -1, null); } - /** - * @see #SnapshotDescription(String, TableName, SnapshotType, String, long, int, Map) - * @see HBASE-16892 - * @deprecated since 2.0.0 and will be removed in 3.0.0. Use the version with the TableName - * instance instead. - */ - @Deprecated - public SnapshotDescription(String name, String table, SnapshotType type, String owner, - long creationTime, int version) { - this(name, TableName.valueOf(table), type, owner, creationTime, version, null); - } - /** * SnapshotDescription Parameterized Constructor * @@ -141,18 +96,6 @@ public String getName() { return this.name; } - /** - * @deprecated since 2.0.0 and will be removed in 3.0.0. Use {@link #getTableName()} or - * {@link #getTableNameAsString()} instead. - * @see #getTableName() - * @see #getTableNameAsString() - * @see HBASE-16892 - */ - @Deprecated - public String getTable() { - return getTableNameAsString(); - } - public String getTableNameAsString() { return this.table.getNameAsString(); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java index 93e79c5fd11c..44363fa70749 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java @@ -1089,7 +1089,8 @@ public void preCloneSnapshot(final ObserverContext throws IOException { User user = getActiveUser(ctx); if (SnapshotDescriptionUtils.isSnapshotOwner(snapshot, user) - && hTableDescriptor.getTableName().getNameAsString().equals(snapshot.getTable())) { + && hTableDescriptor.getTableName().getNameAsString() + .equals(snapshot.getTableNameAsString())) { // Snapshot owner is allowed to create a table with the same name as the snapshot he took AuthResult result = AuthResult.allow("cloneSnapshot " + snapshot.getName(), "Snapshot owner check allowed", user, null, hTableDescriptor.getTableName(), null);