Package org.voltdb.sysprocs.saverestore

Examples of org.voltdb.sysprocs.saverestore.SnapshotWritePlan$TargetStatsClosure


                SNAP_LOG.error(String.format("JSON exception on snapshot data \"%s\".", data),
                        e);
            }
        }

        SnapshotWritePlan plan;
        if (format == SnapshotFormat.NATIVE) {
            plan = new NativeSnapshotWritePlan();
        }
        else if (format == SnapshotFormat.CSV) {
            plan = new CSVSnapshotWritePlan();
        }
        else if (format == SnapshotFormat.STREAM) {
            plan = new StreamSnapshotWritePlan();
        }
        else if (format == SnapshotFormat.INDEX) {
            plan = new IndexSnapshotWritePlan();
        }
        else {
            throw new RuntimeException("BAD BAD BAD");
        }
        final Callable<Boolean> deferredSetup = plan.createSetup(file_path, file_nonce, txnId,
                partitionTransactionIds, jsData, context, result, exportSequenceNumbers, tracker,
                hashinatorData, timestamp);
        m_deferredSetupFuture =
                VoltDB.instance().submitSnapshotIOWork(
                        new DeferredSnapshotSetup(plan, deferredSetup, txnId, partitionTransactionIds));

        synchronized (m_createLock) {
            //Seems like this should be cleared out just in case
            //Log if there is actually anything to clear since it is unexpected
            if (!m_taskListsForHSIds.isEmpty()) {
                SNAP_LOG.warn("Found lingering snapshot tasks while setting up a snapshot");
            }
            m_taskListsForHSIds.clear();
            m_createSuccess.set(true);
            m_createResult.set(result);

            m_taskListsForHSIds.putAll(plan.getTaskListsForHSIds());

            // HACK HACK HACK.  If the task list is empty, this host has no work to do for
            // this snapshot.  We're going to create an empty list of tasks for one of the sites to do
            // so that we'll have a SnapshotSiteProcessor which will do the logSnapshotCompleteToZK.
            if (m_taskListsForHSIds.isEmpty()) {
                SNAP_LOG.debug("Node had no snapshot work to do.  Creating a null task to drive completion.");
                m_taskListsForHSIds.put(context.getSiteId(), new ArrayDeque<SnapshotTableTask>());
            }
            SNAP_LOG.debug("Planned tasks: " +
                           CoreUtils.hsIdCollectionToString(plan.getTaskListsForHSIds().keySet()));
            SNAP_LOG.debug("Created tasks for HSIds: " +
                           CoreUtils.hsIdCollectionToString(m_taskListsForHSIds.keySet()));
        }
    }
View Full Code Here

TOP

Related Classes of org.voltdb.sysprocs.saverestore.SnapshotWritePlan$TargetStatsClosure

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.