Package org.apache.maven.index.reader
Class ChunkWriter
java.lang.Object
org.apache.maven.index.reader.ChunkWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
Maven Index published binary chunk writer, it writes raw Maven Indexer records to the transport binary format.
Instances of this class MUST BE handled as resources (have them closed once done with them), it is user
responsibility to close them, ideally in try-with-resource block.
- Since:
- 5.1.2
-
Constructor Summary
ConstructorDescriptionChunkWriter
(String chunkName, OutputStream outputStream, int version, Date timestamp) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this reader and it's underlying input.getName()
Returns the chunk name.Returns the index timestamp of last update of the index.int
Returns index version.int
writeChunk
(Iterator<Map<String, String>> iterator) Writes out the record iterator and returns the written record count.
-
Constructor Details
-
ChunkWriter
public ChunkWriter(String chunkName, OutputStream outputStream, int version, Date timestamp) throws IOException - Throws:
IOException
-
-
Method Details
-
getName
Returns the chunk name. -
getVersion
public int getVersion()Returns index version. All releases so far always returned1
. -
getTimestamp
Returns the index timestamp of last update of the index. -
writeChunk
Writes out the record iterator and returns the written record count.- Throws:
IOException
-
close
Closes this reader and it's underlying input.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-