Codota Logo
WriteBatchWithIndex.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.rocksdb.WriteBatchWithIndex
constructor

Best Java code snippets using org.rocksdb.WriteBatchWithIndex.<init> (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: locationtech/geogig

public RocksdbDAGStore(Supplier<RocksDB> db) {
  this._dbSupplier = db;
  boolean overwriteKey = true;
  this.batchOptions = new DBOptions();
  this.batch = new WriteBatchWithIndex(overwriteKey);
}
origin: org.rocksdb/rocksdbjni

/**
 * Fetch the underlying write batch that contains all pending changes to be
 * committed.
 *
 * Note: You should not write or delete anything from the batch directly and
 * should only use the functions in the {@link Transaction} class to
 * write to this transaction.
 *
 * @return The write batch
 */
public WriteBatchWithIndex getWriteBatch() {
 assert(isOwningHandle());
 final WriteBatchWithIndex writeBatchWithIndex =
   new WriteBatchWithIndex(getWriteBatch(nativeHandle_));
 return writeBatchWithIndex;
}
origin: org.locationtech.geogig/geogig-rocksdb

/**
 * Atomically inserts the graph entries for all the provided commits.
 * 
 * @param commits the commits to create the graph entries for (one entry for each commit/parent)
 * 
 * @implNote uses a {@link WriteBatchWithIndex} to query uncommitted data through
 *           {@link WriteBatchWithIndex#getFromBatchAndDB getFromBatchAndDB}
 */
public void putAll(Iterable<RevCommit> commits) {
  int count = 0;
  final Stopwatch sw = LOG.isTraceEnabled() ? Stopwatch.createStarted() : null;
  try (WriteBatchWithIndex batch = new WriteBatchWithIndex(); //
      RocksDBReference dbRef = dbhandle.getReference();
      WriteOptions wo = new WriteOptions()) {
    wo.setSync(true);
    for (RevCommit c : commits) {
      ObjectId commitId = c.getId();
      ImmutableList<ObjectId> parentIds = c.getParentIds();
      put(dbRef, commitId, parentIds, batch);
      count++;
    }
    dbRef.db().write(wo, batch);
  } catch (Exception e) {
    throw Throwables.propagate(e);
  }
  if (LOG.isTraceEnabled()) {
    LOG.trace(String.format("Inserted %,d graph mappings in %s", count, sw.stop()));
  }
}
origin: locationtech/geogig

/**
 * Atomically inserts the graph entries for all the provided commits.
 * 
 * @param commits the commits to create the graph entries for (one entry for each commit/parent)
 * 
 * @implNote uses a {@link WriteBatchWithIndex} to query uncommitted data through
 *           {@link WriteBatchWithIndex#getFromBatchAndDB getFromBatchAndDB}
 */
public void putAll(Iterable<RevCommit> commits) {
  int count = 0;
  final Stopwatch sw = LOG.isTraceEnabled() ? Stopwatch.createStarted() : null;
  try (WriteBatchWithIndex batch = new WriteBatchWithIndex(); //
      RocksDBReference dbRef = dbhandle.getReference();
      WriteOptions wo = new WriteOptions()) {
    wo.setSync(true);
    for (RevCommit c : commits) {
      ObjectId commitId = c.getId();
      ImmutableList<ObjectId> parentIds = c.getParentIds();
      put(dbRef, commitId, parentIds, batch);
      count++;
    }
    dbRef.db().write(wo, batch);
  } catch (RocksDBException e) {
    throw new RuntimeException(e);
  }
  if (LOG.isTraceEnabled()) {
    LOG.trace(String.format("Inserted %,d graph mappings in %s", count, sw.stop()));
  }
}
origin: locationtech/geogig

@Override
public boolean put(ObjectId commitId, ImmutableList<ObjectId> parentIds) {
  try (WriteBatchWithIndex batch = new WriteBatchWithIndex(); //
      RocksDBReference dbRef = dbhandle.getReference();
      WriteOptions wo = new WriteOptions()) {
    wo.setSync(true);
    boolean updated = put(dbRef, commitId, parentIds, batch);
    dbRef.db().write(wo, batch);
    return updated;
  } catch (RocksDBException e) {
    throw new RuntimeException(e);
  }
}
origin: org.locationtech.geogig/geogig-rocksdb

@Override
public boolean put(ObjectId commitId, ImmutableList<ObjectId> parentIds) {
  try (WriteBatchWithIndex batch = new WriteBatchWithIndex(); //
      RocksDBReference dbRef = dbhandle.getReference();
      WriteOptions wo = new WriteOptions()) {
    wo.setSync(true);
    boolean updated = put(dbRef, commitId, parentIds, batch);
    dbRef.db().write(wo, batch);
    return updated;
  } catch (Exception e) {
    throw Throwables.propagate(e);
  }
}
org.rocksdbWriteBatchWithIndex<init>

Javadoc

Creates a WriteBatchWithIndex where no bytes are reserved up-front, bytewise comparison is used for fallback key comparisons, and duplicate keys operations are retained

Popular methods of WriteBatchWithIndex

  • getFromBatchAndDB
    Similar to RocksDB#get(byte[]) but will also read writes from this batch. This function will query b
  • getFromBatch
    Similar to RocksDB#get(byte[]) but will only read the key from this batch.
  • put
  • clear
  • count
  • disOwnNativeHandle
  • iterator0
  • iterator1
  • iteratorWithBase
  • newIteratorWithBase
    Provides Read-Your-Own-Writes like functionality by creating a new Iterator that will use org.rocksd
  • newWriteBatchWithIndex
  • newWriteBatchWithIndex

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Reference (javax.naming)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
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