Class EntryRecord


  • public class EntryRecord
    extends java.lang.Object
    Helper for reading/writing entries into file.
    Author:
    Radim Vansa <rvansa@redhat.com>
    • Constructor Detail

      • EntryRecord

        public EntryRecord​(EntryHeader header,
                           byte[] key,
                           byte[] metadata,
                           byte[] value)
    • Method Detail

      • getKey

        public byte[] getKey()
      • getMetadata

        public byte[] getMetadata()
      • getValue

        public byte[] getValue()
      • loadMetadataAndValue

        public EntryRecord loadMetadataAndValue​(FileProvider.Handle handle,
                                                int offset)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • readEntryHeader

        public static EntryHeader readEntryHeader​(FileProvider.Handle handle,
                                                  long offset)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readKey

        public static byte[] readKey​(FileProvider.Handle handle,
                                     EntryHeader header,
                                     long offset)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • readMetadata

        public static byte[] readMetadata​(FileProvider.Handle handle,
                                          EntryHeader header,
                                          long offset)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • readValue

        public static byte[] readValue​(FileProvider.Handle handle,
                                       EntryHeader header,
                                       long offset)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEntry

        public static void writeEntry​(java.nio.channels.FileChannel fileChannel,
                                      byte[] serializedKey,
                                      byte[] serializedMetadata,
                                      byte[] serializedValue,
                                      long seqId,
                                      long expiration)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEntry

        public static void writeEntry​(java.nio.channels.FileChannel fileChannel,
                                      ByteBuffer serializedKey,
                                      ByteBuffer serializedMetadata,
                                      ByteBuffer serializedValue,
                                      long seqId,
                                      long expiration)
                               throws java.io.IOException
        Throws:
        java.io.IOException