Interface ResumeStrategy
- All Superinterfaces:
AutoCloseable, Service
Defines a strategy for handling resume operations. Implementations can define different ways to handle how to resume
processing records.
- Since:
- 3.17
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA callback that can be executed after the last offset is updated -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGets an adapter for resuming operationsdefault <T extends ResumeAdapter>
TgetAdapter(Class<T> clazz) Gets and adapter for resuming operationsGets the configuration for this resume strategy.default voidLoads the cache with the data currently available in this strategyvoidsetAdapter(ResumeAdapter adapter) Sets an adapter for resuming operations with this strategyvoidsetResumeStrategyConfiguration(ResumeStrategyConfiguration resumeStrategyConfiguration) Sets the configuration for this resume strategy.voidupdateLastOffset(OffsetKey<?> offsetKey, Offset<?> offsetValue) Updates the last processed offsetvoidupdateLastOffset(OffsetKey<?> offsetKey, Offset<?> offset, @Nullable ResumeStrategy.UpdateCallBack updateCallBack) Updates the last processed offset<T extends Resumable>
voidupdateLastOffset(T offset) Updates the last processed offset<T extends Resumable>
voidupdateLastOffset(T offset, @Nullable ResumeStrategy.UpdateCallBack updateCallBack) Updates the last processed offset
-
Field Details
-
DEFAULT_NAME
- See Also:
-
-
Method Details
-
setAdapter
Sets an adapter for resuming operations with this strategy- Parameters:
adapter- the component-specific resume adapter
-
getAdapter
ResumeAdapter getAdapter()Gets an adapter for resuming operations -
getAdapter
Gets and adapter for resuming operations- Type Parameters:
T- the type of the adapter- Parameters:
clazz- the class of the adapter- Returns:
- the adapter or null if it can't be cast to the requested class
-
loadCache
-
updateLastOffset
-
updateLastOffset
<T extends Resumable> void updateLastOffset(T offset, @Nullable ResumeStrategy.UpdateCallBack updateCallBack) throws Exception Updates the last processed offset- Parameters:
offset- the offset to updateupdateCallBack- a callback to be executed after the updated has occurred (null if not available)- Throws:
Exception- if unable to update the offset
-
updateLastOffset
-
updateLastOffset
void updateLastOffset(OffsetKey<?> offsetKey, Offset<?> offset, @Nullable ResumeStrategy.UpdateCallBack updateCallBack) throws Exception Updates the last processed offset- Parameters:
offsetKey- the offset key to updateoffset- the offset value to updateupdateCallBack- a callback to be executed after the updated has occurred (null if not available)- Throws:
Exception- if unable to update the offset
-
setResumeStrategyConfiguration
Sets the configuration for this resume strategy.- Parameters:
resumeStrategyConfiguration- the resume strategy configuration
-
getResumeStrategyConfiguration
ResumeStrategyConfiguration getResumeStrategyConfiguration()Gets the configuration for this resume strategy.- Returns:
- the resume strategy configuration
-