public interface ProgressListener<T extends Enum<T>>
PreloadConfig.setProgressListener(com.sleepycat.je.ProgressListener<com.sleepycat.je.PreloadConfig.Phases>), which accepts a ProgressListener<PreloadConfig.Phase>, and reports on Environment.preload() or Database.preload()
EnvironmentConfig.setRecoveryProgressListener(com.sleepycat.je.ProgressListener<com.sleepycat.je.RecoveryProgress>), which accepts a ProgressListener<RecoveryProgress>, and reports on environment startup.
ReplicationConfig.setSyncupProgressListener(com.sleepycat.je.ProgressListener<com.sleepycat.je.rep.SyncupProgress>), which accepts a ProgressListener<SyncupProgress>, and reports on replication stream syncup.
boolean progress(T phase, long n, long total)
This method should do the minimal amount of work, queuing any resource intensive operations for processing by another thread before returning to the caller, so that it does not unduly delay the target operation, which invokes this method.
The applicaton should also be aware that the method has potential to disrupt the reported-upon operation. If the progress() throws a RuntimeException, the operation for which the progress is being reported will be aborted and the exception propagated back to the original caller. Also, if progress() returns false, the operation will be halted. For recovery and syncup listeners, a false return value can invalidate and close the environment.
phase- an enum indicating the phase of the operation for which progress is being reported.
n- indicates the number of units that have been processed so far. If this does not apply, -1 is returned.
total- indicates the total number of units that will be processed if it is known by JE. If total is < 0, then the total number is unknown. When total == n, this indicates that processing of this operation is 100% complete, even if all previous calls to progress passed a negative value for total.
Copyright (c) 2004, 2013 Oracle and/or its affiliates. All rights reserved.