Package com.sleepycat.je

Examples of com.sleepycat.je.OperationStatus


    synchronized (mutex) {
      int matches = 0;
      List<WebURL> results = new ArrayList<WebURL>(max);

      Cursor cursor = null;
      OperationStatus result = null;
      DatabaseEntry key = new DatabaseEntry();
      DatabaseEntry value = new DatabaseEntry();
      Transaction txn;
      if (resumable) {
        txn = env.beginTransaction(null, null);
View Full Code Here


  public void delete(int count) throws DatabaseException {
    synchronized (mutex) {
      int matches = 0;

      Cursor cursor = null;
      OperationStatus result = null;
      DatabaseEntry key = new DatabaseEntry();
      DatabaseEntry value = new DatabaseEntry();
      Transaction txn;
      if (resumable) {
        txn = env.beginTransaction(null, null);
View Full Code Here

  public boolean removeURL(WebURL webUrl) {
    synchronized (mutex) {
      try {
        DatabaseEntry key = new DatabaseEntry(Util.int2ByteArray(webUrl.getDocid()));       
        Cursor cursor = null;
        OperationStatus result = null;
        DatabaseEntry value = new DatabaseEntry();
        Transaction txn = env.beginTransaction(null, null);
        try {
          cursor = urlsDB.openCursor(txn, null);
          result = cursor.getSearchKey(key, value, null);
View Full Code Here

  try
  { key = key.trim();
  DatabaseEntry dbKey = new DatabaseEntry( key.getBytes("UTF-8") );
  DatabaseEntry  dbData = new DatabaseEntry();
  data.getBdbBinding().objectToEntry(data, dbData);
  OperationStatus ost = (dups) ? getCurrentDB().put(null, dbKey, dbData):
   getCurrentDB().putNoOverwrite(null, dbKey, dbData)

  if (ost != OperationStatus.KEYEXIST) valid = true;
  }
  catch (DatabaseException e)
View Full Code Here

  try
  {
   DatabaseEntry dbKey = new DatabaseEntry( key.getBytes("UTF-8") );
   DatabaseEntry dbe = new DatabaseEntry();
   cursor = getCurrentDB().openCursor(null, null);
   OperationStatus ostat = (rangeFlag) ? cursor.getSearchKeyRange(dbKey, dbe, LockMode.DEFAULT):
                            cursor.getSearchKey(dbKey, dbe, LockMode.DEFAULT);

   int numRecords = 0;
   if (cursor.count() >= 1)
   { while ( (ostat == OperationStatus.SUCCESS) && (numRecords < RANGE) )
View Full Code Here

   key = key.trim();
   DatabaseEntry dbKey = new DatabaseEntry( key.getBytes("UTF-8") );
   DatabaseEntry py = new DatabaseEntry();

   //*-- use the key to fetch the data from the primary database
   OperationStatus os = getSecDB().get(null, dbKey, py, dbData, LockMode.DEFAULT);
   if (os != OperationStatus.SUCCESS) dbData = null;
  }
  catch (RuntimeException re)
  { logger.error("Runtime error: Could not fetch sec. document with key " + key + " " + re.getMessage());
  dbData = null; }
View Full Code Here

  try
 
   DatabaseEntry dbKey = new DatabaseEntry( key.getBytes("UTF-8") );
   DatabaseEntry dbe = new DatabaseEntry();
   secCursor = getSecDB().openSecondaryCursor(null, null);
   OperationStatus ostat = (rangeFlag) ? secCursor.getSearchKeyRange(dbKey, dbe, LockMode.DEFAULT):
    secCursor.getSearchKey(dbKey, dbe, LockMode.DEFAULT);

   int numRecords = 0;
   if (secCursor.count() >= 1)
   { while ( (ostat == OperationStatus.SUCCESS) && (numRecords < RANGE) )
View Full Code Here

        {
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();
            IntegerBinding.intToEntry(DEFAULT_CONFIG_VERSION, value);
            ByteBinding.byteToEntry((byte) 0, key);
            OperationStatus status = versionDb.put(null, key, value);
            if (status != OperationStatus.SUCCESS)
            {
                throw new AMQStoreException("Error initialising config version: " + status);
            }
        }
View Full Code Here

            DatabaseEntry contentKeyEntry = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();
            CompoundKeyBinding binding = new CompoundKeyBinding();
            binding.objectToEntry(new CompoundKey(messageId, 0), contentKeyEntry);

            OperationStatus status = cursor.getSearchKeyRange(contentKeyEntry, value, LockMode.DEFAULT);
            OldDataBinding dataBinding = new OldDataBinding();

            while (status == OperationStatus.SUCCESS)
            {
                CompoundKey compoundKey = binding.entryToObject(contentKeyEntry);
View Full Code Here

        return configuredObject;
    }

    private void put(final Database database, Transaction txn, DatabaseEntry key, DatabaseEntry value)
    {
        OperationStatus status = database.put(txn, key, value);
        if (status != OperationStatus.SUCCESS)
        {
            throw new RuntimeException("Cannot add record into " + database.getDatabaseName() + ":" + status);
        }
    }
View Full Code Here

TOP

Related Classes of com.sleepycat.je.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.