Index: metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (revision 1101748) +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (working copy) @@ -294,7 +294,10 @@ @InterfaceAudience.LimitedPrivate({"HCATALOG"}) @InterfaceStability.Evolving public static class Command { - T run(RawStore ms) throws Exception { + + @InterfaceAudience.LimitedPrivate({"HCATALOG"}) + @InterfaceStability.Evolving + public T run(RawStore ms) throws Exception { return null; } } @@ -462,7 +465,7 @@ try { executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { createDefaultDB_core(ms); return Boolean.TRUE; } @@ -584,7 +587,7 @@ } executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { create_database_core(ms, db); return Boolean.TRUE; } @@ -610,7 +613,7 @@ try { db = executeWithRetry(new Command() { @Override - Database run(RawStore ms) throws Exception { + public Database run(RawStore ms) throws Exception { return ms.getDatabase(name); } }); @@ -633,7 +636,7 @@ try { executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { return ms.alterDatabase(dbName, db); } }); @@ -698,7 +701,7 @@ try { executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { drop_database_core(ms, dbName, deleteData, cascade); return Boolean.TRUE; } @@ -724,7 +727,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.getDatabases(pattern); } }); @@ -746,7 +749,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.getAllDatabases(); } }); @@ -789,7 +792,7 @@ try { ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { create_type_core(ms, type); return Boolean.TRUE; } @@ -817,7 +820,7 @@ try { ret = executeWithRetry(new Command() { @Override - Type run(RawStore ms) throws Exception { + public Type run(RawStore ms) throws Exception { Type type = ms.getType(name); if (null == type) { throw new NoSuchObjectException("Type \"" + name + "\" not found."); @@ -871,7 +874,7 @@ try { ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { // TODO:pc validate that there are no types that refer to this return ms.dropType(name); } @@ -971,7 +974,7 @@ try { executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { create_table_core(ms, tbl); return Boolean.TRUE; } @@ -1069,7 +1072,7 @@ try { executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { drop_table_core(ms, dbname, name, deleteData); return Boolean.TRUE; } @@ -1109,7 +1112,7 @@ try { t = executeWithRetry(new Command() { @Override - Table run(RawStore ms) throws Exception { + public Table run(RawStore ms) throws Exception { Table t = ms.getTable(dbname, name); if (t == null) { throw new NoSuchObjectException(dbname + "." + name @@ -1221,7 +1224,7 @@ try { ret = executeWithRetry(new Command() { @Override - Partition run(RawStore ms) throws Exception { + public Partition run(RawStore ms) throws Exception { return append_partition_common(ms, dbName, tableName, part_vals); } }); @@ -1273,7 +1276,7 @@ try { ret = executeWithRetry(new Command() { @Override - Integer run(RawStore ms) throws Exception { + public Integer run(RawStore ms) throws Exception { int ret = add_partitions_core(ms, parts); return Integer.valueOf(ret); } @@ -1383,7 +1386,7 @@ try { ret = executeWithRetry(new Command() { @Override - Partition run(RawStore ms) throws Exception { + public Partition run(RawStore ms) throws Exception { return add_partition_core(ms, part); } }); @@ -1478,7 +1481,7 @@ try { ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { return Boolean.valueOf( drop_partition_common(ms, db_name, tbl_name, part_vals, deleteData)); } @@ -1507,7 +1510,7 @@ try { ret = executeWithRetry(new Command() { @Override - Partition run(RawStore ms) throws Exception { + public Partition run(RawStore ms) throws Exception { return ms.getPartition(db_name, tbl_name, part_vals); } }); @@ -1536,7 +1539,7 @@ try { ret = executeWithRetry(new Command() { @Override - Partition run(RawStore ms) throws Exception { + public Partition run(RawStore ms) throws Exception { return ms.getPartitionWithAuth(db_name, tbl_name, part_vals, user_name, group_names); } @@ -1562,7 +1565,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.getPartitions(db_name, tbl_name, max_parts); } }); @@ -1591,7 +1594,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.getPartitionsWithAuth(dbName, tblName, maxParts, userName, groupNames); } @@ -1618,7 +1621,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.listPartitionNames(db_name, tbl_name, max_parts); } }); @@ -1659,7 +1662,7 @@ try { executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { alter_partition_core(ms, db_name, tbl_name, new_part); return Boolean.TRUE; } @@ -1697,7 +1700,7 @@ try { executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { ms.alterIndex(dbname, base_table_name, index_name, newIndex); return Boolean.TRUE; } @@ -1736,7 +1739,7 @@ try { executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { alterHandler.alterTable(ms, wh, dbname, name, newTable); return Boolean.TRUE; } @@ -1761,7 +1764,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.getTables(dbname, pattern); } }); @@ -1783,7 +1786,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.getAllTables(dbname); } }); @@ -1965,7 +1968,7 @@ try { ret = executeWithRetry(new Command() { @Override - Partition run(RawStore ms) throws Exception { + public Partition run(RawStore ms) throws Exception { return get_partition_by_name_core(ms, db_name, tbl_name, part_name); } }); @@ -1994,7 +1997,7 @@ try { ret = executeWithRetry(new Command() { @Override - Partition run(RawStore ms) throws Exception { + public Partition run(RawStore ms) throws Exception { List partVals = getPartValsFromName(ms, db_name, tbl_name, part_name); return append_partition_common(ms, db_name, tbl_name, partVals); } @@ -2042,7 +2045,7 @@ try { ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { return drop_partition_by_name_core(ms, db_name, tbl_name, part_name, deleteData); } @@ -2177,7 +2180,7 @@ try { ret = executeWithRetry(new Command() { @Override - Index run(RawStore ms) throws Exception { + public Index run(RawStore ms) throws Exception { return add_index_core(ms, newIndex, indexTable); } }); @@ -2264,7 +2267,7 @@ try { ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { return drop_index_by_name_core(ms, dbName, tblName, indexName, deleteData); } @@ -2349,7 +2352,7 @@ try { ret = executeWithRetry(new Command() { @Override - Index run(RawStore ms) throws Exception { + public Index run(RawStore ms) throws Exception { return get_index_by_name_core(ms, dbName, tblName, indexName); } }); @@ -2389,7 +2392,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.listIndexNames(dbName, tblName, maxIndexes); } }); @@ -2414,7 +2417,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.getIndexes(dbName, tblName, maxIndexes); } }); @@ -2439,7 +2442,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.getPartitionsByFilter(dbName, tblName, filter, maxParts); } }); @@ -2467,7 +2470,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.getPartitionsByNames(dbName, tblName, partNames); } }); @@ -2533,7 +2536,7 @@ try { ret = executeWithRetry(new Command() { @Override - PrincipalPrivilegeSet run(RawStore ms) throws Exception { + public PrincipalPrivilegeSet run(RawStore ms) throws Exception { return ms.getColumnPrivilegeSet( dbName, tableName, partName, columnName, userName, groupNames); } @@ -2555,7 +2558,7 @@ try { ret = executeWithRetry(new Command() { @Override - PrincipalPrivilegeSet run(RawStore ms) throws Exception { + public PrincipalPrivilegeSet run(RawStore ms) throws Exception { return ms.getDBPrivilegeSet(dbName, userName, groupNames); } }); @@ -2577,7 +2580,7 @@ try { ret = executeWithRetry(new Command() { @Override - PrincipalPrivilegeSet run(RawStore ms) throws Exception { + public PrincipalPrivilegeSet run(RawStore ms) throws Exception { return ms.getPartitionPrivilegeSet(dbName, tableName, partName, userName, groupNames); } @@ -2599,7 +2602,7 @@ try { ret = executeWithRetry(new Command() { @Override - PrincipalPrivilegeSet run(RawStore ms) throws Exception { + public PrincipalPrivilegeSet run(RawStore ms) throws Exception { return ms.getTablePrivilegeSet(dbName, tableName, userName, groupNames); } @@ -2623,7 +2626,7 @@ try { ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { Role role = ms.getRole(roleName); return ms.grantRole(role, userName, principalType, grantor, grantorType, grantOption); } @@ -2644,7 +2647,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { List result = new ArrayList(); List roleMap = ms.listRoles(principalName, principalType); if (roleMap!=null) { @@ -2675,7 +2678,7 @@ ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { return ms.addRole(role.getRoleName(), role.getOwnerName()); } }); @@ -2696,7 +2699,7 @@ try { ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { return ms.removeRole(roleName); } }); @@ -2716,7 +2719,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { return ms.listRoleNames(); } }); @@ -2738,7 +2741,7 @@ try { ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { return ms.grantPrivileges(privileges); } }); @@ -2760,7 +2763,7 @@ try { ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { Role mRole = ms.getRole(roleName); return ms.revokeRole(mRole, userName, principalType); } @@ -2782,7 +2785,7 @@ try { ret = executeWithRetry(new Command() { @Override - Boolean run(RawStore ms) throws Exception { + public Boolean run(RawStore ms) throws Exception { return ms.revokePrivileges(privileges); } }); @@ -2802,7 +2805,7 @@ try { ret = executeWithRetry(new Command() { @Override - PrincipalPrivilegeSet run(RawStore ms) throws Exception { + public PrincipalPrivilegeSet run(RawStore ms) throws Exception { return ms.getUserPrivilegeSet(userName, groupNames); } }); @@ -2852,7 +2855,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { String partName = null; if (partValues != null && partValues.size()>0) { Table tbl = get_table(dbName, tableName); @@ -2925,7 +2928,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { List mDbs = ms.listPrincipalDBGrants( principalName, principalType, dbName); if (mDbs.size() > 0) { @@ -2964,7 +2967,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { Table tbl = get_table(dbName, tableName); String partName = Warehouse.makePartName(tbl.getPartitionKeys(), partValues); List mParts = ms.listPrincipalPartitionGrants( @@ -3008,7 +3011,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { List mTbls = ms .listAllTableGrants(principalName, principalType, dbName, tableName); if (mTbls.size() > 0) { @@ -3046,7 +3049,7 @@ try { ret = executeWithRetry(new Command>() { @Override - List run(RawStore ms) throws Exception { + public List run(RawStore ms) throws Exception { List mUsers = ms.listPrincipalGlobalGrants( principalName, principalType); if (mUsers.size() > 0) {