Class EntryRecord


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

      • getKey

        public byte[] getKey()
      • getMetadata

        public byte[] getMetadata()
      • getValue

        public byte[] getValue()
      • getCreated

        public long getCreated()
      • getLastUsed

        public long getLastUsed()
      • 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
      • 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,
                                      EntryMetadata metadata,
                                      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,
                                      long created,
                                      long lastUsed)
                               throws java.io.IOException
        Throws:
        java.io.IOException