Class SegmentIdProperties.Chain.PrefetchWorker
java.lang.Object
me.ahoo.cosid.spring.boot.starter.segment.SegmentIdProperties.Chain.PrefetchWorker
- Enclosing class:
- SegmentIdProperties.Chain
Configuration for the prefetch worker that manages segment prefetching.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the core pool size for the executor.Gets the prefetch period.booleanChecks if shutdown hook is enabled.voidsetCorePoolSize(int corePoolSize) Sets the core pool size for the executor.voidsetPrefetchPeriod(Duration prefetchPeriod) Sets the prefetch period.voidsetShutdownHook(boolean shutdownHook) Sets whether to enable shutdown hook.
-
Constructor Details
-
PrefetchWorker
public PrefetchWorker()
-
-
Method Details
-
getPrefetchPeriod
Gets the prefetch period.- Returns:
- the prefetch period duration
-
setPrefetchPeriod
Sets the prefetch period.- Parameters:
prefetchPeriod- the prefetch period to set
-
getCorePoolSize
public int getCorePoolSize()Gets the core pool size for the executor.- Returns:
- the core pool size
-
setCorePoolSize
public void setCorePoolSize(int corePoolSize) Sets the core pool size for the executor.- Parameters:
corePoolSize- the core pool size to set
-
isShutdownHook
public boolean isShutdownHook()Checks if shutdown hook is enabled.- Returns:
- true if shutdown hook is enabled, false otherwise
-
setShutdownHook
public void setShutdownHook(boolean shutdownHook) Sets whether to enable shutdown hook.- Parameters:
shutdownHook- true to enable shutdown hook, false to disable
-