public Object getFieldValue(_Fields field) { switch (field) { case USER_PRIVILEGES: return getUserPrivileges(); case GROUP_PRIVILEGES: return getGroupPrivileges(); case ROLE_PRIVILEGES: return getRolePrivileges(); } throw new IllegalStateException(); }
if (privileges.getGroupPrivileges() != null && privileges.getGroupPrivileges().size() > 0) { Collection<List<PrivilegeGrantInfo>> groupPrivCollection = privileges .getGroupPrivileges().values(); List<String> groupPrivs = getPrivilegeStringList(groupPrivCollection); if (groupPrivs != null && groupPrivs.size() > 0) {
if (privileges.getGroupPrivileges() != null && privileges.getGroupPrivileges().size() > 0) { Collection<List<PrivilegeGrantInfo>> groupPrivCollection = privileges .getGroupPrivileges().values(); List<String> groupPrivs = getPrivilegeStringList(groupPrivCollection); if (groupPrivs != null && groupPrivs.size() > 0) {
private static void assertAuthInfoReturned(String user, String group, Partition partition) { assertNotNull(partition.getPrivileges()); assertEquals(Lists.newArrayList(), partition.getPrivileges().getUserPrivileges().get(user)); assertEquals(Lists.newArrayList(), partition.getPrivileges().getGroupPrivileges().get(group)); assertEquals(Lists.newArrayList(), partition.getPrivileges().getRolePrivileges().get("public")); }
private static void assertAuthInfoReturned(String user, String group, Partition partition) { assertNotNull(partition.getPrivileges()); assertEquals(Lists.newArrayList(), partition.getPrivileges().getUserPrivileges().get(user)); assertEquals(Lists.newArrayList(), partition.getPrivileges().getGroupPrivileges().get(group)); assertEquals(Lists.newArrayList(), partition.getPrivileges().getRolePrivileges().get("public")); }
putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, userPrivs, PrincipalType.USER, "SQL"); Map<String, List<PrivilegeGrantInfo>> groupPrivs = principalPrivs.getGroupPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, groupPrivs, PrincipalType.GROUP, "SQL");
public Object getFieldValue(_Fields field) { switch (field) { case USER_PRIVILEGES: return getUserPrivileges(); case GROUP_PRIVILEGES: return getGroupPrivileges(); case ROLE_PRIVILEGES: return getRolePrivileges(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case USER_PRIVILEGES: return getUserPrivileges(); case GROUP_PRIVILEGES: return getGroupPrivileges(); case ROLE_PRIVILEGES: return getRolePrivileges(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case USER_PRIVILEGES: return getUserPrivileges(); case GROUP_PRIVILEGES: return getGroupPrivileges(); case ROLE_PRIVILEGES: return getRolePrivileges(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case USER_PRIVILEGES: return getUserPrivileges(); case GROUP_PRIVILEGES: return getGroupPrivileges(); case ROLE_PRIVILEGES: return getRolePrivileges(); } throw new IllegalStateException(); }
if (privileges.getGroupPrivileges() != null && privileges.getGroupPrivileges().size() > 0) { Collection<List<PrivilegeGrantInfo>> groupPrivCollection = privileges .getGroupPrivileges().values(); List<String> groupPrivs = getPrivilegeStringList(groupPrivCollection); if (groupPrivs != null && groupPrivs.size() > 0) {
if (privileges.getGroupPrivileges() != null && privileges.getGroupPrivileges().size() > 0) { Collection<List<PrivilegeGrantInfo>> groupPrivCollection = privileges .getGroupPrivileges().values(); List<String> groupPrivs = getPrivilegeStringList(groupPrivCollection); if (groupPrivs != null && groupPrivs.size() > 0) {
@Override public void createTable(Table tbl) throws InvalidObjectException, MetaException { boolean commited = false; try { openTransaction(); MTable mtbl = convertToMTable(tbl); pm.makePersistent(mtbl); PrincipalPrivilegeSet principalPrivs = tbl.getPrivileges(); List<Object> toPersistPrivObjs = new ArrayList<Object>(); if (principalPrivs != null) { int now = (int)(System.currentTimeMillis()/1000); Map<String, List<PrivilegeGrantInfo>> userPrivs = principalPrivs.getUserPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, userPrivs, PrincipalType.USER); Map<String, List<PrivilegeGrantInfo>> groupPrivs = principalPrivs.getGroupPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, groupPrivs, PrincipalType.GROUP); Map<String, List<PrivilegeGrantInfo>> rolePrivs = principalPrivs.getRolePrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, rolePrivs, PrincipalType.ROLE); } pm.makePersistentAll(toPersistPrivObjs); commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } }
public void createTable(Table tbl) throws InvalidObjectException, MetaException { boolean commited = false; try { openTransaction(); MTable mtbl = convertToMTable(tbl); pm.makePersistent(mtbl); PrincipalPrivilegeSet principalPrivs = tbl.getPrivileges(); List<Object> toPersistPrivObjs = new ArrayList<Object>(); if (principalPrivs != null) { int now = (int)(System.currentTimeMillis()/1000); Map<String, List<PrivilegeGrantInfo>> userPrivs = principalPrivs.getUserPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, userPrivs, PrincipalType.USER); Map<String, List<PrivilegeGrantInfo>> groupPrivs = principalPrivs.getGroupPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, groupPrivs, PrincipalType.GROUP); Map<String, List<PrivilegeGrantInfo>> rolePrivs = principalPrivs.getRolePrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, rolePrivs, PrincipalType.ROLE); } pm.makePersistentAll(toPersistPrivObjs); commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } }
public void createTable(Table tbl) throws InvalidObjectException, MetaException { boolean commited = false; try { openTransaction(); MTable mtbl = convertToMTable(tbl); pm.makePersistent(mtbl); PrincipalPrivilegeSet principalPrivs = tbl.getPrivileges(); List<Object> toPersistPrivObjs = new ArrayList<Object>(); if (principalPrivs != null) { int now = (int)(System.currentTimeMillis()/1000); Map<String, List<PrivilegeGrantInfo>> userPrivs = principalPrivs.getUserPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, userPrivs, PrincipalType.USER); Map<String, List<PrivilegeGrantInfo>> groupPrivs = principalPrivs.getGroupPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, groupPrivs, PrincipalType.GROUP); Map<String, List<PrivilegeGrantInfo>> rolePrivs = principalPrivs.getRolePrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, rolePrivs, PrincipalType.ROLE); } pm.makePersistentAll(toPersistPrivObjs); commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } }
@Override public void createTable(Table tbl) throws InvalidObjectException, MetaException { boolean commited = false; try { openTransaction(); MTable mtbl = convertToMTable(tbl); pm.makePersistent(mtbl); PrincipalPrivilegeSet principalPrivs = tbl.getPrivileges(); List<Object> toPersistPrivObjs = new ArrayList<Object>(); if (principalPrivs != null) { int now = (int)(System.currentTimeMillis()/1000); Map<String, List<PrivilegeGrantInfo>> userPrivs = principalPrivs.getUserPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, userPrivs, PrincipalType.USER); Map<String, List<PrivilegeGrantInfo>> groupPrivs = principalPrivs.getGroupPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, groupPrivs, PrincipalType.GROUP); Map<String, List<PrivilegeGrantInfo>> rolePrivs = principalPrivs.getRolePrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, rolePrivs, PrincipalType.ROLE); } pm.makePersistentAll(toPersistPrivObjs); commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } }
@Override public void createTable(Table tbl) throws InvalidObjectException, MetaException { boolean commited = false; try { openTransaction(); MTable mtbl = convertToMTable(tbl); pm.makePersistent(mtbl); if (tbl.getCreationMetadata() != null) { MCreationMetadata mcm = convertToMCreationMetadata(tbl.getCreationMetadata()); pm.makePersistent(mcm); } PrincipalPrivilegeSet principalPrivs = tbl.getPrivileges(); List<Object> toPersistPrivObjs = new ArrayList<>(); if (principalPrivs != null) { int now = (int)(System.currentTimeMillis()/1000); Map<String, List<PrivilegeGrantInfo>> userPrivs = principalPrivs.getUserPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, userPrivs, PrincipalType.USER, "SQL"); Map<String, List<PrivilegeGrantInfo>> groupPrivs = principalPrivs.getGroupPrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, groupPrivs, PrincipalType.GROUP, "SQL"); Map<String, List<PrivilegeGrantInfo>> rolePrivs = principalPrivs.getRolePrivileges(); putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, rolePrivs, PrincipalType.ROLE, "SQL"); } pm.makePersistentAll(toPersistPrivObjs); commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } }