Package de.hybris.platform.cronjob
Class StaleCronJobUnlocker
java.lang.Object
java.lang.Thread
de.hybris.platform.core.threadregistry.RegistrableThread
de.hybris.platform.cronjob.StaleCronJobUnlocker
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
StaleCronJobUnlockerTest.TestStaleCronJobUnlocker
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionStaleCronJobUnlocker(Tenant tenant) StaleCronJobUnlocker(String threadName, Tenant tenant) -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<ClusterNodeInfo>protected Durationprotected intgetNodeIds(Collection<ClusterNodeInfo> nodes) getStaleNodeIds(Collection<ClusterNodeInfo> allNodes, Predicate<ClusterNodeInfo> staleNodePredicate) getStaleNodeIds(Predicate<ClusterNodeInfo> staleNodePredicate) Deprecated, for removal: This API element is subject to removal in a future version.protected Predicate<ClusterNodeInfo>getStaleNodePredicate(Instant staleNodePingTsThreshold, Instant staleNodePingTsCutoff) protected Durationprotected InstantgetStaleNodeTsCutoff(Instant staleNodeThreshold) protected InstantgetStaleNodeTsThreshold(Instant now, Duration staleThreshold) protected voidprotected booleanvoidstopUpdatingAndFinish(long timeoutMillis) protected voidunlockCronJobsForNodeIds(Collection<Integer> staleNodes, Collection<Integer> allNodes) protected voidunlockCronJobsForNodeIds(List<Integer> staleNodes) Deprecated, for removal: This API element is subject to removal in a future version.since 2011, useunlockCronJobsForNodeIds(Collection, Collection)protected voidMethods inherited from class de.hybris.platform.core.threadregistry.RegistrableThread
registerThread, run, unregisterThread, withInitialInfoMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
PROPERTY_CRONJOB_UNLOCKER_ACTIVE
- See Also:
-
PROPERTY_CRONJOB_UNLOCKER_INTERVAL
- See Also:
-
PROPERTY_CRONJOB_STALE_NODE_INTERVAL
- See Also:
-
PROPERTY_CRONJOB_STALE_NODE_CUTOFF_INTERVAL
- See Also:
-
PROPERTY_CRONJOB_UNLOCK_LIMIT
- See Also:
-
-
Constructor Details
-
StaleCronJobUnlocker
-
StaleCronJobUnlocker
-
-
Method Details
-
internalRun
protected void internalRun()- Overrides:
internalRunin classRegistrableThread
-
shouldUnlockStaleCronJobs
protected boolean shouldUnlockStaleCronJobs() -
getCheckIntervalMs
-
unlockCronJobsFromLocalInstance
protected void unlockCronJobsFromLocalInstance() -
getAllNodes
-
getNodeIds
-
getStaleNodeThresholdInterval
-
unlockCronJobsForNodeIds
@Deprecated(since="2011", forRemoval=true) protected void unlockCronJobsForNodeIds(List<Integer> staleNodes) Deprecated, for removal: This API element is subject to removal in a future version.since 2011, useunlockCronJobsForNodeIds(Collection, Collection) -
unlockCronJobsForNodeIds
protected void unlockCronJobsForNodeIds(Collection<Integer> staleNodes, Collection<Integer> allNodes) -
getStaleNodeIds
protected List<Integer> getStaleNodeIds(Collection<ClusterNodeInfo> allNodes, Predicate<ClusterNodeInfo> staleNodePredicate) -
getStaleNodeIds
@Deprecated(since="2011", forRemoval=true) protected List<Integer> getStaleNodeIds(Predicate<ClusterNodeInfo> staleNodePredicate) Deprecated, for removal: This API element is subject to removal in a future version.since 2011, usegetStaleNodeIds(Collection, Predicate) -
getMaxCronJobsCountToBeUnlocked
protected int getMaxCronJobsCountToBeUnlocked() -
getStaleNodeTsThreshold
-
getStaleNodeTsCutoff
-
getStaleNodePredicate
protected Predicate<ClusterNodeInfo> getStaleNodePredicate(Instant staleNodePingTsThreshold, Instant staleNodePingTsCutoff) -
stopUpdatingAndFinish
public void stopUpdatingAndFinish(long timeoutMillis)
-
getStaleNodeIds(Collection, Predicate)