Examples of WriteOptions


Examples of org.iq80.leveldb.WriteOptions

    @Override
    public void put(byte[] key, byte[] value)
            throws DBException
    {
        put(key, value, new WriteOptions());
    }
View Full Code Here

Examples of org.iq80.leveldb.WriteOptions

    @Override
    public void delete(byte[] key)
            throws DBException
    {
        writeInternal(new WriteBatchImpl().delete(key), new WriteOptions());
    }
View Full Code Here

Examples of org.iq80.leveldb.WriteOptions

    @Override
    public void write(WriteBatch updates)
            throws DBException
    {
        writeInternal((WriteBatchImpl) updates, new WriteOptions());
    }
View Full Code Here

Examples of org.iq80.leveldb.WriteOptions

      // write suggested start time
      v = new byte[16];
      writeReverseOrderedLong(suggestedStartTime, v, 0);
      writeReverseOrderedLong(startAndInsertTime.insertTime, v, 8);
      WriteOptions writeOptions = new WriteOptions();
      writeOptions.sync(true);
      db.put(b, v, writeOptions);
    } else {
      // found start time in db, so ignore suggested start time
      startAndInsertTime = new StartAndInsertTime(readReverseOrderedLong(v, 0),
          readReverseOrderedLong(v, 8));
View Full Code Here

Examples of org.iq80.leveldb.WriteOptions

                entityId + " from related entity entry of type:" +
                type + " id:" + id);
          }
        }
      }
      WriteOptions writeOptions = new WriteOptions();
      writeOptions.sync(true);
      db.write(writeBatch, writeOptions);
      return true;
    } finally {
      IOUtils.cleanup(LOG, writeBatch);
    }
View Full Code Here

Examples of org.iq80.leveldb.WriteOptions

    public void setSync(boolean sync) {
        this.sync = sync;
    }

    public WriteOptions getWriteOptions() {
        WriteOptions options = new WriteOptions();
        options.sync(sync);
        return options;
    }
View Full Code Here

Examples of org.iq80.leveldb.WriteOptions

    public void setSync(boolean sync) {
        this.sync = sync;
    }

    public WriteOptions getWriteOptions() {
        WriteOptions options = new WriteOptions();
        options.sync(sync);
        return options;
    }
View Full Code Here

Examples of org.iq80.leveldb.WriteOptions

    public void setSync(boolean sync) {
        this.sync = sync;
    }

    public WriteOptions getWriteOptions() {
        WriteOptions options = new WriteOptions();
        options.sync(sync);
        return options;
    }
View Full Code Here

Examples of org.iq80.leveldb.WriteOptions

                            logger.trace("Synchronized data store [name=" + getName() + "]");
          // Implement this in LevelDB by just writing a special key
          byte[] syncKey = new byte[] { 0x00 };
          byte[] syncValue = new byte[8];
          ByteBuffer.wrap(syncValue).putLong(System.currentTimeMillis());
          db.put(syncKey, syncValue, new WriteOptions().sync(true));
                        } else {
                            // cancel this task!
                            logger.warn("Cancelling synchronizeTimerTask since db was null, this may be normal if data store shutting down");
                            this.cancel();
                        }
View Full Code Here

Examples of org.iq80.leveldb.WriteOptions

    @Override
    public void doSetRecord(byte[] key, byte[] value) throws DataStoreFatalException {
  try {
      if (this.synchronizeInterval == 0) {
    db.put(key, value, new WriteOptions().sync(true));
      } else {
    db.put(key, value, new WriteOptions().sync(false));
      }
  } catch (DBException e) {
      throw new DataStoreFatalException("Unable to set value and key [0x" + HexUtil.toHexString(key) + "] [message=" + e.getMessage() + "]", e);
  }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.