Class OffsetCheckpoint
java.lang.Object
io.confluent.kafka.schemaregistry.storage.OffsetCheckpoint
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
OffsetCheckpointReadOnly
This class saves out a map of topic/partition=>offsets to a file.
The format of the file is UTF-8 text containing the following:
<version> <n> <topic_name_1> <partition_1> <offset_1> . . . <topic_name_n> <partition_n> <offset_n>The first line contains a number designating the format version (currently 0), the get line contains a number giving the total number of offsets. Each successive line gives a topic/partition/offset triple separated by spaces.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
CHECKPOINT_FILE_NAME
- See Also:
-
LOCK_FILE_NAME
- See Also:
-
file
-
-
Constructor Details
-
OffsetCheckpoint
- Throws:
IOException
-
-
Method Details
-
setUpLockFile
- Throws:
IOException
-
baseDir
- Throws:
IOException
-
write
Write the given offsets to the checkpoint file. All offsets should be non-negative.- Throws:
IOException- if any file operation fails with an IO exception
-
read
Reads the offsets from the local checkpoint file, skipping any negative offsets it finds.- Throws:
IOException- if any file operation fails with an IO exceptionIllegalArgumentException- if the offset checkpoint version is unknown
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
delete
- Throws:
IOException- if there is any IO exception during delete
-
toString
-