public class StateDirectory
extends java.lang.Object
StreamThread
are
stored. Handles creation/locking/unlocking/cleaning of the Task Directories. This class is not
thread-safe.Constructor and Description |
---|
StateDirectory(StreamsConfig config,
org.apache.kafka.common.utils.Time time)
Ensures that the state base directory as well as the application's sub-directory are created.
|
Modifier and Type | Method and Description |
---|---|
void |
clean() |
void |
cleanRemovedTasks(long cleanupDelayMs)
Remove the directories for any
TaskId s that are no-longer
owned by this StreamThread and aren't locked by either
another process or another StreamThread |
java.io.File |
directoryForTask(TaskId taskId)
Get or create the directory for the provided
TaskId . |
public StateDirectory(StreamsConfig config, org.apache.kafka.common.utils.Time time)
ProcessorStateException
- if the base state directory or application state directory does not exist
and could not be createdpublic java.io.File directoryForTask(TaskId taskId)
TaskId
.TaskId
ProcessorStateException
- if the task directory does not exists and could not be createdpublic void clean()
public void cleanRemovedTasks(long cleanupDelayMs)
TaskId
s that are no-longer
owned by this StreamThread
and aren't locked by either
another process or another StreamThread
cleanupDelayMs
- only remove directories if they haven't been modified for at least
this amount of time (milliseconds)