类 ChunkMonitor
- java.lang.Object
- org.springframework.batch.item.ItemStreamSupport
- org.springframework.batch.core.step.item.ChunkMonitor
- 所有已实现的接口:
ItemStream
public class ChunkMonitor extends ItemStreamSupport
Manage the offset data between the last successful commit and updates made to an input chunk. Only works with single threaded steps because it has to use aThreadLocal
to manage the state and coordinate between the caller and the wrappedItemStream
.- 从以下版本开始:
- 2.0
- 作者:
- Dave Syer
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
ChunkMonitor.ChunkMonitorData
构造器概要
构造器 构造器 说明 ChunkMonitor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
close()
No-op.int
getOffset()
void
incrementOffset()
void
open(ExecutionContext executionContext)
No-op.void
registerItemStream(ItemStream stream)
void
resetOffset()
void
setChunkSize(int chunkSize)
void
setItemReader(ItemReader<?> reader)
void
update(ExecutionContext executionContext)
Return emptyExecutionContext
.从类继承的方法 org.springframework.batch.item.ItemStreamSupport
getExecutionContextKey, setExecutionContextName, setName
构造器详细资料
ChunkMonitor
public ChunkMonitor()
方法详细资料
registerItemStream
public void registerItemStream(ItemStream stream)
- 参数:
stream
- the stream to set
setItemReader
public void setItemReader(ItemReader<?> reader)
- 参数:
reader
- the reader to set
incrementOffset
public void incrementOffset()
getOffset
public int getOffset()
resetOffset
public void resetOffset()
setChunkSize
public void setChunkSize(int chunkSize)
close
public void close() throws ItemStreamException
从类复制的说明:ItemStreamSupport
No-op.- 指定者:
close
在接口中ItemStream
- 覆盖:
close
在类中ItemStreamSupport
- 抛出:
ItemStreamException
- 另请参阅:
ItemStream.close()
open
public void open(ExecutionContext executionContext) throws ItemStreamException
从类复制的说明:ItemStreamSupport
No-op.- 指定者:
open
在接口中ItemStream
- 覆盖:
open
在类中ItemStreamSupport
- 参数:
executionContext
- current step'sExecutionContext
. Will be the executionContext from the last run of the step on a restart.- 抛出:
ItemStreamException
- 另请参阅:
ItemStream.open(ExecutionContext)
update
public void update(ExecutionContext executionContext) throws ItemStreamException
从类复制的说明:ItemStreamSupport
Return emptyExecutionContext
.- 指定者:
update
在接口中ItemStream
- 覆盖:
update
在类中ItemStreamSupport
- 参数:
executionContext
- to be updated- 抛出:
ItemStreamException
- 另请参阅:
ItemStream.update(ExecutionContext)