Class ErrorMsg


public final class ErrorMsg extends InitializationMsg
This message is part of the replication protocol.

This message is sent by a server or a replication server when an error is detected in the context of a total update.

  • Constructor Details

    • ErrorMsg

      public ErrorMsg(ServerId<?> sender, ReplicaId destination, LocalizableMessage details)
      Creates an ErrorMsg providing the destination server.

      Both a replica and a replication server can send an error message, so sender must be able to represent either a ReplicaId or a ReplicationServerId.

      Parameters:
      sender - The server ID of the server that send this message.
      destination - The destination server or servers of this message.
      details - The message containing the details of the error.
  • Method Details

    • shouldRetryInitialize

      public boolean shouldRetryInitialize()
      Returns if reinitialization should be retried.

      Currently reinitialization will be retried when the message is about the source server is not connected to the topology.

      Returns:
      if reinitialization should be retried.
    • getDetails

      public LocalizableMessage getDetails()
      Get the details from this message.
      Returns:
      the details from this message.
    • getMsgID

      public String getMsgID()
      Get the msgID from this message.
      Returns:
      the msgID from this message.
    • getBytes

      public byte[] getBytes(short protocolVersion)
      Description copied from class: ReplicationMsg
      Serializes the PDU using the provided replication protocol version. WARNING: should be overwritten by a PDU (sub class) we want to support older protocol version serialization for.
      Specified by:
      getBytes in class ReplicationMsg
      Parameters:
      protocolVersion - The protocol version to use for serialization. The version should normally be older than the current one.
      Returns:
      The encoded PDU, or null if the message isn't supported in that protocol version.
    • toString

      public String toString()
      Returns a string representation of the message.
      Overrides:
      toString in class InitializationMsg
      Returns:
      the string representation of this message.
    • getCreationTime

      public long getCreationTime()
      Get the creation time of this message. When several attempts of initialization are done sequentially, it helps sorting the good ones, from the ones that relate to ended initialization when they are received.
      Returns:
      the creation time of this message.