HBASE-22829 Removed deprecated methods from SnapshotDescription

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Jan Hentschel 2019-08-12 08:41:05 +02:00 committed by GitHub
parent e9382154f3
commit 3867fae04d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 58 deletions

View File

@ -41,63 +41,18 @@ public class SnapshotDescription {
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 <a href="https://issues.apache.org/jira/browse/HBASE-16892">HBASE-16892</a>
*/
@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 <a href="https://issues.apache.org/jira/browse/HBASE-16892">HBASE-16892</a>
*/
@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 <a href="https://issues.apache.org/jira/browse/HBASE-16892">HBASE-16892</a>
* @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 <a href="https://issues.apache.org/jira/browse/HBASE-16892">HBASE-16892</a>
* @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 class SnapshotDescription {
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 <a href="https://issues.apache.org/jira/browse/HBASE-16892">HBASE-16892</a>
*/
@Deprecated
public String getTable() {
return getTableNameAsString();
}
public String getTableNameAsString() {
return this.table.getNameAsString();
}

View File

@ -1089,7 +1089,8 @@ public class AccessController implements MasterCoprocessor, RegionCoprocessor,
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);