Package org.voltdb.dtxn

Examples of org.voltdb.dtxn.UndoAction


            final Pair<Long, ? extends TheHashinator> snapshot = instance.get();
            if (version > snapshot.getFirst()) {
                final Pair<Long, ? extends TheHashinator> update =
                        Pair.of(version, existingHashinator);
                if (instance.compareAndSet(snapshot, update)) {
                    return Pair.of(new UndoAction() {
                        @Override
                        public void release() {}

                        @Override
                        public void undo() {
                            boolean rolledBack = instance.compareAndSet(update, snapshot);
                            if (!rolledBack) {
                                hostLogger.info(
                                        "Didn't roll back hashinator because it wasn't set to expected hashinator");
                            }
                        }
                    }, existingHashinator);
                }
            } else {
                return Pair.of(new UndoAction() {

                    @Override
                    public void release() {}

                    @Override
View Full Code Here


    private static void handleUndoLog(List<UndoAction> undoLog, boolean undo) {
        if (undoLog == null) return;

        for (final ListIterator<UndoAction> iterator = undoLog.listIterator(undoLog.size()); iterator.hasPrevious();) {
            final UndoAction action = iterator.previous();
            if (undo)
                action.undo();
            else
                action.release();
        }
    }
View Full Code Here

TOP

Related Classes of org.voltdb.dtxn.UndoAction

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.