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

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

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

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

 new ColumnVisibility(value); // validate that it is a valid expression
shellState.getAccumuloClient().namespaceOperations().setProperty(namespace, property,
  value);
Shell.log.debug("Successfully set table configuration option.");
origin: org.apache.accumulo/accumulo-proxy

@Override
public void setNamespaceProperty(ByteBuffer login, String namespaceName, String property,
  String value) throws org.apache.accumulo.proxy.thrift.AccumuloException,
  org.apache.accumulo.proxy.thrift.AccumuloSecurityException,
  org.apache.accumulo.proxy.thrift.NamespaceNotFoundException, TException {
 try {
  getConnector(login).namespaceOperations().setProperty(namespaceName, property, value);
 } catch (Exception e) {
  handleExceptionNNF(e);
 }
}
origin: org.apache.accumulo/accumulo-test

@Test
public void notInstancePreferredVolumeChooser() throws Exception {
 log.info("Starting notInstancePreferredVolumeChooser");
 // Create namespace
 Connector connector = getConnector();
 connector.namespaceOperations().create(namespace1);
 // Set properties on the namespace
 String propertyName = Property.TABLE_VOLUME_CHOOSER.getKey();
 String volume = PreferredVolumeChooser.class.getName();
 connector.namespaceOperations().setProperty(namespace1, propertyName, volume);
 propertyName = "table.custom.preferredVolumes";
 volume = v3.toString();
 connector.namespaceOperations().setProperty(namespace1, propertyName, volume);
 // Create table1 on namespace1
 String tableName = namespace1 + ".1";
 connector.tableOperations().create(tableName);
 String tableID = connector.tableOperations().tableIdMap().get(tableName);
 // Add 10 splits to the table
 addSplits(connector, tableName);
 // Write some data to the table
 writeAndReadData(connector, tableName);
 // Verify the new files are written to the Volumes specified
 verifyVolumes(connector, tableName, TabletsSection.getRange(tableID),
   v1.toString() + "," + v2.toString() + "," + v4.toString());
}
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-test

@Test
public void missingVolumePreferredVolumeChooser() throws Exception {
 log.info("Starting missingVolumePreferredVolumeChooser");
 // Create namespace
 Connector connector = getConnector();
 connector.namespaceOperations().create(namespace1);
 // Set properties on the namespace
 String propertyName = Property.TABLE_VOLUME_CHOOSER.getKey();
 String volume = PreferredVolumeChooser.class.getName();
 connector.namespaceOperations().setProperty(namespace1, propertyName, volume);
 // Create table1 on namespace1
 String tableName = namespace1 + ".1";
 connector.tableOperations().create(tableName);
 String tableID = connector.tableOperations().tableIdMap().get(tableName);
 // Add 10 splits to the table
 addSplits(connector, tableName);
 // Write some data to the table
 writeAndReadData(connector, tableName);
 // Verify the new files are written to the Volumes specified
 verifyVolumes(connector, tableName, TabletsSection.getRange(tableID),
   v1.toString() + "," + v2.toString() + "," + v4.toString());
}
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-test

connector.namespaceOperations().setProperty(namespace1, propertyName, volume);
connector.namespaceOperations().setProperty(namespace2, propertyName, volume);
origin: org.apache.accumulo/accumulo-shell

  new ColumnVisibility(value); // validate that it is a valid expression
 shellState.getConnector().namespaceOperations().setProperty(namespace, property, value);
 Shell.log.debug("Successfully set table configuration option.");
} else {
origin: org.apache.accumulo/accumulo-test

connector.namespaceOperations().setProperty(namespace1, propertyName, volume);
connector.namespaceOperations().setProperty(namespace2, propertyName, volume);
connector.namespaceOperations().setProperty(namespace2, propertyName, volume);
origin: org.apache.accumulo/accumulo-test

connector.namespaceOperations().setProperty(namespace1, propertyName, volume);
connector.namespaceOperations().setProperty(namespace1, propertyName, volume);
connector.namespaceOperations().setProperty(namespace2, propertyName, volume);
connector.namespaceOperations().setProperty(namespace2, propertyName, volume);
origin: org.apache.accumulo/accumulo-test

  + property.getDefaultValue());
