Class ChunkWriter

java.lang.Object
org.apache.maven.index.reader.ChunkWriter
All Implemented Interfaces:
Closeable, AutoCloseable

public class ChunkWriter extends Object implements Closeable
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 Details

  • Method Details

    • getName

      public String getName()
      Returns the chunk name.
    • getVersion

      public int getVersion()
      Returns index version. All releases so far always returned 1.
    • getTimestamp

      public Date getTimestamp()
      Returns the index timestamp of last update of the index.
    • writeChunk

      public int writeChunk(Iterator<Map<String,String>> iterator) throws IOException
      Writes out the record iterator and returns the written record count.
      Throws:
      IOException
    • close

      public void close() throws IOException
      Closes this reader and it's underlying input.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException