Tabnine Logo
NamespaceOperations.list
Code IndexAdd Tabnine to your IDE (free)

How to use
list
method
in
org.apache.accumulo.core.client.admin.NamespaceOperations

Best Java code snippets using org.apache.accumulo.core.client.admin.NamespaceOperations.list (Showing top 15 results out of 315)

origin: apache/accumulo

 namespaces = accumuloClient.namespaceOperations().list();
} catch (Exception e) {
 log.debug("Unable to obtain list of namespaces", e);
origin: apache/accumulo

@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
  justification = "code runs in same security context as user who provided input")
private static void printUserConfiguration(AccumuloClient accumuloClient, String user,
  File outputDirectory) throws IOException, AccumuloException, AccumuloSecurityException {
 File userScript = new File(outputDirectory, user + USER_FILE_SUFFIX);
 FileWriter userWriter = new FileWriter(userScript);
 userWriter.write(createUserFormat.format(new String[] {user}));
 Authorizations auths = accumuloClient.securityOperations().getUserAuthorizations(user);
 userWriter.write(userAuthsFormat.format(new String[] {user, auths.toString()}));
 for (SystemPermission sp : SystemPermission.values()) {
  if (accumuloClient.securityOperations().hasSystemPermission(user, sp)) {
   userWriter.write(sysPermFormat.format(new String[] {sp.name(), user}));
  }
 }
 for (String namespace : accumuloClient.namespaceOperations().list()) {
  for (NamespacePermission np : NamespacePermission.values()) {
   if (accumuloClient.securityOperations().hasNamespacePermission(user, namespace, np)) {
    userWriter.write(nsPermFormat.format(new String[] {np.name(), namespace, user}));
   }
  }
 }
 for (String tableName : accumuloClient.tableOperations().list()) {
  for (TablePermission perm : TablePermission.values()) {
   if (accumuloClient.securityOperations().hasTablePermission(user, tableName, perm)) {
    userWriter.write(tablePermFormat.format(new String[] {perm.name(), tableName, user}));
   }
  }
 }
 userWriter.close();
}
origin: apache/accumulo

