Package com.sun.sgs.service.store.db

Examples of com.sun.sgs.service.store.db.DbCursor.findFirst()


    long nextObjectIdRaw(Transaction txn, long oid) {
  TxnInfo txnInfo = checkTxn(txn);
  DbCursor cursor = oidsDb.openCursor(txnInfo.dbTxn);
  try {
      boolean found =  (oid < 0)
    ? cursor.findFirst()
    : cursor.findNext(DataEncoding.encodeLong(oid + 1));
      if (found) {
    return DataEncoding.decodeLong(cursor.getKey());
      } else {
    return -1;
View Full Code Here


    long nextObjectIdRaw(Transaction txn, long oid) {
  TxnInfo txnInfo = checkTxn(txn);
  DbCursor cursor = oidsDb.openCursor(txnInfo.dbTxn);
  try {
      boolean found =  (oid < 0)
    ? cursor.findFirst()
    : cursor.findNext(DataEncoding.encodeLong(oid + 1));
      if (found) {
    return DataEncoding.decodeLong(cursor.getKey());
      } else {
    return -1;
View Full Code Here

    long nextObjectIdRaw(Transaction txn, long oid) {
  TxnInfo txnInfo = checkTxn(txn);
  DbCursor cursor = oidsDb.openCursor(txnInfo.dbTxn);
  try {
      boolean found =  (oid < 0)
    ? cursor.findFirst()
    : cursor.findNext(DataEncoding.encodeLong(oid + 1));
      if (found) {
    return DataEncoding.decodeLong(cursor.getKey());
      } else {
    return -1;
View Full Code Here

      boolean txnDone = false;
      NextObjectResults result;
      try {
    DbCursor cursor = oidsDb.openCursor(txn);
    try {
        boolean found = (oid == -1) ? cursor.findFirst()
      : cursor.findNext(encodeLong(oid));
        long nextOid = !found ? -1 : decodeLong(cursor.getKey());
        if (oid != -1 && oid == nextOid) {
      found = cursor.findNext();
      nextOid = !found ? -1 : decodeLong(cursor.getKey());
View Full Code Here

    long oid;
    String nextName;
    try {
        DbCursor cursor = namesDb.openCursor(txn);
        try {
      boolean hasNext = (name == null) ? cursor.findFirst()
          : cursor.findNext(encodeString(name));
      nextName =
          hasNext ? decodeString(cursor.getKey()) : null;
      if ((name != null) && name.equals(nextName)) {
          hasNext = cursor.findNext();
View Full Code Here

    long nextObjectIdRaw(Transaction txn, long oid) {
  TxnInfo txnInfo = checkTxn(txn);
  DbCursor cursor = oidsDb.openCursor(txnInfo.dbTxn);
  try {
      boolean found =  (oid < 0)
    ? cursor.findFirst()
    : cursor.findNext(DataEncoding.encodeLong(oid + 1));
      if (found) {
    return DataEncoding.decodeLong(cursor.getKey());
      } else {
    return -1;
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.