Record Class MigrationChunkTransfer.TransferChunk

java.lang.Object
java.lang.Record
com.loomcache.server.cluster.MigrationChunkTransfer.TransferChunk
Enclosing class:
MigrationChunkTransfer

public static record MigrationChunkTransfer.TransferChunk(int partitionId, long chunkIndex, byte[] data, long checksum, long bytesInChunk) extends Record
Record representing a single chunk with metadata.
Since:
1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    TransferChunk(int partitionId, long chunkIndex, byte[] data, long checksum, long bytesInChunk)
    Creates an instance of a TransferChunk record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the value of the bytesInChunk record component.
    long
    Returns the value of the checksum record component.
    long
    Returns the value of the chunkIndex record component.
    byte[]
    Returns the value of the data record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the partitionId record component.
    final String
    Returns a string representation of this record class.
    boolean
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TransferChunk

      public TransferChunk(int partitionId, long chunkIndex, byte[] data, long checksum, long bytesInChunk)
      Creates an instance of a TransferChunk record class.
      Parameters:
      partitionId - the value for the partitionId record component
      chunkIndex - the value for the chunkIndex record component
      data - the value for the data record component
      checksum - the value for the checksum record component
      bytesInChunk - the value for the bytesInChunk record component
  • Method Details

    • data

      public byte[] data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component
    • verifyCrc32

      public boolean verifyCrc32()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • partitionId

      public int partitionId()
      Returns the value of the partitionId record component.
      Returns:
      the value of the partitionId record component
    • chunkIndex

      public long chunkIndex()
      Returns the value of the chunkIndex record component.
      Returns:
      the value of the chunkIndex record component
    • checksum

      public long checksum()
      Returns the value of the checksum record component.
      Returns:
      the value of the checksum record component
    • bytesInChunk

      public long bytesInChunk()
      Returns the value of the bytesInChunk record component.
      Returns:
      the value of the bytesInChunk record component