Class FSOMapFileLexiconOutputStreamGeneric<T1,​T2 extends org.apache.hadoop.io.WritableComparable<?>>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    FSOMapFileLexiconOutputStream

    public abstract class FSOMapFileLexiconOutputStreamGeneric<T1,​T2 extends org.apache.hadoop.io.WritableComparable<?>>
    extends LexiconOutputStream<T1>
    • Field Detail

      • tempKey

        protected final T2 extends org.apache.hadoop.io.WritableComparable<?> tempKey
      • leValueClassname

        protected java.lang.String leValueClassname
      • structureName

        protected final java.lang.String structureName
    • Constructor Detail

      • FSOMapFileLexiconOutputStreamGeneric

        public FSOMapFileLexiconOutputStreamGeneric​(java.lang.String path,
                                                    java.lang.String prefix,
                                                    java.lang.String _structureName,
                                                    FixedSizeWriteableFactory<T2> _keyFactory)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • FSOMapFileLexiconOutputStreamGeneric

        public FSOMapFileLexiconOutputStreamGeneric​(IndexOnDisk _index,
                                                    java.lang.String _structureName,
                                                    java.lang.Class<? extends FixedSizeWriteableFactory<LexiconEntry>> valueFactoryClass)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • FSOMapFileLexiconOutputStreamGeneric

        public FSOMapFileLexiconOutputStreamGeneric​(IndexOnDisk _index,
                                                    java.lang.String _structureName,
                                                    FixedSizeWriteableFactory<T2> _keyFactory,
                                                    java.lang.String valueFactoryClassName)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • FSOMapFileLexiconOutputStreamGeneric

        public FSOMapFileLexiconOutputStreamGeneric​(java.lang.String filename,
                                                    FixedSizeWriteableFactory<T2> _keyFactory)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • writeNextEntry

        public int writeNextEntry​(T1 _key,
                                  LexiconEntry _value)
                           throws java.io.IOException
        Description copied from class: LexiconOutputStream
        Writes a lexicon entry.
        Specified by:
        writeNextEntry in class LexiconOutputStream<T1>
        Parameters:
        _key - the key - usually the term
        _value - the lexicon entry value
        Returns:
        the number of bytes written to the file.
        Throws:
        java.io.IOException - if an I/O error occurs
      • setKey

        protected abstract void setKey​(T1 k)
      • close

        public void close()
        Description copied from class: LexiconOutputStream
        Closes the lexicon stream. IOException if an I/O error occurs while closing the stream.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class LexiconOutputStream<T1>
      • addLexiconToIndex

        public static void addLexiconToIndex​(IndexOnDisk index,
                                             java.lang.String structureName,
                                             java.lang.Class<? extends Lexicon<?>> lexClass,
                                             java.lang.Class<? extends java.util.Iterator<?>> lexInputStreamClass,
                                             java.lang.Class<? extends java.util.Iterator<LexiconEntry>> lexEntryInputStreamClass,
                                             java.lang.String leValueClassname)
        Adds Lexicon to index
        Parameters:
        index -
        structureName -
        leValueClassname -