Codota Logo
Scanner.enableIsolation
Code IndexAdd Codota to your IDE (free)

How to use
enableIsolation
method
in
org.apache.accumulo.core.client.Scanner

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

  • Common ways to obtain Scanner
private void myMethod () {
Scanner s =
  • Codota IconConnector connector;String tableName;Authorizations authorizations;connector.createScanner(tableName, authorizations)
  • Codota IconConnector connector;String tableName;connector.createScanner(tableName, new Authorizations())
  • Codota IconConnector connector;String str;Collection collection;ScannerHelper.createScanner(connector, str, collection)
  • Smart code suggestions by Codota
}
origin: apache/accumulo

private Iterator<Entry<Key,Value>> newIterator(Range r) {
 synchronized (scanner) {
  scanner.enableIsolation();
  scanner.setBatchSize(batchSize);
  scanner.setTimeout(timeout, TimeUnit.MILLISECONDS);
  scanner.setRange(r);
  scanner.setReadaheadThreshold(readaheadThreshold);
  setOptions((ScannerOptions) scanner, opts);
  return scanner.iterator();
  // return new FaultyIterator(scanner.iterator());
 }
}
origin: apache/accumulo

smi.scanner.setReadaheadThreshold(readaheadThreshold);
if (isolated)
 smi.scanner.enableIsolation();
else
 smi.scanner.disableIsolation();
origin: org.apache.accumulo/accumulo-core

private Iterator<Entry<Key,Value>> newIterator(Range r) {
 synchronized (scanner) {
  scanner.enableIsolation();
  scanner.setBatchSize(batchSize);
  scanner.setTimeout(timeout, TimeUnit.MILLISECONDS);
  scanner.setRange(r);
  scanner.setReadaheadThreshold(readaheadThreshold);
  setOptions((ScannerOptions) scanner, opts);
  return scanner.iterator();
  // return new FaultyIterator(scanner.iterator());
 }
}
origin: org.apache.accumulo/accumulo-core

smi.scanner.setReadaheadThreshold(readaheadThreshold);
if (isolated)
 smi.scanner.enableIsolation();
else
 smi.scanner.disableIsolation();
origin: org.apache.accumulo/accumulo-test

@Test
public void testBugFix() throws Exception {
 // test bug fox for ACCUMULO-3977
 String table = super.getUniqueNames(1)[0];
 Connector conn = getConnector();
 conn.tableOperations().create(table);
 BatchWriter bw = conn.createBatchWriter(table, new BatchWriterConfig());
 addDocument(bw, "000A", "dog", "cat", "hamster", "iguana", "the");
 addDocument(bw, "000B", "java", "perl", "C++", "pascal", "the");
 addDocument(bw, "000C", "chrome", "firefox", "safari", "opera", "the");
 addDocument(bw, "000D", "logarithmic", "quadratic", "linear", "exponential", "the");
 bw.close();
 // its a bug when using rfiles, so flush
 conn.tableOperations().flush(table, null, null, true);
 IteratorSetting iterCfg = new IteratorSetting(30, "ayeaye",
   IntersectingIterator.class.getName());
 IntersectingIterator.setColumnFamilies(iterCfg,
   new Text[] {new Text("the"), new Text("hamster")});
 Scanner scanner = conn.createScanner(table, Authorizations.EMPTY);
 scanner.enableIsolation();
 scanner.addScanIterator(iterCfg);
 for (int i = 0; i < 100; i++) {
  Iterator<Entry<Key,Value>> iter = scanner.iterator();
  Assert.assertTrue(iter.hasNext());
  Assert.assertEquals("000A", iter.next().getKey().getColumnQualifierData().toString());
  Assert.assertFalse(iter.hasNext());
 }
}
origin: org.apache.accumulo/accumulo-test

public static void main(String[] args) throws Exception {
 ScanOpts opts = new ScanOpts();
 opts.parseArgs(Scan.class.getName(), args);
 Connector connector = opts.getConnector();
 Scanner scanner = connector.createScanner(opts.getTableName(), new Authorizations());
 if (opts.isolate) {
  scanner.enableIsolation();
 }
 Random tablet_index_generator = new Random(opts.scan_seed);
 LoopControl scanning_condition = opts.continuous ? new ContinuousLoopControl()
   : new IterativeLoopControl(opts.scan_iterations);
 while (scanning_condition.keepScanning()) {
  Range range = pickRange(connector.tableOperations(), opts.getTableName(),
    tablet_index_generator);
  scanner.setRange(range);
  if (opts.batch_size > 0) {
   scanner.setBatchSize(opts.batch_size);
  }
  try {
   consume(scanner);
  } catch (Exception e) {
   System.err.println(String.format(
     "Exception while scanning range %s. Check the state of Accumulo for errors.", range));
   throw e;
  }
 }
}
org.apache.accumulo.core.clientScannerenableIsolation

Javadoc

Enables row isolation. Writes that occur to a row after a scan of that row has begun will not be seen if this option is enabled.

Popular methods of Scanner

  • setRange
    Sets the range of keys to scan over.
  • iterator
  • fetchColumnFamily
  • addScanIterator
  • close
  • fetchColumn
  • clearColumns
  • setBatchSize
    Sets the number of Key/Value pairs that will be fetched at a time from a tablet server.
  • clearScanIterators
  • setReadaheadThreshold
    Sets the number of batches of Key/Value pairs returned before the Scanner will begin to prefetch the
  • setTimeout
  • getRange
    Returns the range of keys to scan over.
  • setTimeout,
  • getRange,
  • getBatchSize,
  • setBatchTimeout,
  • setClassLoaderContext,
  • setSamplerConfiguration,
  • clearClassLoaderContext,
  • clearSamplerConfiguration,
  • disableIsolation

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
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