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

org.opensearch.common.remote.AbstractClusterMetadataWriteableBlobEntity Maven / Gradle / Ivy

There is a newer version: 2.18.0
Show newest version
/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 */

package org.opensearch.common.remote;

import org.opensearch.core.compress.Compressor;
import org.opensearch.core.xcontent.NamedXContentRegistry;
import org.opensearch.gateway.remote.ClusterMetadataManifest.UploadedMetadata;

/**
 * An extension of {@link RemoteWriteableEntity} class which caters to the use case of writing to and reading from a blob storage
 *
 * @param  The class type which can be uploaded to or downloaded from a blob storage.
 */
public abstract class AbstractClusterMetadataWriteableBlobEntity extends RemoteWriteableBlobEntity {

    protected final NamedXContentRegistry namedXContentRegistry;

    public AbstractClusterMetadataWriteableBlobEntity(
        final String clusterUUID,
        final Compressor compressor,
        final NamedXContentRegistry namedXContentRegistry
    ) {
        super(clusterUUID, compressor);
        this.namedXContentRegistry = namedXContentRegistry;
    }

    public AbstractClusterMetadataWriteableBlobEntity(final String clusterUUID, final Compressor compressor) {
        super(clusterUUID, compressor);
        this.namedXContentRegistry = null;
    }

    public abstract UploadedMetadata getUploadedMetadata();

    public NamedXContentRegistry getNamedXContentRegistry() {
        return namedXContentRegistry;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy