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

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

Best Java code snippets using org.apache.accumulo.core.client.admin.TableOperations.splitRangeByTablets (Showing top 6 results out of 315)

origin: prestodb/presto

private Collection<Range> splitByTabletBoundaries(String tableName, Collection<Range> ranges)
    throws org.apache.accumulo.core.client.TableNotFoundException, AccumuloException, AccumuloSecurityException
{
  ImmutableSet.Builder<Range> rangeBuilder = ImmutableSet.builder();
  for (Range range : ranges) {
    // if start and end key are equivalent, no need to split the range
    if (range.getStartKey() != null && range.getEndKey() != null && range.getStartKey().equals(range.getEndKey())) {
      rangeBuilder.add(range);
    }
    else {
      // Call out to Accumulo to split the range on tablets
      rangeBuilder.addAll(connector.tableOperations().splitRangeByTablets(tableName, range, Integer.MAX_VALUE));
    }
  }
  return rangeBuilder.build();
}
origin: prestodb/presto

/**
 * Loads the cardinality for the given Range. Uses a BatchScanner and sums the cardinality for all values that encapsulate the Range.
 *
 * @param key Range to get the cardinality for
 * @return The cardinality of the column, which would be zero if the value does not exist
 */
@Override
public Long load(CacheKey key)
    throws Exception
{
  LOG.debug("Loading a non-exact range from Accumulo: %s", key);
  // Get metrics table name and the column family for the scanner
  String metricsTable = getMetricsTableName(key.getSchema(), key.getTable());
  Text columnFamily = new Text(getIndexColumnFamily(key.getFamily().getBytes(UTF_8), key.getQualifier().getBytes(UTF_8)).array());
  // Create scanner for querying the range
  BatchScanner scanner = connector.createBatchScanner(metricsTable, key.auths, 10);
  scanner.setRanges(connector.tableOperations().splitRangeByTablets(metricsTable, key.range, Integer.MAX_VALUE));
  scanner.fetchColumn(columnFamily, CARDINALITY_CQ_AS_TEXT);
  try {
    return stream(scanner)
        .map(Entry::getValue)
        .map(Value::toString)
        .mapToLong(Long::parseLong)
        .sum();
  }
  finally {
    scanner.close();
  }
}
origin: org.apache.accumulo/accumulo-proxy

@Override
public Set<org.apache.accumulo.proxy.thrift.Range> splitRangeByTablets(ByteBuffer login,
  String tableName, org.apache.accumulo.proxy.thrift.Range range, int maxSplits)
  throws org.apache.accumulo.proxy.thrift.AccumuloException,
  org.apache.accumulo.proxy.thrift.AccumuloSecurityException,
  org.apache.accumulo.proxy.thrift.TableNotFoundException, TException {
 try {
  Set<Range> ranges = getConnector(login).tableOperations().splitRangeByTablets(tableName,
    getRange(range), maxSplits);
  Set<org.apache.accumulo.proxy.thrift.Range> result = new HashSet<>();
  for (Range r : ranges) {
   result.add(getRange(r));
  }
  return result;
 } catch (Exception e) {
  handleExceptionTNF(e);
  return null;
 }
}
origin: org.apache.accumulo/accumulo-test

  .splitRangeByTablets(clientOpts.getTableName(), new Range(), opts.maxMaps);
AccumuloInputFormat.setRanges(job, ranges);
AccumuloInputFormat.setAutoAdjustRanges(job, false);
origin: org.apache.accumulo/accumulo-test

 conn.tableOperations().clone(opts.getTableName(), clone, true, new HashMap<String,String>(),
   new HashSet<String>());
 ranges = conn.tableOperations().splitRangeByTablets(opts.getTableName(), new Range(),
   opts.maxMaps);
 conn.tableOperations().offline(clone);
 AccumuloInputFormat.setOfflineTableScan(job, true);
} else {
 ranges = opts.getConnector().tableOperations().splitRangeByTablets(opts.getTableName(),
   new Range(), opts.maxMaps);
origin: org.apache.accumulo/accumulo-test

 break;
case 10:
 ops.splitRangeByTablets(tableName, new Range(), 10);
 fail();
 break;
org.apache.accumulo.core.client.adminTableOperationssplitRangeByTablets

Popular methods of TableOperations

  • create
  • exists
    A method to check if a table exists in Accumulo.
  • 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.
  • compact,
  • flush,
  • getProperties,
  • setLocalityGroups,
  • deleteRows,
  • removeIterator,
  • getIteratorSetting,
  • importDirectory,
  • testClassLoad,
  • getLocalityGroups

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • startActivity (Activity)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Notification (javax.management)
  • 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