Class PersistedClusterStateService

java.lang.Object
org.elasticsearch.gateway.PersistedClusterStateService

public class PersistedClusterStateService extends Object
Stores cluster metadata in a bare Lucene index (per data path) split across a number of documents. This is used by master-eligible nodes to record the last-accepted cluster state during publication. The metadata is written incrementally where possible, leaving alone any documents that have not changed. The index has the following fields: +------------------------------+-----------------------------+----------------------------------------------+ | "type" (string field) | "index_uuid" (string field) | "data" (stored binary field in SMILE format) | +------------------------------+-----------------------------+----------------------------------------------+ | GLOBAL_TYPE_NAME == "global" | (omitted) | Global metadata | | INDEX_TYPE_NAME == "index" | Index UUID | Index metadata | +------------------------------+-----------------------------+----------------------------------------------+ Additionally each commit has the following user data: +---------------------------+-------------------------+-------------------------------------------------------------------------------+ | Key symbol | Key literal | Value | +---------------------------+-------------------------+-------------------------------------------------------------------------------+ | CURRENT_TERM_KEY | "current_term" | Node's "current" term (≥ last-accepted term and the terms of all sent joins) | | LAST_ACCEPTED_VERSION_KEY | "last_accepted_version" | The cluster state version corresponding with the persisted metadata | | NODE_ID_KEY | "node_id" | The (persistent) ID of the node that wrote this metadata | | NODE_VERSION_KEY | "node_version" | The (ID of the) version of the node that wrote this metadata | +---------------------------+-------------------------+-------------------------------------------------------------------------------+ (the last-accepted term is recorded in Metadata → CoordinationMetadata so does not need repeating here)
  • Field Details

    • METADATA_DIRECTORY_NAME

      public static final String METADATA_DIRECTORY_NAME
      See Also:
      Constant Field Values
    • SLOW_WRITE_LOGGING_THRESHOLD

      public static final Setting<org.elasticsearch.core.TimeValue> SLOW_WRITE_LOGGING_THRESHOLD
  • Constructor Details

    • PersistedClusterStateService

      public PersistedClusterStateService(NodeEnvironment nodeEnvironment, org.elasticsearch.common.xcontent.NamedXContentRegistry namedXContentRegistry, BigArrays bigArrays, ClusterSettings clusterSettings, LongSupplier relativeTimeMillisSupplier)
    • PersistedClusterStateService

      public PersistedClusterStateService(Path[] dataPaths, String nodeId, org.elasticsearch.common.xcontent.NamedXContentRegistry namedXContentRegistry, BigArrays bigArrays, ClusterSettings clusterSettings, LongSupplier relativeTimeMillisSupplier)
  • Method Details