Codota Logo
NamespaceOperations.rename
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: apache/accumulo

@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
  throws AccumuloException, AccumuloSecurityException, TableNotFoundException,
  TableExistsException, NamespaceNotFoundException, NamespaceExistsException {
 String old = cl.getArgs()[0];
 String newer = cl.getArgs()[1];
 boolean resetContext = false;
 Table.ID currentTableId = null;
 if (!(shellState.getTableName() == null) && !shellState.getTableName().isEmpty()) {
  Namespace.ID namespaceId = Namespaces.getNamespaceId(shellState.getContext(), old);
  List<Table.ID> tableIds = Namespaces.getTableIds(shellState.getContext(), namespaceId);
  currentTableId = Tables.getTableId(shellState.getContext(), shellState.getTableName());
  resetContext = tableIds.contains(currentTableId);
 }
 shellState.getAccumuloClient().namespaceOperations().rename(old, newer);
 if (resetContext) {
  shellState.setTableName(Tables.getTableName(shellState.getContext(), currentTableId));
 }
 return 0;
}
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 srcName = namespaces.get(rand.nextInt(namespaces.size()));
  String newName = namespaces.get(rand.nextInt(namespaces.size()));

  try {
   conn.namespaceOperations().rename(srcName, newName);
   log.debug("Renamed namespace " + srcName + " " + newName);
  } catch (NamespaceExistsException e) {
   log.debug("Rename namespace " + srcName + " failed, " + newName + " exists");
  } catch (NamespaceNotFoundException e) {
   log.debug("Rename namespace " + srcName + " failed, doesn't exist");
  }
 }
}
origin: org.apache.accumulo/accumulo-shell

@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
  throws AccumuloException, AccumuloSecurityException, TableNotFoundException,
  TableExistsException, NamespaceNotFoundException, NamespaceExistsException {
 String old = cl.getArgs()[0];
 String newer = cl.getArgs()[1];
 boolean resetContext = false;
 String currentTableId = "";
 if (!(shellState.getTableName() == null) && !shellState.getTableName().isEmpty()) {
  String namespaceId = Namespaces.getNamespaceId(shellState.getInstance(), old);
  List<String> tableIds = Namespaces.getTableIds(shellState.getInstance(), namespaceId);
  currentTableId = Tables.getTableId(shellState.getInstance(), shellState.getTableName());
  resetContext = tableIds.contains(currentTableId);
 }
 shellState.getConnector().namespaceOperations().rename(old, newer);
 if (resetContext) {
  shellState.setTableName(Tables.getTableName(shellState.getInstance(), currentTableId));
 }
 return 0;
}
origin: org.apache.accumulo/accumulo-proxy

@Override
public void renameNamespace(ByteBuffer login, String oldNamespaceName, String newNamespaceName)
  throws org.apache.accumulo.proxy.thrift.AccumuloException,
  org.apache.accumulo.proxy.thrift.AccumuloSecurityException,
  org.apache.accumulo.proxy.thrift.NamespaceNotFoundException,
  org.apache.accumulo.proxy.thrift.NamespaceExistsException, TException {
 try {
  getConnector(login).namespaceOperations().rename(oldNamespaceName, newNamespaceName);
 } catch (NamespaceNotFoundException e) {
  throw new org.apache.accumulo.proxy.thrift.NamespaceNotFoundException(e.toString());
 } catch (NamespaceExistsException e) {
  throw new org.apache.accumulo.proxy.thrift.NamespaceExistsException(e.toString());
 } catch (Exception e) {
  handleException(e);
 }
}
origin: org.apache.accumulo/accumulo-test

 break;
case 11:
 ops.rename(namespace, namespace + "2");
 fail();
 break;
 ops.create(namespace + i + "_1");
 ops.create(namespace + i + "_2");
 ops.rename(namespace + i + "_1", namespace + i + "_2"); // should fail here
 fail();
 break;
case 4:
 ops.create(namespace + i + "_1");
 ops.rename(namespace + i + "_1", Namespaces.DEFAULT_NAMESPACE); // should fail here
 fail();
 break;
case 5:
 ops.create(namespace + i + "_1");
 ops.rename(namespace + i + "_1", Namespaces.ACCUMULO_NAMESPACE); // should fail here
 fail();
 break;
origin: org.apache.accumulo/accumulo-test

@Test
public void renameNamespaceWithTable() throws Exception {
 String namespace2 = namespace + "_renamed";
 String t1 = namespace + ".t";
 String t2 = namespace2 + ".t";
 c.namespaceOperations().create(namespace);
 c.tableOperations().create(t1);
 assertTrue(c.namespaceOperations().exists(namespace));
 assertTrue(c.tableOperations().exists(t1));
 assertFalse(c.namespaceOperations().exists(namespace2));
 assertFalse(c.tableOperations().exists(t2));
 String namespaceId = c.namespaceOperations().namespaceIdMap().get(namespace);
 String tableId = c.tableOperations().tableIdMap().get(t1);
 c.namespaceOperations().rename(namespace, namespace2);
 assertFalse(c.namespaceOperations().exists(namespace));
 assertFalse(c.tableOperations().exists(t1));
 assertTrue(c.namespaceOperations().exists(namespace2));
 assertTrue(c.tableOperations().exists(t2));
 // verify id's didn't change
 String namespaceId2 = c.namespaceOperations().namespaceIdMap().get(namespace2);
 String tableId2 = c.tableOperations().tableIdMap().get(t2);
 assertEquals(namespaceId, namespaceId2);
 assertEquals(tableId, tableId2);
}
origin: org.apache.accumulo/accumulo-test

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

try {
 loginAs(testUser);
 test_user_conn.namespaceOperations().rename(namespace, namespace2);
 throw new IllegalStateException("Should NOT be able to rename a namespace");
} catch (AccumuloSecurityException e) {
org.apache.accumulo.core.client.adminNamespaceOperationsrename

Javadoc

Rename a 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.
  • 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.
  • namespaceIdMap,
  • removeConstraint,
  • removeIterator,
  • removeProperty,
  • setProperty,
  • testClassLoad,
  • checkIteratorConflicts,
  • defaultNamespace,
  • systemNamespace

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Runner (org.openjdk.jmh.runner)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now