forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Remote State] Upload incremental cluster state on master re-election (…
…opensearch-project#15145) * Upload incremental cluster state on master re-election Signed-off-by: Shivansh Arora <[email protected]> (cherry picked from commit cbdcbb7)
- Loading branch information
Showing
12 changed files
with
677 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
server/src/main/java/org/opensearch/cluster/coordination/RemoteStatePublishRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(super.hashCode(), manifest); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "RemoteStatePublishRequest{" + super.toString() + "manifest=" + manifest + "} "; | ||
} | ||
} |
Oops, something went wrong.