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

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

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

origin: apache/accumulo

@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
  justification = "code runs in same security context as user who provided input")
private void printNameSpaceConfiguration(AccumuloClient accumuloClient, String namespace,
  File outputDirectory)
  throws IOException, AccumuloException, AccumuloSecurityException, NamespaceNotFoundException {
 File namespaceScript = new File(outputDirectory, namespace + NS_FILE_SUFFIX);
 FileWriter nsWriter = new FileWriter(namespaceScript);
 nsWriter.write(createNsFormat.format(new String[] {namespace}));
 TreeMap<String,String> props = new TreeMap<>();
 for (Entry<String,String> p : accumuloClient.namespaceOperations().getProperties(namespace)) {
  props.put(p.getKey(), p.getValue());
 }
 for (Entry<String,String> entry : props.entrySet()) {
  String defaultValue = getDefaultConfigValue(entry.getKey());
  if (defaultValue == null || !defaultValue.equals(entry.getValue())) {
   if (!entry.getValue().equals(siteConfig.get(entry.getKey()))
     && !entry.getValue().equals(systemConfig.get(entry.getKey()))) {
    nsWriter.write(nsConfigFormat
      .format(new String[] {namespace, entry.getKey() + "=" + entry.getValue()}));
   }
  }
 }
 nsWriter.close();
}
origin: apache/accumulo

@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
  throws AccumuloException, AccumuloSecurityException, TableExistsException,
  TableNotFoundException, IOException, ClassNotFoundException, NamespaceExistsException,
  NamespaceNotFoundException {
 if (createNamespaceOptCopyConfig == null) {
  getOptions();
 }
 String namespace = cl.getArgs()[0];
 shellState.getAccumuloClient().namespaceOperations().create(namespace);
 // Copy options if flag was set
 Iterable<Entry<String,String>> configuration = null;
 if (cl.hasOption(createNamespaceOptCopyConfig.getOpt())) {
  String copy = cl.getOptionValue(createNamespaceOptCopyConfig.getOpt());
  if (shellState.getAccumuloClient().namespaceOperations().exists(namespace)) {
   configuration = shellState.getAccumuloClient().namespaceOperations().getProperties(copy);
  }
 }
 if (configuration != null) {
  for (Entry<String,String> entry : configuration) {
   if (Property.isValidTablePropertyKey(entry.getKey())) {
    shellState.getAccumuloClient().namespaceOperations().setProperty(namespace,
      entry.getKey(), entry.getValue());
   }
  }
 }
 return 0;
}
origin: apache/accumulo

