Package com.sleepycat.je

Examples of com.sleepycat.je.JoinCursor


     */
    void close()
        throws DatabaseException {

        if (joinCursor != null) {
            JoinCursor toClose = joinCursor;
            joinCursor = null;
            toClose.close();
        }
        if (cursor != null) {
            Cursor toClose = cursor.getCursor();
            cursor = null;
            view.currentTxn.closeCursor(toClose);
View Full Code Here


          SecondaryCursor cursor = db.openSecondaryCursor(null, null);
          key.setData(o.getBytes());
          cursor.getSearchKey(key, data, null);
          cursors[i] = cursor;
        }
        JoinCursor joinCursor = dbMain.join(cursors, null);
        try {
          while (joinCursor.getNext(key, null) == OperationStatus.SUCCESS) {
            entries.add(key);
            key = new DatabaseEntry();
          }
        } finally {
          joinCursor.close();
        }
      } finally {
        for (SecondaryCursor cursor : cursors) {
          if (cursor == null) {
            break;
View Full Code Here

                assertEquals(msg, OperationStatus.SUCCESS, status);
            }
            for (int j = 0; j < 2; j += 1) {
                boolean withData = (j == 0);
                JoinConfig config = (j == 0) ? null : joinConfigNoSort;
                JoinCursor jc = priDb.join(cursors, config);
                assertSame(priDb, jc.getDatabase());
                for (int k = 0; k < priKeys.length; k += 1) {
                    String msg = prefix + " k=" + k + " pkey=" + priKeys[k];
                    if (withData) {
                        status = jc.getNext(key, data, LockMode.DEFAULT);
                    } else {
                        status = jc.getNext(key, LockMode.DEFAULT);
                    }
                    assertEquals(msg, OperationStatus.SUCCESS, status);
                    assertEquals(msg, priKeys[k], (int) key.getData()[0]);
                    if (withData) {
                        boolean dataFound = false;
                        for (int m = 0; m < dataSet.length; m += 2) {
                            int[] vals = dataSet[m];
                            int priKey = dataSet[m + 1][0];
                            if (priKey == priKeys[k]) {
                                for (int n = 0; n < 3; n += 1) {
                                    assertEquals(msg, vals[n],
                                                 (int) data.getData()[n]);
                                    dataFound = true;;
                                }
                            }
                        }
                        assertTrue(msg, dataFound);
                    }
                }
                String msg = prefix + " no more expected";
                if (withData) {
                    status = jc.getNext(key, data, LockMode.DEFAULT);
                } else {
                    status = jc.getNext(key, LockMode.DEFAULT);
                }
                assertEquals(msg, OperationStatus.NOTFOUND, status);

                Cursor[] sorted = DbInternal.getSortedCursors(jc);
                assertEquals(CURSOR_ORDER.length, sorted.length);
                if (config == joinConfigNoSort) {
                    Database db0 = sorted[0].getDatabase();
                    Database db1 = sorted[1].getDatabase();
                    Database db2 = sorted[2].getDatabase();
                    assertSame(db0, secDb0);
                    assertSame(db1, secDb1);
                    assertSame(db2, secDb2);
                } else if (setNum == CURSOR_ORDER_SET) {
                    Database db0 = sorted[CURSOR_ORDER[0]].getDatabase();
                    Database db1 = sorted[CURSOR_ORDER[1]].getDatabase();
                    Database db2 = sorted[CURSOR_ORDER[2]].getDatabase();
                    assertSame(db0, secDb0);
                    assertSame(db1, secDb1);
                    assertSame(db2, secDb2);
                }
                jc.close();
            }
        }

        c0.close();
        c1.close();
View Full Code Here

     */
    void close()
        throws DatabaseException {

        if (joinCursor != null) {
            JoinCursor toClose = joinCursor;
            joinCursor = null;
            toClose.close();
        }
        if (cursor != null) {
            Cursor toClose = cursor.getCursor();
            cursor = null;
            view.currentTxn.closeCursor(toClose );
View Full Code Here

     */
    void close()
        throws DatabaseException {

        if (joinCursor != null) {
            JoinCursor toClose = joinCursor;
            joinCursor = null;
            toClose.close();
        }
        if (cursor != null) {
            Cursor toClose = cursor.getCursor();
            cursor = null;
            view.currentTxn.closeCursor(toClose );
View Full Code Here

TOP

Related Classes of com.sleepycat.je.JoinCursor

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.