congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
TableOperations.exists
Code IndexAdd Tabnine to your IDE (free)

How to use
exists
method
in
org.apache.accumulo.core.client.admin.TableOperations

Best Java code snippets using org.apache.accumulo.core.client.admin.TableOperations.exists (Showing top 20 results out of 414)

origin: prestodb/presto

public boolean exists(String table)
{
  return connector.tableOperations().exists(table);
}
origin: apache/accumulo

private void flush() {
 try {
  final BatchWriter writer = this.writer.get();
  if (writer != null) {
   writer.flush();
  } else {
   // We don't have a writer. If the table exists, try to make a new writer.
   if (accumuloClient.tableOperations().exists(tableName)) {
    resetWriter();
   }
  }
 } catch (MutationsRejectedException | RuntimeException exception) {
  log.warn("Problem flushing traces, resetting writer. Set log level to"
    + " DEBUG to see stacktrace. cause: " + exception);
  log.debug("flushing traces failed due to exception", exception);
  resetWriter();
  /* XXX e.g. if the writer was closed between when we grabbed it and when we called flush. */
 }
}
origin: apache/accumulo

@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
  throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
 final String tableName = cl.getArgs()[0];
 if (!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
  throw new TableNotFoundException(null, tableName, null);
 }
 shellState.setTableName(tableName);
 return 0;
}
origin: apache/accumulo

@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
  throws Exception {
 final String tableName = OptUtil.getTableOpt(cl, shellState);
 final boolean decode = cl.hasOption(base64Opt.getOpt());
 final TreeSet<Text> splits = new TreeSet<>();
 if (cl.hasOption(optSplitsFile.getOpt())) {
  splits.addAll(ShellUtil.scanFile(cl.getOptionValue(optSplitsFile.getOpt()), decode));
 } else {
  if (cl.getArgList().isEmpty()) {
   throw new MissingArgumentException("No split points specified");
  }
  for (String s : cl.getArgs()) {
   splits.add(new Text(s.getBytes(Shell.CHARSET)));
  }
 }
 if (!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
  throw new TableNotFoundException(null, tableName, null);
 }
 shellState.getAccumuloClient().tableOperations().addSplits(tableName, splits);
 return 0;
}
origin: apache/accumulo

public void addTable(Text tableName) throws AccumuloException, AccumuloSecurityException {
 if (simulate) {
  log.info("Simulating adding table: " + tableName);
  return;
 }
 log.debug("Adding table: " + tableName);
 BatchWriter bw = null;
 String table = tableName.toString();
 if (createTables && !client.tableOperations().exists(table)) {
  try {
   client.tableOperations().create(table);
  } catch (AccumuloSecurityException e) {
   log.error("Accumulo security violation creating " + table, e);
   throw e;
  } catch (TableExistsException e) {
   // Shouldn't happen
  }
 }
 try {
  bw = mtbw.getBatchWriter(table);
 } catch (TableNotFoundException e) {
  log.error("Accumulo table " + table + " doesn't exist and cannot be created.", e);
  throw new AccumuloException(e);
 } catch (AccumuloException | AccumuloSecurityException e) {
  throw e;
 }
 if (bw != null)
  bws.put(tableName, bw);
}
origin: apache/accumulo

public void addTable(Text tableName) throws AccumuloException, AccumuloSecurityException {
 if (simulate) {
  log.info("Simulating adding table: " + tableName);
  return;
 }
 log.debug("Adding table: " + tableName);
 BatchWriter bw = null;
 String table = tableName.toString();
 if (createTables && !client.tableOperations().exists(table)) {
  try {
   client.tableOperations().create(table);
  } catch (AccumuloSecurityException e) {
   log.error("Accumulo security violation creating " + table, e);
   throw e;
  } catch (TableExistsException e) {
   // Shouldn't happen
  }
 }
 try {
  bw = mtbw.getBatchWriter(table);
 } catch (TableNotFoundException e) {
  log.error("Accumulo table " + table + " doesn't exist and cannot be created.", e);
  throw new AccumuloException(e);
 } catch (AccumuloException | AccumuloSecurityException e) {
  throw e;
 }
 if (bw != null)
  bws.put(tableName, bw);
}
origin: apache/accumulo

public static String getTableOpt(final CommandLine cl, final Shell shellState)
  throws TableNotFoundException {
 String tableName;
 if (cl.hasOption(ShellOptions.tableOption)) {
  tableName = cl.getOptionValue(ShellOptions.tableOption);
  if (!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
   throw new TableNotFoundException(tableName, tableName,
     "specified table that doesn't exist");
  }
 } else {
  shellState.checkTableState();
  tableName = shellState.getTableName();
 }
 return tableName;
}
origin: apache/accumulo