for (String namespace : context.namespaceOperations().list()) {
 printNameSpaceConfiguration(context, namespace, outputDirectory);
 for (String namespace : context.namespaceOperations().list()) {
  printNameSpaceConfiguration(context, namespace, outputDirectory);
origin: org.apache.accumulo/accumulo-proxy

@Override
public List<String> listNamespaces(ByteBuffer login)
  throws org.apache.accumulo.proxy.thrift.AccumuloException,
  org.apache.accumulo.proxy.thrift.AccumuloSecurityException, TException {
 try {
  return new LinkedList<>(getConnector(login).namespaceOperations().list());
 } catch (Exception e) {
  handleException(e);
  return null;
 }
}
origin: apache/accumulo

for (String n : shellState.getAccumuloClient().namespaceOperations().list()) {
 delim = "";
 for (NamespacePermission p : NamespacePermission.values()) {
origin: org.apache.accumulo/accumulo-shell

 namespaces = connector.namespaceOperations().list();
} catch (Exception e) {
 log.debug("Unable to obtain list of namespaces", e);
origin: org.apache.accumulo/accumulo-server-base

private static void printUserConfiguration(Connector connector, String user, File outputDirectory)
  throws IOException, AccumuloException, AccumuloSecurityException {
 File userScript = new File(outputDirectory, user + USER_FILE_SUFFIX);
 FileWriter userWriter = new FileWriter(userScript);
 userWriter.write(createUserFormat.format(new String[] {user}));
 Authorizations auths = connector.securityOperations().getUserAuthorizations(user);
 userWriter.write(userAuthsFormat.format(new String[] {user, auths.toString()}));
 for (SystemPermission sp : SystemPermission.values()) {
  if (connector.securityOperations().hasSystemPermission(user, sp)) {
   userWriter.write(sysPermFormat.format(new String[] {sp.name(), user}));
  }
 }
 for (String namespace : connector.namespaceOperations().list()) {
  for (NamespacePermission np : NamespacePermission.values()) {
   if (connector.securityOperations().hasNamespacePermission(user, namespace, np)) {
    userWriter.write(nsPermFormat.format(new String[] {np.name(), namespace, user}));
   }
  }
 }
 for (String tableName : connector.tableOperations().list()) {
  for (TablePermission perm : TablePermission.values()) {
   if (connector.securityOperations().hasTablePermission(user, tableName, perm)) {
    userWriter.write(tablePermFormat.format(new String[] {perm.name(), tableName, user}));
   }
  }
 }
 userWriter.close();
}
origin: org.apache.accumulo/accumulo-test

@Test
public void listNamespaces() throws Exception {
 SortedSet<String> namespaces = c.namespaceOperations().list();
 Map<String,String> map = c.namespaceOperations().namespaceIdMap();
 assertEquals(2, namespaces.size());
 namespaces = c.namespaceOperations().list();
 map = c.namespaceOperations().namespaceIdMap();
 assertEquals(3, namespaces.size());
 namespaces = c.namespaceOperations().list();
 map = c.namespaceOperations().namespaceIdMap();
 assertEquals(2, namespaces.size());
origin: org.apache.accumulo/accumulo-test

@After
public void swingMjölnir() throws Exception {
 if (null == c) {
  return;
 }
 // clean up any added tables, namespaces, and users, after each test
 for (String t : c.tableOperations().list())
  if (!Tables.qualify(t).getFirst().equals(Namespaces.ACCUMULO_NAMESPACE))
   c.tableOperations().delete(t);
 assertEquals(3, c.tableOperations().list().size());
 for (String n : c.namespaceOperations().list())
  if (!n.equals(Namespaces.ACCUMULO_NAMESPACE) && !n.equals(Namespaces.DEFAULT_NAMESPACE))
   c.namespaceOperations().delete(n);
 assertEquals(2, c.namespaceOperations().list().size());
 for (String u : c.securityOperations().listLocalUsers())
  if (!getAdminPrincipal().equals(u))
   c.securityOperations().dropLocalUser(u);
 assertEquals(1, c.securityOperations().listLocalUsers().size());
}
origin: org.apache.accumulo/accumulo-test

private void changeNamespaceSetting(RandomDataGenerator random, State state, Environment env,
  Properties props) throws Exception {
 // pick a random property
 int choice = random.nextInt(0, tableSettings.length - 1);
 Setting setting = tableSettings[choice];
 // pick a random table
 SortedSet<String> namespaces = env.getConnector().namespaceOperations().list().tailSet("nspc")
   .headSet("nspd");
 if (namespaces.isEmpty())
  return;
 String namespace = random.nextSample(namespaces, 1)[0].toString();
 // generate a random value
 long newValue = random.nextLong(setting.min, setting.max);
 state.set(LAST_NAMESPACE_SETTING, namespace + "," + choice);
 log.debug(
   "Setting " + setting.property.getKey() + " on namespace " + namespace + " to " + newValue);
 try {
  env.getConnector().namespaceOperations().setProperty(namespace, setting.property.getKey(),
    "" + newValue);
 } catch (AccumuloException ex) {
  if (ex.getCause() instanceof ThriftTableOperationException) {
   ThriftTableOperationException ttoe = (ThriftTableOperationException) ex.getCause();
   if (ttoe.type == TableOperationExceptionType.NAMESPACE_NOTFOUND)
    return;
  }
  throw ex;
 }
}
origin: org.apache.accumulo/accumulo-server-base

for (String namespace : connector.namespaceOperations().list()) {
 printNameSpaceConfiguration(connector, namespace, outputDirectory);
 for (String namespace : connector.namespaceOperations().list()) {
  printNameSpaceConfiguration(connector, namespace, outputDirectory);
origin: NationalSecurityAgency/datawave

SortedSet<String> namespaces = nops.list();
NamespacePermission[] allNamespacePerms = NamespacePermission.values();
for (String next : namespaces) {
origin: org.apache.accumulo/accumulo-test

test_user_conn.namespaceOperations().create(namespace);
loginAs(rootUser);
if (!root_conn.namespaceOperations().list().contains(namespace))
 throw new IllegalStateException("Should be able to create a namespace");
break;
test_user_conn.namespaceOperations().delete(namespace);
loginAs(rootUser);
if (root_conn.namespaceOperations().list().contains(namespace))
 throw new IllegalStateException("Should be able to delete a namespace");
break;
test_user_conn.namespaceOperations().rename(namespace, namespace2);
loginAs(rootUser);
if (root_conn.namespaceOperations().list().contains(namespace)
  || !root_conn.namespaceOperations().list().contains(namespace2))
 throw new IllegalStateException("Should be able to rename a table");
break;
origin: org.apache.accumulo/accumulo-test

loginAs(rootUser);
if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
  || root_conn.namespaceOperations().list().contains(namespace))
 throw e;
loginAs(rootUser);
if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
  || !root_conn.namespaceOperations().list().contains(namespace))
 throw e;
loginAs(rootUser);
if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
  || !root_conn.namespaceOperations().list().contains(namespace)
  || root_conn.namespaceOperations().list().contains(namespace2))
 throw e;
origin: org.apache.accumulo/accumulo-shell

for (String n : shellState.getConnector().namespaceOperations().list()) {
 delim = "";
 for (NamespacePermission p : NamespacePermission.values()) {
org.apache.accumulo.core.client.adminNamespaceOperationslist

Javadoc

Retrieve a list of namespaces in Accumulo.

Popular methods of NamespaceOperations

  • create
    Create an empty namespace with no initial configuration. Valid names for a namespace contain letters
  • exists
    A method to check if a namespace exists in Accumulo.
  • getProperties
    Gets properties of a namespace, which are inherited by tables in this namespace. Note that recently
  • addConstraint
    Add a new constraint to a namespace.
  • attachIterator
    Add an iterator to a namespace on the given scopes.
  • delete
    Delete an empty namespace
  • getIteratorSetting
    Get the settings for an iterator.
  • listConstraints
    List constraints on a namespace with their assigned numbers.
  • listIterators
    Get a list of iterators for this namespace.
  • namespaceIdMap
    Get a mapping of namespace name to internal namespace id.
  • removeConstraint
    Remove a constraint from a namespace.
  • removeIterator
    Remove an iterator from a namespace by name.
  • removeConstraint,
  • removeIterator,
  • removeProperty,
  • rename,
  • setProperty,
  • testClassLoad,
  • checkIteratorConflicts,
  • defaultNamespace,
  • systemNamespace

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • compareTo (BigDecimal)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now