@Test public void testListPrivilegesURI() { CommonPrivilege uri1Select = create(new KeyValue("Server", "server1"), new KeyValue("uri", "hdfs: CommonPrivilege uri2Select = create(new KeyValue("Server", "server1"), new KeyValue("uri", "hdfs: SimplePrivilegeCache cache = new SimplePrivilegeCache(Sets.newHashSet(uri1Select.toString(), uri2Select.toString())); assertEquals(2, cache.listPrivileges(null, null, null).size()); }
@Override public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) { if (cachedPrivileges == null) { cachedPrivileges = new HashSet<String>(); } return cachedPrivileges; }
SimplePrivilegeCache implements PrivilegeCache { @Override public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) { if (cachedPrivileges == null) { cachedPrivileges = new HashSet<String>(); } return cachedPrivileges; } }
SimplePrivilegeCache implements PrivilegeCache { @Override public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) { if (cachedPrivileges == null) { cachedPrivileges = new HashSet<String>(); } return cachedPrivileges; } SimplePrivilegeCache(Set<String> cachedPrivileges); }
SimplePrivilegeCache implements PrivilegeCache { @Override public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) { if (cachedPrivileges == null) { cachedPrivileges = new HashSet<String>(); } return cachedPrivileges; } SimplePrivilegeCache(Set<String> cachedPrivileges); @Override Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet); @Override void close(); @Override Set<String> listPrivileges(Set<String> groups, Set<String> users, ActiveRoleSet roleSet); }
SimplePrivilegeCache implements PrivilegeCache { @Override public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) { if (cachedPrivileges == null) { cachedPrivileges = new HashSet<String>(); } return cachedPrivileges; } SimplePrivilegeCache(Set<String> cachedPrivileges); @Override Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet); @Override void close(); @Override Set<String> listPrivileges(Set<String> groups, Set<String> users, ActiveRoleSet roleSet);  }