Package org.apache.maven.index.reader
Class ChunkWriter
- java.lang.Object
-
- org.apache.maven.index.reader.ChunkWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class ChunkWriter extends java.lang.Object implements java.io.CloseableMaven 2 Index published binary chunk writer, it writes raw Maven Indexer records to the transport binary format.- Since:
- 5.1.2
-
-
Constructor Summary
Constructors Constructor Description ChunkWriter(java.lang.String chunkName, java.io.OutputStream outputStream, int version, java.util.Date timestamp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this reader and it's underlying input.java.lang.StringgetName()Returns the chunk name.java.util.DategetTimestamp()Returns the index timestamp of last update of the index.intgetVersion()Returns index version.intwriteChunk(java.util.Iterator<java.util.Map<java.lang.String,java.lang.String>> iterator)Writes out the record iterator and returns the written record count.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the chunk name.
-
getVersion
public int getVersion()
Returns index version. All releases so far always returned1.
-
getTimestamp
public java.util.Date getTimestamp()
Returns the index timestamp of last update of the index.
-
writeChunk
public int writeChunk(java.util.Iterator<java.util.Map<java.lang.String,java.lang.String>> iterator) throws java.io.IOExceptionWrites out the record iterator and returns the written record count.- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionCloses this reader and it's underlying input.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-