Skip to content

Commit

Permalink
Adding logs for getting the times and moved to 2.17.0
Browse files Browse the repository at this point in the history
Signed-off-by: Navneet Verma <[email protected]>
  • Loading branch information
navneet1v committed Sep 28, 2024
1 parent 62eb0b2 commit c874f7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
ext {
// build.version_qualifier parameter applies to knn plugin artifacts only. OpenSearch version must be set
// explicitly as 'opensearch.version' property, for instance opensearch.version=2.0.0-rc1-SNAPSHOT
opensearch_version = System.getProperty("opensearch.version", "2.18.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "2.17.0")
version_qualifier = System.getProperty("build.version_qualifier", "")
opensearch_group = "org.opensearch"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,20 @@ public void flush(int maxDoc, final Sorter.DocMap sortMap) throws IOException {
@Override
public void mergeOneField(final FieldInfo fieldInfo, final MergeState mergeState) throws IOException {
// This will ensure that we are merging the FlatIndex during force merge.
StopWatch stopwatch = new StopWatch().start();
flatVectorsWriter.mergeOneField(fieldInfo, mergeState);

log.info("[Merge]: Reading and writing merged FlatVector Took : {} ms", stopwatch.stop().totalTime().millis());
final VectorDataType vectorDataType = extractVectorDataType(fieldInfo);
final Supplier<KNNVectorValues<?>> knnVectorValuesSupplier = () -> getVectorValues(vectorDataType, fieldInfo, mergeState);
stopwatch = new StopWatch().start();
final QuantizationState quantizationState = train(fieldInfo, knnVectorValuesSupplier);
final KNNVectorValues<?> knnVectorValues = knnVectorValuesSupplier.get();
final int totalLiveDocs = Math.toIntExact(knnVectorValues.totalLiveDocs());
log.info(
"[Merge] Reading live docs {} took with merging vector values : {} ms",
totalLiveDocs,
stopwatch.stop().totalTime().millis()
);
if (totalLiveDocs <= 0) {
log.debug("[Merge] No live docs for field {}", fieldInfo.getName());
return;
Expand All @@ -124,7 +131,7 @@ public void mergeOneField(final FieldInfo fieldInfo, final MergeState mergeState

long time_in_millis = stopWatch.stop().totalTime().millis();
KNNGraphValue.MERGE_TOTAL_TIME_IN_MILLIS.incrementBy(time_in_millis);
log.debug("Merge took {} ms for vector field [{}]", time_in_millis, fieldInfo.getName());
log.info("[Merge] Graph Build took {} ms for vector field [{}] for docs: {}", time_in_millis, fieldInfo.getName(), totalLiveDocs);
}

/**
Expand Down

0 comments on commit c874f7b

Please sign in to comment.