All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.elasticsearch.cluster.MergableCustomMetadata Maven / Gradle / Ivy

There is a newer version: 8.14.0
Show newest version
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */

package org.elasticsearch.cluster;

import org.elasticsearch.cluster.metadata.Metadata;

/**
 * Interface to allow merging {@link org.elasticsearch.cluster.metadata.Metadata.Custom}.
 * When multiple Mergable Custom metadata of the same type are found (from underlying clusters), the
 * Custom metadata can be merged using {@link #merge(Metadata.Custom)}.
 *
 * @param  type of custom meta data
 */
public interface MergableCustomMetadata {

    /**
     * Merges this custom metadata with other, returning either this or other custom metadata.
     * This method should not mutate either this or the other custom metadata.
     *
     * @param other custom meta data
     * @return the same instance or other custom metadata based on implementation
     *         if both the instances are considered equal, implementations should return this
     *         instance to avoid redundant cluster state changes.
     */
    T merge(T other);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy