THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
/** * Snapshot lifecycle listener. */ public interface SnapshotLifecycleListenerSnapshotLifecycleListener<T extends Serializable> extends Extension { /** Default listener priority. */ public static final int DEFAULT_PRIORITY = 0; /** Listener name (must be unique). */ public String name(); /** Listener invocation priority (ascending order is used). */ public default int priority() { return DEFAULT_PRIORITY; } /** * Called locally after the snapshot files have been created on the node. * * @param snpNamename Snapshot name. * @param @throwsmetadata IgniteCheckedExceptionSnapshot Ifmetadata failedfile. */ @param binaryDir Snapshot binary publicmetadata defaultdirectory. void afterCreate(String snpName) throws IgniteCheckedException* { @param marshallerDir Snapshot marshaller data directory. // No-op. * @param cacheDir } Snapshot cache /**data directory. * Called@throws locallyIgniteCheckedException before restore snapshot filesIf failed. */ public * @param snpName Snapshot name.default void afterCreate(String name, File metadata, * @param consId ConsistentPath snapshotbinaryDir, metadataPath file name. * @param grps Cache groups to be restored ({@code null} if all cache groups are restored from the snapshot).marshallerDir, Path cacheDir) throws IgniteCheckedException { // No-op. } /** * @paramCalled <T>locally Typebefore ofrestore thesnapshot resultfiles. * @return Local node result, or* {@code@param null}name if cluster-wide aggregation is not requiredSnapshot name. * @throws@param IgniteCheckedExceptiongrps IfCache failed. groups to be restored */ @Nullable public default <T> T beforeRestore(({@code null} if all cache groups are restored from the snapshot). * @param metadata StringSnapshot snpName, metadata file. * @param StringbinaryDir consId, Snapshot binary metadata directory. @Nullable* Collection<String>@param grps marshallerDir Snapshot marshaller data )directory. throws IgniteCheckedException { * @param cacheDir Snapshot cache return null; data directory. } /** * Process@return theLocal resultsnode ofresult, a pre-restore operation across the clusteror {@code null} if cluster-wide aggregation is not required. * @throws IgniteCheckedException If failed. */ @param res Results from@Nullable allpublic nodes. default T beforeRestore(String name, @Nullable *Collection<String> @throwsgrps, IgniteCheckedException If failed.File metadata, */ Path publicbinaryDir, defaultPath void handlePreRestoreResults(List<ComputeJobResult> resmarshallerDir, Path cacheDir) throws IgniteCheckedException { // No-op.return null; } /** * Process the results of a pre-restore operation across the cluster. * * @param res Results from all nodes. * @throws IgniteCheckedException If failed. */ public default void handlePreRestoreResults( String snapshotName, @Nullable Collection<String> grps, Map<ClusterNode, T> res, Map<ClusterNode, Exception> errs ) throws IgniteCheckedException { Map.Entry<ClusterNode, Exception> exEntry = F.first(errs.entrySet()); if (exEntry == null) return; throw new IgniteCheckedException("Snapshot restore handler " + getClass().getSimpleName() + " has failed on node " + exEntry.getKey().id() + '.', exEntry.getValue()); } } |
...