-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
…#15145) * Upload incremental cluster state on master re-election Signed-off-by: Shivansh Arora <[email protected]> (cherry picked from commit cbdcbb7)
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* 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.cluster.coordination; | ||
|
||
import org.opensearch.cluster.ClusterState; | ||
import org.opensearch.gateway.remote.ClusterMetadataManifest; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* PublishRequest created by downloading the accepted {@link ClusterState} from Remote Store, using the published {@link ClusterMetadataManifest} | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public class RemoteStatePublishRequest extends PublishRequest { | ||
private final ClusterMetadataManifest manifest; | ||
|
||
public RemoteStatePublishRequest(ClusterState acceptedState, ClusterMetadataManifest acceptedManifest) { | ||
super(acceptedState); | ||
this.manifest = acceptedManifest; | ||
} | ||
|
||
public ClusterMetadataManifest getAcceptedManifest() { | ||
return manifest; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
if (!super.equals(o)) return false; | ||
RemoteStatePublishRequest that = (RemoteStatePublishRequest) o; | ||
return Objects.equals(manifest, that.manifest); | ||
Check warning on line 39 in server/src/main/java/org/opensearch/cluster/coordination/RemoteStatePublishRequest.java Codecov / codecov/patchserver/src/main/java/org/opensearch/cluster/coordination/RemoteStatePublishRequest.java#L38-L39
|
||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(super.hashCode(), manifest); | ||
Check warning on line 44 in server/src/main/java/org/opensearch/cluster/coordination/RemoteStatePublishRequest.java Codecov / codecov/patchserver/src/main/java/org/opensearch/cluster/coordination/RemoteStatePublishRequest.java#L44
|
||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "RemoteStatePublishRequest{" + super.toString() + "manifest=" + manifest + "} "; | ||
Check warning on line 49 in server/src/main/java/org/opensearch/cluster/coordination/RemoteStatePublishRequest.java Codecov / codecov/patchserver/src/main/java/org/opensearch/cluster/coordination/RemoteStatePublishRequest.java#L49
|
||
} | ||
} |