try {
 tableProps = shellState.getAccumuloClient().namespaceOperations()
   .getProperties(OptUtil.getNamespaceOpt(cl, shellState));
} catch (NamespaceNotFoundException e) {
 throw new IllegalArgumentException(e);
origin: apache/accumulo

   shellState.getContext(), Tables.getTableId(shellState.getContext(), tableName)));
 for (Entry<String,String> e : shellState.getAccumuloClient().namespaceOperations()
   .getProperties(n)) {
  namespaceConfig.put(e.getKey(), e.getValue());
 acuconf = shellState.getAccumuloClient().tableOperations().getProperties(tableName);
} else if (namespace != null) {
 acuconf = shellState.getAccumuloClient().namespaceOperations().getProperties(namespace);
origin: org.apache.accumulo/accumulo-server-base

private void printNameSpaceConfiguration(Connector connector, String namespace,
  File outputDirectory)
  throws IOException, AccumuloException, AccumuloSecurityException, NamespaceNotFoundException {
 File namespaceScript = new File(outputDirectory, namespace + NS_FILE_SUFFIX);
 FileWriter nsWriter = new FileWriter(namespaceScript);
 nsWriter.write(createNsFormat.format(new String[] {namespace}));
 TreeMap<String,String> props = new TreeMap<>();
 for (Entry<String,String> p : connector.namespaceOperations().getProperties(namespace)) {
  props.put(p.getKey(), p.getValue());
 }
 for (Entry<String,String> entry : props.entrySet()) {
  String defaultValue = getDefaultConfigValue(entry.getKey());
  if (defaultValue == null || !defaultValue.equals(entry.getValue())) {
   if (!entry.getValue().equals(siteConfig.get(entry.getKey()))
     && !entry.getValue().equals(systemConfig.get(entry.getKey()))) {
    nsWriter.write(nsConfigFormat
      .format(new String[] {namespace, entry.getKey() + "=" + entry.getValue()}));
   }
  }
 }
 nsWriter.close();
}
origin: org.apache.accumulo/accumulo-proxy

@Override
public Map<String,String> getNamespaceProperties(ByteBuffer login, String namespaceName)
  throws org.apache.accumulo.proxy.thrift.AccumuloException,
  org.apache.accumulo.proxy.thrift.AccumuloSecurityException,
  org.apache.accumulo.proxy.thrift.NamespaceNotFoundException, TException {
 try {
  Map<String,String> props = new HashMap<>();
  for (Map.Entry<String,String> entry : getConnector(login).namespaceOperations()
    .getProperties(namespaceName)) {
   props.put(entry.getKey(), entry.getValue());
  }
  return props;
 } catch (Exception e) {
  handleExceptionNNF(e);
  return null;
 }
}
origin: org.apache.accumulo/accumulo-test

private boolean checkHasProperty(String name, String propKey, String propVal,
  boolean nameIsTable) {
 try {
  Iterable<Entry<String,String>> iterable = nameIsTable
    ? c.tableOperations().getProperties(name)
    : c.namespaceOperations().getProperties(name);
  for (Entry<String,String> e : iterable)
   if (propKey.equals(e.getKey()))
    return propVal.equals(e.getValue());
  return false;
 } catch (Exception e) {
  fail();
  return false;
 }
}
origin: org.apache.accumulo/accumulo-shell

@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
  throws AccumuloException, AccumuloSecurityException, TableExistsException,
  TableNotFoundException, IOException, ClassNotFoundException, NamespaceExistsException,
  NamespaceNotFoundException {
 if (createNamespaceOptCopyConfig == null) {
  getOptions();
 }
 String namespace = cl.getArgs()[0];
 shellState.getConnector().namespaceOperations().create(namespace);
 // Copy options if flag was set
 Iterable<Entry<String,String>> configuration = null;
 if (cl.hasOption(createNamespaceOptCopyConfig.getOpt())) {
  String copy = cl.getOptionValue(createNamespaceOptCopyConfig.getOpt());
  if (shellState.getConnector().namespaceOperations().exists(namespace)) {
   configuration = shellState.getConnector().namespaceOperations().getProperties(copy);
  }
 }
 if (configuration != null) {
  for (Entry<String,String> entry : configuration) {
   if (Property.isValidTablePropertyKey(entry.getKey())) {
    shellState.getConnector().namespaceOperations().setProperty(namespace, entry.getKey(),
      entry.getValue());
   }
  }
 }
 return 0;
}
origin: org.apache.accumulo/accumulo-shell

   shellState.getInstance(), Tables.getTableId(shellState.getInstance(), tableName)));
 for (Entry<String,String> e : shellState.getConnector().namespaceOperations()
   .getProperties(n)) {
  namespaceConfig.put(e.getKey(), e.getValue());
 acuconf = shellState.getConnector().tableOperations().getProperties(tableName);
} else if (namespace != null) {
 acuconf = shellState.getConnector().namespaceOperations().getProperties(namespace);
origin: org.apache.accumulo/accumulo-shell

try {
 tableProps = shellState.getConnector().namespaceOperations()
   .getProperties(OptUtil.getNamespaceOpt(cl, shellState));
} catch (NamespaceNotFoundException e) {
 throw new IllegalArgumentException(e);
origin: org.apache.accumulo/accumulo-test

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

loginAs(rootUser);
if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
  || map(root_conn.namespaceOperations().getProperties(namespace))
    .get(Property.TABLE_BLOOM_ERRORRATE.getKey()).equals("003.14159%"))
 throw e;
loginAs(rootUser);
if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
  || !map(root_conn.namespaceOperations().getProperties(namespace))
    .get(Property.TABLE_BLOOM_ERRORRATE.getKey()).equals("003.14159%"))
 throw e;
origin: org.apache.accumulo/accumulo-test

  Property.TABLE_BLOOM_ERRORRATE.getKey(), "003.14159%");
loginAs(rootUser);
Map<String,String> propies = map(root_conn.namespaceOperations().getProperties(namespace));
if (!propies.get(Property.TABLE_BLOOM_ERRORRATE.getKey()).equals("003.14159%"))
 throw new IllegalStateException("Should be able to set a table property");
  Property.TABLE_BLOOM_ERRORRATE.getKey());
loginAs(rootUser);
propies = map(root_conn.namespaceOperations().getProperties(namespace));
if (propies.get(Property.TABLE_BLOOM_ERRORRATE.getKey()).equals("003.14159%"))
 throw new IllegalStateException("Should be able to remove a table property");
org.apache.accumulo.core.client.adminNamespaceOperationsgetProperties

Javadoc

Gets properties of a namespace, which are inherited by tables in this namespace. Note that recently changed properties may not be available immediately.

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.
  • 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
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JList (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top 12 Jupyter Notebook extensions
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