HBASE-16207 can't restore snapshot without "Admin" permission

This commit is contained in:
Matteo Bertozzi 2016-07-12 05:55:07 -07:00
parent 7fa311a940
commit 36a48a3cf9
2 changed files with 3 additions and 3 deletions

View File

@ -2596,7 +2596,7 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
* @throws IOException if the namespace manager is not ready yet.
* @throws NamespaceNotFoundException if the namespace does not exists
*/
private void ensureNamespaceExists(final String name)
protected void ensureNamespaceExists(final String name)
throws IOException, NamespaceNotFoundException {
checkNamespaceManagerReady();
NamespaceDescriptor nsd = tableNamespaceManager.get(name);

View File

@ -1277,9 +1277,9 @@ public class MasterRpcServices extends RSRpcServices
master.checkInitialized();
master.snapshotManager.checkSnapshotSupport();
// ensure namespace exists
// ensure namespace exists
TableName dstTable = TableName.valueOf(request.getSnapshot().getTable());
master.getNamespaceDescriptor(dstTable.getNamespaceAsString());
master.ensureNamespaceExists(dstTable.getNamespaceAsString());
SnapshotDescription reqSnapshot = request.getSnapshot();
master.snapshotManager.restoreSnapshot(reqSnapshot);