Class EntryLogMetadata

    • Field Detail

      • entryLogId

        protected long entryLogId
      • totalSize

        protected long totalSize
      • remainingSize

        protected long remainingSize
    • Constructor Detail

      • EntryLogMetadata

        protected EntryLogMetadata()
      • EntryLogMetadata

        public EntryLogMetadata​(long logId)
    • Method Detail

      • addLedgerSize

        public void addLedgerSize​(long ledgerId,
                                  long size)
      • containsLedger

        public boolean containsLedger​(long ledgerId)
      • getUsage

        public double getUsage()
      • isEmpty

        public boolean isEmpty()
      • getEntryLogId

        public long getEntryLogId()
      • getTotalSize

        public long getTotalSize()
      • getRemainingSize

        public long getRemainingSize()
      • removeLedgerIf

        public void removeLedgerIf​(java.util.function.LongPredicate predicate)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • serialize

        public void serialize​(java.io.DataOutputStream out)
                       throws java.io.IOException,
                              java.lang.IllegalStateException
        Serializes EntryLogMetadata and writes to DataOutputStream.
         schema:
         2-bytes: schema-version
         8-bytes: entrylog-entryLogId
         8-bytes: entrylog-totalSize
         8-bytes: entrylog-remainingSize
         8-bytes: total number of ledgers
         ledgers-map
         [repeat]: (8-bytes::ledgerId, 8-bytes::size-of-ledger)
         
        Parameters:
        out -
        Throws:
        java.io.IOException - throws if it couldn't serialize metadata-fields
        java.lang.IllegalStateException - throws if it couldn't serialize ledger-map
      • clear

        public void clear()