Enum Class ProtocolFeatures

java.lang.Object
java.lang.Enum<ProtocolFeatures>
com.loomcache.common.protocol.ProtocolFeatures
All Implemented Interfaces:
Serializable, Comparable<ProtocolFeatures>, Constable

public enum ProtocolFeatures extends Enum<ProtocolFeatures>
Feature bits advertised in the HelloPayload feature bitmap. Each bit announces a capability the sending node supports; the peer can use the bitmap AND of its own features to decide which optional protocols the connection may use.

Bit positions are part of the wire contract and MUST NOT change once released. New features append new bits; removed features leave a permanent hole. bitmask(Collection) / fromBitmap(long) convert between an EnumSet and the 64-bit wire representation.

BLK-2026-04-22-007 Day 1: introduced alongside the HelloPayload handshake. The bitmap reserves room for the optional protocols queued up through the remaining BLK-007 days (partition table RPC, cross-group SQL metadata, partition migration data, 2PC coordinator, CRDT WAN dispatch).

  • Enum Constant Details

    • PARTITION_TABLE_RPC

      public static final ProtocolFeatures PARTITION_TABLE_RPC
      Node will respond to PARTITION_TABLE_REQUEST opcodes (Day 2).
    • CROSS_GROUP_SQL_METADATA

      public static final ProtocolFeatures CROSS_GROUP_SQL_METADATA
      Node emits groupId dedup metadata on cross-group SQL results (Day 3).
    • PARTITION_MIGRATE_DATA

      public static final ProtocolFeatures PARTITION_MIGRATE_DATA
      Node implements the PARTITION_MIGRATE_DATA data shipping path (Days 6-8).
    • TX_2PC

      public static final ProtocolFeatures TX_2PC
      Node implements the cross-group 2PC coordinator + participant (BLK-001).
    • CRDT_WAN_DISPATCH

      public static final ProtocolFeatures CRDT_WAN_DISPATCH
      Node dispatches CRDT WAN events (future — BLK-006+011 v2.2 follow-up).
    • WIRE_COMPRESSION_LZ4

      public static final ProtocolFeatures WIRE_COMPRESSION_LZ4
      Node supports LZ4-compressed message bodies after PROTOCOL_HELLO negotiation.
    • WIRE_COMPRESSION_ZSTD

      public static final ProtocolFeatures WIRE_COMPRESSION_ZSTD
      Node supports zstd-compressed message bodies after PROTOCOL_HELLO negotiation.
    • SERVER_ASSIGNED_TTL

      public static final ProtocolFeatures SERVER_ASSIGNED_TTL
      Node converts relative MAP_PUT_WITH_TTL requests to server-assigned absolute expiration before Raft replication.
    • PARTITION_TABLE_ENDPOINTS

      public static final ProtocolFeatures PARTITION_TABLE_ENDPOINTS
      Peer accepts endpoint metadata appended to PARTITION_TABLE_RESPONSE payloads.
  • Method Details

    • values

      public static ProtocolFeatures[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ProtocolFeatures valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • bitPosition

      public int bitPosition()
      Returns:
      the index (0..63) of this feature's bit in the wire bitmap
    • mask

      public long mask()
      Returns:
      the 64-bit mask with only this feature's bit set
    • bitmask

      public static long bitmask(Collection<ProtocolFeatures> features)
      OR the bitmaps of the supplied features together.
      Parameters:
      features - the features to encode (non-null, may be empty)
      Returns:
      the wire bitmap for the feature set
    • bitmask

      public static long bitmask(ProtocolFeatures... features)
      OR the bitmaps of the supplied features together.
      Parameters:
      features - the features to encode (non-null, may be empty)
      Returns:
      the wire bitmap for the feature set
    • fromBitmap

      public static EnumSet<ProtocolFeatures> fromBitmap(long bitmap)
      Decode a wire bitmap into the set of known features it represents. Unknown bits (from a newer peer) are silently ignored — the peer will simply not use those optional protocols when talking to us.
      Parameters:
      bitmap - the 64-bit wire bitmap
      Returns:
      the set of features the peer advertised that this build recognizes
    • unknownBits

      public static List<Integer> unknownBits(long bitmap)
      Bits in the given bitmap that this build does NOT recognize. Useful for logging (operators can detect rolling-upgrade mismatches in the wild).
      Parameters:
      bitmap - the 64-bit wire bitmap
      Returns:
      the bit positions that are set but not known to this enum