-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented computation of segment replication stats at shard level (#…
…17055) * Implemented computation of segment replication stats at shard level The method implemented here computes the segment replication stats at the shard level, instead of relying on the primary shard to compute stats based on reports from its replicas. Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Updated style checks in the test Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Updated changelog Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * fixed style issues Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Fix the failing integration test Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Fix stylecheck Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Fixed the comments for the initial revision Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Updated to use System.nanoTime() for lag calculation Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Fixed the integration test for node stats Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Modified the version in the ReplicationCheckpoint for backward compatibility Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Added precomputation logic for the stats calculation Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Removed unwanted lines Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Clean up the maps when index closed Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Added a null check for the indexshard checkpoint Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * fix style checks Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Updated version and added bwc for RemoteSegmentMetadata Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Upated the javadoc comments Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Address comments PR Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Removed the latestReceivedCheckpoint map from SegmentReplicationTargetService Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Added granular locks for the concurrency of stats methods Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Style check fixes Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Changes to maintain atomicity Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * spotlessApply Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * removed querying the remotestore when replication is in progress Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * spotlessApply Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> --------- Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
- Loading branch information
Showing
34 changed files
with
706 additions
and
101 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
25 changes: 25 additions & 0 deletions
25
server/src/main/java/org/opensearch/common/io/IndexIOStreamHandlerFactory.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,25 @@ | ||
/* | ||
* 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.io; | ||
|
||
/** | ||
* Interface for factory to provide handler implementation for type {@link T} | ||
* @param <T> The type of content to be read/written to stream | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public interface IndexIOStreamHandlerFactory<T> { | ||
|
||
/** | ||
* Implements logic to provide handler based on the stream versions | ||
* @param version stream version | ||
* @return Handler for reading/writing content streams to/from - {@link T} | ||
*/ | ||
IndexIOStreamHandler<T> getHandler(int version); | ||
} |
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
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
Oops, something went wrong.