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

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

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

origin: apache/accumulo

protected void doTableOp(final Shell shellState, final String namespace, boolean force)
  throws Exception {
 boolean resetContext = false;
 String currentTable = shellState.getTableName();
 Namespace.ID namespaceId = Namespaces.getNamespaceId(shellState.getContext(), namespace);
 List<String> tables = Namespaces.getTableNames(shellState.getContext(), namespaceId);
 resetContext = tables.contains(currentTable);
 if (force)
  for (String table : shellState.getAccumuloClient().tableOperations().list())
   if (table.startsWith(namespace + "."))
    shellState.getAccumuloClient().tableOperations().delete(table);
 shellState.getAccumuloClient().namespaceOperations().delete(namespace);
 if (resetContext) {
  shellState.setTableName("");
 }
}
origin: org.apache.accumulo/accumulo-test

@Test(expected = AccumuloSecurityException.class)
public void deleteAccumuloNamespace() throws Exception {
 c.namespaceOperations().delete(Namespaces.ACCUMULO_NAMESPACE); // should fail
}
origin: org.apache.accumulo/accumulo-test

@Test(expected = AccumuloSecurityException.class)
public void deleteDefaultNamespace() throws Exception {
 c.namespaceOperations().delete(Namespaces.DEFAULT_NAMESPACE); // should fail
}
origin: org.apache.accumulo/accumulo-test

 @Override
 public void visit(State state, Environment env, Properties props) throws Exception {
  Connector conn = env.getConnector();

  Random rand = (Random) state.get("rand");

  @SuppressWarnings("unchecked")
  List<String> namespaces = (List<String>) state.get("namespaces");

  String namespace = namespaces.get(rand.nextInt(namespaces.size()));

  try {
   conn.namespaceOperations().delete(namespace);
   log.debug("Deleted namespace " + namespace);
  } catch (NamespaceNotFoundException e) {
   log.debug("Delete namespace " + namespace + " failed, doesnt exist");
  } catch (NamespaceNotEmptyException e) {
   log.debug("Delete namespace " + namespace + " failed, not empty");
  }
 }
}
origin: org.apache.accumulo/accumulo-test

assertNotNull(map.get(namespace));
c.namespaceOperations().delete(namespace);
namespaces = c.namespaceOperations().list();
map = c.namespaceOperations().namespaceIdMap();
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-proxy

@Override
public void deleteNamespace(ByteBuffer login, String namespaceName)
  throws org.apache.accumulo.proxy.thrift.AccumuloException,
  org.apache.accumulo.proxy.thrift.AccumuloSecurityException,
  org.apache.accumulo.proxy.thrift.NamespaceNotFoundException,
  org.apache.accumulo.proxy.thrift.NamespaceNotEmptyException, TException {
 try {
  getConnector(login).namespaceOperations().delete(namespaceName);
 } catch (NamespaceNotFoundException e) {
  throw new org.apache.accumulo.proxy.thrift.NamespaceNotFoundException(e.toString());
 } catch (NamespaceNotEmptyException e) {
  throw new org.apache.accumulo.proxy.thrift.NamespaceNotEmptyException(e.toString());
 } catch (Exception e) {
  handleException(e);
 }
}
origin: org.apache.accumulo/accumulo-shell

protected void doTableOp(final Shell shellState, final String namespace, boolean force)
  throws Exception {
 boolean resetContext = false;
 String currentTable = shellState.getTableName();
 if (!Namespaces.getNameToIdMap(shellState.getInstance()).containsKey(namespace)) {
  throw new NamespaceNotFoundException(null, namespace, null);
 }
 String namespaceId = Namespaces.getNamespaceId(shellState.getInstance(), namespace);
 List<String> tables = Namespaces.getTableNames(shellState.getInstance(), namespaceId);
 resetContext = tables.contains(currentTable);
 if (force)
  for (String table : shellState.getConnector().tableOperations().list())
   if (table.startsWith(namespace + "."))
    shellState.getConnector().tableOperations().delete(table);
 shellState.getConnector().namespaceOperations().delete(namespace);
 if (resetContext) {
  shellState.setTableName("");
 }
}
origin: org.apache.accumulo/accumulo-test

log.debug("Dropping namespace: " + secNamespaceName);
conn.namespaceOperations().delete(secNamespaceName);
origin: org.apache.accumulo/accumulo-test

  NamespacePermission.READ));
c.namespaceOperations().delete(namespace);
origin: org.apache.accumulo/accumulo-test

@Test(expected = NamespaceNotEmptyException.class)
public void deleteNonEmptyNamespace() throws Exception {
 String tableName1 = namespace + ".1";
 assertFalse(c.namespaceOperations().exists(namespace));
 assertFalse(c.tableOperations().exists(tableName1));
 c.namespaceOperations().create(namespace);
 c.tableOperations().create(tableName1);
 assertTrue(c.namespaceOperations().exists(namespace));
 assertTrue(c.tableOperations().exists(tableName1));
 c.namespaceOperations().delete(namespace); // should fail
}
origin: org.apache.accumulo/accumulo-test

 break;
case 3:
 ops.delete(namespace);
 fail();
 break;
origin: org.apache.accumulo/accumulo-test

root_conn.namespaceOperations().create(namespace);
loginAs(testUser);
test_user_conn.namespaceOperations().delete(namespace);
loginAs(rootUser);
if (root_conn.namespaceOperations().list().contains(namespace))
origin: org.apache.accumulo/accumulo-test

try {
 loginAs(testUser);
 test_user_conn.namespaceOperations().delete(namespace);
 throw new IllegalStateException("Should NOT be able to delete a namespace");
} catch (AccumuloSecurityException e) {
origin: org.apache.accumulo/accumulo-test

assertFalse(c.tableOperations().exists(t2));
try {
 c.namespaceOperations().delete(namespace);
} catch (NamespaceNotFoundException e) {}
try {
assertFalse(c.tableOperations().exists(t1));
assertFalse(c.tableOperations().exists(t2));
c.namespaceOperations().delete(namespace);
assertFalse(c.namespaceOperations().exists(namespace));
assertFalse(c.tableOperations().exists(t1));
origin: org.apache.accumulo/accumulo-test

loginAs(user1);
try {
 user1Con.namespaceOperations().delete(n2);
 fail();
} catch (AccumuloSecurityException e) {
c.securityOperations().grantSystemPermission(u1, SystemPermission.DROP_NAMESPACE);
loginAs(user1);
user1Con.namespaceOperations().delete(n2);
loginAs(root);
c.securityOperations().revokeSystemPermission(u1, SystemPermission.DROP_NAMESPACE);
origin: org.apache.accumulo/accumulo-test

c.tableOperations().delete(t2);
c.tableOperations().delete(t0);
c.namespaceOperations().delete(namespace);
org.apache.accumulo.core.client.adminNamespaceOperationsdelete

Javadoc

Delete an empty namespace

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.
  • list
    Retrieve a list of namespaces 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.
  • 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

  • Finding current android device location
  • putExtra (Intent)
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • From CI to AI: The AI layer in your organization
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