Class LogEntry

java.lang.Object
org.jgroups.protocols.raft.LogEntry
All Implemented Interfaces:
org.jgroups.util.SizeStreamable, org.jgroups.util.Streamable

public class LogEntry extends Object implements org.jgroups.util.SizeStreamable
An element in a log. Captures the term and command to be applied to the state machine
Since:
0.1
Author:
Bela Ban
  • Field Details

    • term

      protected long term
    • command

      protected byte[] command
    • offset

      protected int offset
    • length

      protected int length
    • internal

      protected boolean internal
  • Constructor Details

    • LogEntry

      public LogEntry()
    • LogEntry

      public LogEntry(long term, byte[] command)
    • LogEntry

      public LogEntry(long term, byte[] command, int offset, int length)
    • LogEntry

      public LogEntry(long term, byte[] command, int offset, int length, boolean internal)
  • Method Details

    • term

      public long term()
    • term

      public LogEntry term(long t)
    • command

      public byte[] command()
    • offset

      public int offset()
    • length

      public int length()
    • internal

      public boolean internal()
    • internal

      public LogEntry internal(boolean b)
    • serializedSize

      public int serializedSize()
      Specified by:
      serializedSize in interface org.jgroups.util.SizeStreamable
    • writeTo

      public void writeTo(DataOutput out) throws IOException
      Specified by:
      writeTo in interface org.jgroups.util.Streamable
      Throws:
      IOException
    • readFrom

      public void readFrom(DataInput in) throws IOException
      Specified by:
      readFrom in interface org.jgroups.util.Streamable
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object