if (!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
 throw new TableNotFoundException(tableName, tableName,
   "specified table that doesn't exist");
origin: apache/accumulo

 break;
if (!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
 throw new TableNotFoundException(null, tableName, null);
origin: apache/accumulo

private Scanner getScanner(AccumuloClient client) throws AccumuloException {
 try {
  AccumuloConfiguration conf = Monitor.getContext().getConfiguration();
  final String table = conf.get(Property.TRACE_TABLE);
  if (!client.tableOperations().exists(table)) {
   return null;
  }
  return client.createScanner(table);
 } catch (AccumuloSecurityException | TableNotFoundException ex) {
  return null;
 }
}
origin: apache/accumulo

protected Table.ID getTableId(AccumuloClient client, String tableName)
  throws TableNotFoundException {
 TableOperations tops = client.tableOperations();
 if (!client.tableOperations().exists(tableName)) {
  throw new TableNotFoundException(null, tableName, null);
 }
 String tableId = null;
 while (tableId == null) {
  tableId = tops.tableIdMap().get(tableName);
  if (tableId == null) {
   sleepUninterruptibly(200, TimeUnit.MILLISECONDS);
  }
 }
 return Table.ID.of(tableId);
}
origin: apache/accumulo

if (shellState.getAccumuloClient().tableOperations().exists(tableName)) {
 throw new TableExistsException(null, tableName, null);
} else if (cl.hasOption(createTableOptCopySplits.getOpt())) {
 final String oldTable = cl.getOptionValue(createTableOptCopySplits.getOpt());
 if (!shellState.getAccumuloClient().tableOperations().exists(oldTable)) {
  throw new TableNotFoundException(null, oldTable, null);
 if (!shellState.getAccumuloClient().tableOperations().exists(oldTable)) {
  throw new TableNotFoundException(null, oldTable, null);
 if (shellState.getAccumuloClient().tableOperations().exists(tableName)) {
  final Iterable<Entry<String,String>> configuration = shellState.getAccumuloClient()
    .tableOperations().getProperties(cl.getOptionValue(createTableOptCopyConfig.getOpt()));
origin: apache/accumulo

if (tableName != null && !shellState.getAccumuloClient().tableOperations().exists(tableName)) {
 throw new TableNotFoundException(null, tableName, null);
origin: apache/accumulo

  .build();
if (!accumuloClient.tableOperations().exists(tableName)) {
 accumuloClient.tableOperations().create(tableName);
 IteratorSetting setting = new IteratorSetting(10, "ageoff", AgeOffFilter.class.getName());
origin: apache/accumulo

public void start(String[] args) throws MergeException {
 Opts opts = new Opts();
 opts.parseArgs(Merge.class.getName(), args);
 try (AccumuloClient client = opts.createClient()) {
  if (!client.tableOperations().exists(opts.getTableName())) {
   System.err.println("table " + opts.getTableName() + " does not exist");
   return;
  }
  if (opts.goalSize == null || opts.goalSize < 1) {
   AccumuloConfiguration tableConfig = new ConfigurationCopy(
     client.tableOperations().getProperties(opts.getTableName()));
   opts.goalSize = tableConfig.getAsBytes(Property.TABLE_SPLIT_THRESHOLD);
  }
  message("Merging tablets in table %s to %d bytes", opts.getTableName(), opts.goalSize);
  mergomatic(client, opts.getTableName(), opts.begin, opts.end, opts.goalSize, opts.force);
 } catch (Exception ex) {
  throw new MergeException(ex);
 }
}
origin: org.vertexium/vertexium-accumulo

private void dropTableIfExists(String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
  if (this.connector.tableOperations().exists(tableName)) {
    this.connector.tableOperations().delete(tableName);
  }
}
origin: org.apache.accumulo/accumulo-shell

@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
  throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
 final String tableName = cl.getArgs()[0];
 if (!shellState.getConnector().tableOperations().exists(tableName)) {
  throw new TableNotFoundException(null, tableName, null);
 }
 shellState.setTableName(tableName);
 return 0;
}
origin: apache/fluo

 public boolean accumuloTableExists() {
  if (!config.hasRequiredAdminProps()) {
   throw new IllegalArgumentException("Admin configuration is missing required properties");
  }
  AccumuloClient client = AccumuloUtil.getClient(config);
  return client.tableOperations().exists(config.getAccumuloTable());
 }
}
origin: edu.jhuapl.accumulo/proxy-instance

@Override
public BatchWriter createBatchWriter(String tableName, BatchWriterConfig config) throws TableNotFoundException {
 if (!tableOperations().exists(tableName)) {
  throw new TableNotFoundException(null, tableName, null);
 }
 try {
  return new ProxyBatchWriter(this, token, tableName, config);
 } catch (TException e) {
  throw ExceptionFactory.runtimeException(e);
 }
}
origin: NationalSecurityAgency/datawave

private void recreateTable(TableOperations tops, String table) throws Exception {
  if (tops.exists(table)) {
    tops.delete(table);
  }
  tops.create(table);
}

org.apache.accumulo.core.client.adminTableOperationsexists

Javadoc

A method to check if a table exists in Accumulo.

Popular methods of TableOperations

  • create
  • delete
    Delete a table
  • attachIterator
    Add an iterator to a table on the given scopes.
  • setProperty
    Sets a property on a table. This operation is asynchronous and eventually consistent. Not all tablet
  • addSplits
    Ensures that tablets are split along a set of keys. Note that while the documentation for Text speci
  • list
    Retrieve a list of tables in Accumulo.
  • tableIdMap
    Get a mapping of table name to internal table id.
  • listIterators
    Get a list of iterators for this table.
  • listSplits
  • compact
    Starts a full major compaction of the tablets in the range (start, end]. The compaction is preformed
  • flush
    Flush a table's data that is currently in memory.
  • getProperties
    Gets properties of a table. This operation is asynchronous and eventually consistent. It is not guar
  • flush,
  • getProperties,
  • setLocalityGroups,
  • deleteRows,
  • removeIterator,
  • getIteratorSetting,
  • importDirectory,
  • testClassLoad,
  • getLocalityGroups

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ plugins
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