Enum ServerType

  • All Implemented Interfaces:
    Serializable, Comparable<ServerType>

    public enum ServerType
    extends Enum<ServerType>
    This enum represents types of druid services that hold segments.

    These types are externally visible (e.g., from the output of ServersResource.makeSimpleServer(org.apache.druid.client.DruidServer)).

    For backwards compatibility, when presenting these types externally, the toString() representation of the enum should be used.

    The toString() method converts the enum name() to lowercase and replaces underscores with hyphens, which is the format expected for the server type string prior to the patch that introduced ServerType: https://github.com/apache/druid/pull/4148 This is a historical occasion that this enum is different from NodeRole because they are essentially the same abstraction, but merging them could only increase the complexity and drop the code safety, because they name the same types differently ("indexer-executor" - "peon" and "realtime" - "middleManager") and both expose them via JSON APIs. These abstractions can probably be merged when Druid updates to Jackson 2.9 that supports JsonAliases, see see https://github.com/apache/druid/issues/7152.

    • Enum Constant Detail

      • HISTORICAL

        public static final ServerType HISTORICAL
      • INDEXER_EXECUTOR

        public static final ServerType INDEXER_EXECUTOR
      • REALTIME

        public static final ServerType REALTIME
    • Method Detail

      • values

        public static ServerType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ServerType c : ServerType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ServerType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • isSegmentReplicationTarget

        public abstract boolean isSegmentReplicationTarget()
        Indicates this type of node is able to be a target of segment replication.
        Returns:
        true if it is available for replication
        See Also:
        LoadRule
      • isSegmentBroadcastTarget

        public boolean isSegmentBroadcastTarget()
        Indicates this type of node is able to be a target of segment broadcast.
        Returns:
        true if it is available for broadcast.
      • isSegmentServer

        public abstract boolean isSegmentServer()
        Indicates this type of node is serving segments that are meant to be the target of fan-out by a Broker. Nodes that return "true" here are often referred to as "data servers" or "data server processes".