Class FSOrderedMapFile.MultiFSOMapWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable, FSOrderedMapFile.MapFileWriter
    Enclosing class:
    FSOrderedMapFile<K extends org.apache.hadoop.io.WritableComparable,​V extends org.apache.hadoop.io.Writable>

    public static class FSOrderedMapFile.MultiFSOMapWriter
    extends java.lang.Object
    implements FSOrderedMapFile.MapFileWriter, java.io.Flushable
    Writes out a FSOMapFile, but assumes that input data need not be sorted by key.
    • Constructor Detail

      • MultiFSOMapWriter

        public MultiFSOMapWriter​(java.lang.String filename,
                                 int numberOfValuesInMemory,
                                 FixedSizeWriteableFactory _keyFactory,
                                 FixedSizeWriteableFactory _valueFactory)
        Constructs an instance of the MultiFSOMapWriter.
        Parameters:
        filename -
        numberOfValuesInMemory -
        _keyFactory -
        _valueFactory -
      • MultiFSOMapWriter

        public MultiFSOMapWriter​(java.lang.String filename,
                                 int numberOfValuesInMemory,
                                 FixedSizeWriteableFactory _keyFactory,
                                 FixedSizeWriteableFactory _valueFactory,
                                 boolean dupsAllows)
        Constructs an instance of the MultiFSOMapWriter.
        Parameters:
        filename -
        numberOfValuesInMemory -
        _keyFactory -
        _valueFactory -
        dupsAllows - are duplicates allowed
    • Method Detail

      • write

        public void write​(org.apache.hadoop.io.WritableComparable key,
                          org.apache.hadoop.io.Writable value)
                   throws java.io.IOException
        Add this (key, value) tuple to the MapFile
        Specified by:
        write in interface FSOrderedMapFile.MapFileWriter
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Throws:
        java.io.IOException
      • flushCache

        protected void flushCache()
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • mergeTwo

        protected void mergeTwo​(int id1,
                                int id2,
                                java.lang.String filename)
                         throws java.io.IOException
        Throws:
        java.io.IOException