Package com.persistit

Examples of com.persistit.Exchange.clear()


        Exchange ex = schemaTreeExchange(session);
        try{
            OnlineCache onlineCache = new OnlineCache();

            // Load affected schemas, then remaining schemas and create full AIS.
            ex.clear().append(S_K_ONLINE).append(Key.BEFORE);
            while(ex.next()) {
                long onlineID = ex.getKey().indexTo(-1).decodeLong();
                long generation = ex.getValue().getLong();

                int schemaCount = 0;
View Full Code Here


                    onlineCache.onlineToAIS.put(onlineID, newAIS);
                } else if(schemaCount != 0) {
                    throw new IllegalStateException("No generation but had schemas");
                }

                ex.clear().append(S_K_ONLINE).append(onlineID).append(S_K_CHANGE).append(Key.BEFORE);
                while(ex.next()) {
                    int tid = ex.getKey().indexTo(-1).decodeInt();
                    Long prev = onlineCache.tableToOnline.put(tid, onlineID);
                    assert (prev == null) : String.format("%d, %d, %d", tid, prev, onlineID);
                    TableChanges.ChangeSet changeSet = ChangeSetHelper.load(ex.getValue().getByteArray());
View Full Code Here

                    assert (prev == null) : String.format("%d, %d, %d", tid, prev, onlineID);
                    TableChanges.ChangeSet changeSet = ChangeSetHelper.load(ex.getValue().getByteArray());
                    onlineCache.onlineToChangeSets.put(onlineID, changeSet);
                }

                ex.clear().append(S_K_ONLINE).append(onlineID);
            }

            return onlineCache;
        } catch(PersistitException | RollbackException e) {
            throw wrapPersistitException(session, e);
View Full Code Here

    @Override
    protected long generateSaveOnlineSessionID(Session session) {
        Exchange ex = schemaTreeExchange(session);
        try {
            long id = ex.getTree().getSeqAccumulator(ACCUMULATOR_INDEX_ONLINE_ID).allocate();
            ex.clear().append(S_K_ONLINE).append(id);
            ex.getValue().put(-1L); // No generation yet
            ex.store();
            return id;
        } catch(PersistitException | RollbackException e) {
            throw wrapPersistitException(session, e);
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.