Class SegmentTarWriter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the archive.
      boolean containsSegment​(long msb, long lsb)
      Check if the segment exists.
      void flush()
      Flush all the data to the storage.
      int getEntryCount()
      Get the number of entries currently contained in the archive.
      long getLength()
      Get the current length of the archive.
      java.lang.String getName()
      Get the name of the archive.
      boolean isCreated()
      Check if the archive has been created (eg.
      org.apache.jackrabbit.oak.commons.Buffer readSegment​(long msb, long lsb)
      Read the segment.
      void writeBinaryReferences​(byte[] data)
      Write the binary references data.
      void writeGraph​(byte[] data)
      Write the graph data.
      void writeSegment​(long msb, long lsb, byte[] data, int offset, int size, int generation, int fullGeneration, boolean compacted)
      Write the new segment to the archive.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • writeSegment

        public void writeSegment​(long msb,
                                 long lsb,
                                 byte[] data,
                                 int offset,
                                 int size,
                                 int generation,
                                 int fullGeneration,
                                 boolean compacted)
                          throws java.io.IOException
        Description copied from interface: SegmentArchiveWriter
        Write the new segment to the archive.
        Specified by:
        writeSegment in interface SegmentArchiveWriter
        Parameters:
        msb - the most significant bits of the identifier of the segment
        lsb - the least significant bits of the identifier of the segment
        data - the data.
        offset - the start offset in the data.
        size - the number of bytes to write.
        generation - the segment generation, see SegmentArchiveEntry.getGeneration()
        fullGeneration - the segment full generation, see SegmentArchiveEntry.getFullGeneration()
        compacted - the segment compaction property, see SegmentArchiveEntry.isCompacted()
        Throws:
        java.io.IOException
      • readSegment

        public org.apache.jackrabbit.oak.commons.Buffer readSegment​(long msb,
                                                                    long lsb)
                                                             throws java.io.IOException
        Description copied from interface: SegmentArchiveWriter
        Read the segment.
        Specified by:
        readSegment in interface SegmentArchiveWriter
        Parameters:
        msb - the most significant bits of the identifier of the segment
        lsb - the least significant bits of the identifier of the segment
        Returns:
        byte buffer containing the segment data or null if segment doesn't exist
        Throws:
        java.io.IOException
      • containsSegment

        public boolean containsSegment​(long msb,
                                       long lsb)
        Description copied from interface: SegmentArchiveWriter
        Check if the segment exists.
        Specified by:
        containsSegment in interface SegmentArchiveWriter
        Parameters:
        msb - the most significant bits of the identifier of the segment
        lsb - the least significant bits of the identifier of the segment
        Returns:
        true if the segment exists
      • writeGraph

        public void writeGraph​(byte[] data)
                        throws java.io.IOException
        Description copied from interface: SegmentArchiveWriter
        Write the graph data.
        Specified by:
        writeGraph in interface SegmentArchiveWriter
        Parameters:
        data - serialized segment graph data
        Throws:
        java.io.IOException
      • writeBinaryReferences

        public void writeBinaryReferences​(byte[] data)
                                   throws java.io.IOException
        Description copied from interface: SegmentArchiveWriter
        Write the binary references data.
        Specified by:
        writeBinaryReferences in interface SegmentArchiveWriter
        Parameters:
        data - serialized binary references data
        Throws:
        java.io.IOException
      • isCreated

        public boolean isCreated()
        Description copied from interface: SegmentArchiveWriter
        Check if the archive has been created (eg. something has been written).
        Specified by:
        isCreated in interface SegmentArchiveWriter
        Returns:
        true if the archive has been created, false otherwise