Class StoredFieldsWriter

    • Method Detail

      • startDocument

        public abstract void startDocument​(int numStoredFields)
                                    throws IOException
        Called before writing the stored fields of the document. writeField(FieldInfo, IndexableField) will be called numStoredFields times. Note that this is called even if the document has no stored fields, in this case numStoredFields will be zero.
        Throws:
        IOException
      • finishDocument

        public void finishDocument()
                            throws IOException
        Called when a document and all its fields have been added.
        Throws:
        IOException
      • abort

        public abstract void abort()
        Aborts writing entirely, implementation should remove any partially-written files, etc.
      • finish

        public abstract void finish​(FieldInfos fis,
                                    int numDocs)
                             throws IOException
        Called before close(), passing in the number of documents that were written. Note that this is intentionally redundant (equivalent to the number of calls to startDocument(int), but a Codec should check that this is the case to detect the JRE bug described in LUCENE-1282.
        Throws:
        IOException