try {
 env.getConnector().namespaceOperations().setProperty(namespace, property.getKey(),
   property.getDefaultValue());
} catch (AccumuloException ex) {
origin: org.apache.accumulo/accumulo-test

 break;
case 12:
 ops.setProperty(namespace, "k", "v");
 fail();
 break;
origin: org.apache.accumulo/accumulo-test

root_conn.namespaceOperations().create(namespace);
loginAs(testUser);
test_user_conn.namespaceOperations().setProperty(namespace,
  Property.TABLE_BLOOM_ERRORRATE.getKey(), "003.14159%");
loginAs(rootUser);
origin: org.apache.accumulo/accumulo-test

try {
 loginAs(testUser);
 test_user_conn.namespaceOperations().setProperty(namespace,
   Property.TABLE_BLOOM_ERRORRATE.getKey(), "003.14159%");
 throw new IllegalStateException("Should NOT be able to set a namespace property");
root_conn.namespaceOperations().setProperty(namespace,
  Property.TABLE_BLOOM_ERRORRATE.getKey(), "003.14159%");
try {
origin: org.apache.accumulo/accumulo-test

 user1Con.namespaceOperations().setProperty(n1, Property.TABLE_FILE_MAX.getKey(), "55");
 fail();
} catch (AccumuloSecurityException e) {
c.securityOperations().grantNamespacePermission(u1, n1, NamespacePermission.ALTER_NAMESPACE);
loginAs(user1);
user1Con.namespaceOperations().setProperty(n1, Property.TABLE_FILE_MAX.getKey(), "42");
user1Con.namespaceOperations().removeProperty(n1, Property.TABLE_FILE_MAX.getKey());
loginAs(root);
 user1Con.namespaceOperations().setProperty(n1, Property.TABLE_FILE_MAX.getKey(), "33");
 fail();
} catch (AccumuloSecurityException e) {
c.securityOperations().grantSystemPermission(u1, SystemPermission.ALTER_NAMESPACE);
loginAs(user1);
user1Con.namespaceOperations().setProperty(n1, Property.TABLE_FILE_MAX.getKey(), "33");
user1Con.namespaceOperations().removeProperty(n1, Property.TABLE_FILE_MAX.getKey());
loginAs(root);
origin: org.apache.accumulo/accumulo-test

assertFalse(checkTableHasProp(t1, k2, k2v1));
assertFalse(checkTableHasProp(t1, k2, k2v2));
c.namespaceOperations().setProperty(namespace, k1, k1v1);
c.namespaceOperations().setProperty(namespace2, k1, k1v2);
c.namespaceOperations().setProperty(namespace, k2, k2v1);
c.namespaceOperations().setProperty(namespace2, k2, k2v1);
c.tableOperations().setProperty(t1, k2, k2v2);
assertTrue(checkNamespaceHasProp(namespace, k1, k1v1));
origin: org.apache.accumulo/accumulo-test

c.namespaceOperations().setProperty(namespace, k, v);
assertTrue(checkNamespaceHasProp(namespace, k, v));
assertTrue(checkTableHasProp(t1, k, v));
c.namespaceOperations().setProperty(Namespaces.DEFAULT_NAMESPACE, k, v);
assertFalse(checkNamespaceHasProp(namespace, k, v));
assertFalse(checkTableHasProp(t1, k, v));
c.namespaceOperations().setProperty(namespace, k2, v2);
c.tableOperations().setProperty(t2, k2, table_v2);
assertTrue(checkNamespaceHasProp(namespace, k2, v2));
org.apache.accumulo.core.client.adminNamespaceOperationssetProperty

Javadoc

Sets a property on a namespace which applies to all tables in the namespace. Note that it may take a few seconds to propagate the change everywhere.

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,
  • rename,
  • testClassLoad,
  • checkIteratorConflicts,
  • defaultNamespace,
  • systemNamespace

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ImageIO (javax.imageio)
  • JTextField (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • 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