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.
Implemented computation of segment replication stats at shard level (o…
…pensearch-project#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 <[email protected]> * Updated style checks in the test Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Updated changelog Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * fixed style issues Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Fix the failing integration test Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Fix stylecheck Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Fixed the comments for the initial revision Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Updated to use System.nanoTime() for lag calculation Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Fixed the integration test for node stats Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Modified the version in the ReplicationCheckpoint for backward compatibility Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Added precomputation logic for the stats calculation Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Removed unwanted lines Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Clean up the maps when index closed Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Added a null check for the indexshard checkpoint Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * fix style checks Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Updated version and added bwc for RemoteSegmentMetadata Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Upated the javadoc comments Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Address comments PR Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Removed the latestReceivedCheckpoint map from SegmentReplicationTargetService Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Added granular locks for the concurrency of stats methods Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Style check fixes Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Changes to maintain atomicity Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * spotlessApply Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * removed querying the remotestore when replication is in progress Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * spotlessApply Signed-off-by: Vinay Krishna Pudyodu <[email protected]> --------- Signed-off-by: Vinay Krishna Pudyodu <[email protected]>
- 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.