Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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
*
Expand Down Expand Up @@ -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 <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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,8 @@ public void preCloneSnapshot(final ObserverContext<MasterCoprocessorEnvironment>
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);
Expand Down