Package com.sleepycat.db

Examples of com.sleepycat.db.OperationStatus


    /** {@inheritDoc} */
    public byte[] get(DbTransaction txn, byte[] key, boolean forUpdate) {
  try {
      DatabaseEntry valueEntry = new DatabaseEntry();
      OperationStatus status = db.get(
    BdbTransaction.getBdbTxn(txn), new DatabaseEntry(key),
    valueEntry, forUpdate ? LockMode.RMW : null);
      if (status == SUCCESS) {
    return convertData(valueEntry.getData());
      } else if (status == NOTFOUND) {
View Full Code Here


    public void markForUpdate(DbTransaction txn, byte[] key) {
  try {
      DatabaseEntry valueEntry = new DatabaseEntry();
      /* Ignore value by truncating to zero bytes */
      valueEntry.setPartial(0, 0, true);
      OperationStatus status = db.get(
    BdbTransaction.getBdbTxn(txn), new DatabaseEntry(key),
    valueEntry, LockMode.RMW);
      if (status != SUCCESS && status != NOTFOUND) {
    throw new DbDatabaseException("Operation failed: " + status);
      }
View Full Code Here

    }

    /** {@inheritDoc} */
    public void put(DbTransaction txn, byte[] key, byte[] value) {
  try {
      OperationStatus status = db.put(
    BdbTransaction.getBdbTxn(txn), new DatabaseEntry(key),
    new DatabaseEntry(value));
      if (status != SUCCESS) {
    throw new DbDatabaseException("Operation failed: " + status);
      }
View Full Code Here

    /** {@inheritDoc} */
    public boolean putNoOverwrite(
  DbTransaction txn, byte[] key, byte[] value)
    {
  try {
      OperationStatus status = db.putNoOverwrite(
    BdbTransaction.getBdbTxn(txn), new DatabaseEntry(key),
    new DatabaseEntry(value));
      if (status == SUCCESS) {
    return true;
      } else if (status == KEYEXIST) {
View Full Code Here

    }

    /** {@inheritDoc} */
    public boolean delete(DbTransaction txn, byte[] key) {
  try {
      OperationStatus status = db.delete(
    BdbTransaction.getBdbTxn(txn), new DatabaseEntry(key));
      if (status == SUCCESS) {
    return true;
      } else if (status == NOTFOUND) {
    return false;
View Full Code Here

    }

    /** {@inheritDoc} */
    public boolean findFirst() {
  try {
      OperationStatus status =
    cursor.getFirst(keyEntry, valueEntry, null);
      if (status == SUCCESS) {
    isCurrent = true;
    return true;
      } else if (status == NOTFOUND) {
View Full Code Here

    }

    /** {@inheritDoc} */
    public boolean findNext() {
  try {
      OperationStatus status =
    cursor.getNext(keyEntry, valueEntry, null);
      if (status == SUCCESS) {
    isCurrent = true;
    return true;
      } else if (status == NOTFOUND) {
View Full Code Here

    /** {@inheritDoc} */
    public boolean findNext(byte[] key) {
  DatabaseEntry searchEntry = new DatabaseEntry(key);
  try {
      OperationStatus status =
    cursor.getSearchKeyRange(searchEntry, valueEntry, null);
      if (status == SUCCESS) {
    keyEntry = searchEntry;
    isCurrent = true;
    return true;
View Full Code Here

    }

    /** {@inheritDoc} */
    public boolean findLast() {
  try {
      OperationStatus status =
    cursor.getLast(keyEntry, valueEntry, null);
      if (status == SUCCESS) {
    isCurrent = true;
    return true;
      } else if (status == NOTFOUND) {
View Full Code Here

    /** {@inheritDoc} */
    public boolean putNoOverwrite(byte[] key, byte[] value) {
  try {
      DatabaseEntry putKeyEntry = new DatabaseEntry(key);
      DatabaseEntry putValueEntry = new DatabaseEntry(value);
      OperationStatus status = cursor.putNoOverwrite(
    putKeyEntry, putValueEntry);
      if (status == SUCCESS) {
    isCurrent = true;
    keyEntry = putKeyEntry;
    valueEntry = putValueEntry;
View Full Code Here

TOP

Related Classes of com.sleepycat.db.OperationStatus

Copyright © 2018 www.massapicom. 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.