Examples of Bin


Examples of com.aerospike.client.Bin

   * @param value        single-bin value
   * @return          {@link ClResultCode result status}
   */
  public ClResultCode set(Object key, Object value) {
    try {
      super.put(defaultWritePolicy, new Key(mDefaultNamespace, "", Value.get(key)), new Bin(null, value));
      return ClResultCode.OK;
    }
    catch (AerospikeException ae) {
      return getResultCode(ae);
    }
View Full Code Here

Examples of com.bigml.histogram.Bin

    }

    private static Collection<Bin<SimpleTarget>> getBins() {
        Collection<Bin<SimpleTarget>> bins = new ArrayList<Bin<SimpleTarget>>();
        for (int i = 1; i < 3; i++) {
            bins.add(new Bin(55.55 + i, (double) i, SimpleTarget.TARGET));
        }
        return bins;
    }
View Full Code Here

Examples of com.sleepycat.je.tree.BIN

            Iterator<BINReference> it = queueSnapshot.iterator();
            while (it.hasNext()) {
                BINReference binRef = it.next();
                DatabaseImpl db = dbTree.getDb
                    (binRef.getDatabaseId(), lockTimeout, dbCache);
                BIN bin = searchForBIN(db, binRef);
                if (bin != null) {
                    bin.verifyCursors();
                    bin.releaseLatch();
                }
            }
        } finally {
            dbTree.releaseDbs(dbCache);
        }
View Full Code Here

Examples of com.sleepycat.je.tree.BIN

        /* Only BINs are compressible. */
        if (!in.isCompressible()) {
            return;
        }
        final BIN bin = (BIN) in;
        assert bin.isLatchOwnerForWrite();

        /* Cursors prohibit compression. */
        if (bin.nCursors() > 0) {
            return;
        }

        /* Compress. Then if empty, queue for pruning. */
        if (bin.compress(null /*localTracker*/)) {
            if (bin.getNEntries() == 0) {
                addBinToQueue(bin, false);
            }
        }

        lazyProcessed++;
View Full Code Here

Examples of com.sleepycat.je.tree.BIN

     * @param key on return contains the key if available, or null.
     * @param data on return contains the data if available, or null.
     */
    public boolean advanceCursor(DatabaseEntry key, DatabaseEntry data) {

        BIN oldBin = bin;
        int oldIndex = index;

        key.setData(null);
        data.setData(null);

View Full Code Here

Examples of com.sleepycat.je.tree.BIN

    public BIN latchBIN()
        throws DatabaseException {

        while (bin != null) {
            BIN waitingOn = bin;
            waitingOn.latch(cacheMode);
            if (bin == waitingOn) {
                return bin;
            }
            waitingOn.releaseLatch();
        }

        return null;
    }
View Full Code Here

Examples of com.sleepycat.je.tree.BIN

    }

    private void removeCursor()
        throws DatabaseException {

        BIN abin = latchBIN();
        if (abin != null) {
            abin.removeCursor(this);
            abin.releaseLatch();
        }
    }
View Full Code Here

Examples of com.sleepycat.je.tree.BIN

        }
        if (bin == null) {
            /* Nothing to evict. */
            return;
        }
        final BIN nextBin;
        final int nextIndex;
        if (newCursor != null) {
            nextBin = newCursor.bin;
            nextIndex = newCursor.index;
        } else {
View Full Code Here

Examples of com.sleepycat.je.tree.BIN

                        latchBIN();
                    }
                    binToBeRemoved = bin;
                    bin = null;

                    BIN newBin;

                    /*
                     * SR #12736
                     * Prune away oldBin. Assert has intentional side effect
                     */
                    assert TestHookExecute.doHookIfSet(testHook);

                    if (forward) {
                        newBin = databaseImpl.getTree().getNextBin
                            (binToBeRemoved, cacheMode);
                    } else {
                        newBin = databaseImpl.getTree().getPrevBin
                            (binToBeRemoved, cacheMode);
                    }
                    if (newBin == null) {
                        result = OperationStatus.NOTFOUND;
                        break;
                    } else {
                        if (forward) {
                            index = -1;
                        } else {
                            index = newBin.getNEntries();
                        }
                        addCursor(newBin);
                        /* Ensure that setting bin is under newBin's latch */
                        bin = newBin;
                        alreadyLatched = true;
View Full Code Here

Examples of com.sleepycat.je.tree.BIN

                              RangeConstraint rangeConstraint,
                              CursorImpl finalPositionCursor) {

        /* Start with the entry at the cursor position. */
        final Tree tree = databaseImpl.getTree();
        BIN curBin = latchBIN();
        int prevIndex = getIndex();
        long count = 0;

        try {
            while (true) {
                /* Skip entries in the current BIN. */
                count = skipEntries
                    (forward, maxCount, rangeConstraint, finalPositionCursor,
                     curBin, prevIndex, count);
                if (count < 0) {
                    return (- count);
                }

                /*
                 * Get the parent IN at level two.  The BIN is unlatched by
                 * getParentINForChildIN.  Before releasing the BIN latch, get
                 * the search key for the last entry.
                 */
                final byte[] idKey = (curBin.getNEntries() == 0) ?
                    curBin.getIdentifierKey() :
                    (forward ?
                     curBin.getKey(curBin.getNEntries() - 1) :
                     curBin.getKey(0));
                final BIN binToFind = curBin;
                curBin = null; // BIN latch will be released.

                final SearchResult result = tree.getParentINForChildIN
                    (binToFind, true /*requireExactMatch*/,
                     CacheMode.UNCHANGED);

                final IN parent = result.parent;
                boolean fetchOrWait = false;

                try {
                    if (!result.exactParentFound) {
                        throw EnvironmentFailureException.unexpectedState
                            ("Cannot get parent of BIN id=" +
                             binToFind.getNodeId() + " key=" +
                             Arrays.toString(idKey));
                    }

                    /*
                     * Find previous child BIN by matching idKey rather than
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.