Skip to content

Commit

Permalink
Fix a bug that passing bytes size instead of kb.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dooyong Kim committed Sep 16, 2024
1 parent 6cdde7f commit 4238b0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/opensearch/knn/index/KNNIndexShard.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public void warmup() throws IOException {
nativeMemoryCacheManager.get(
new NativeMemoryEntryContext.IndexEntryContext(
directory,
engineFileContext.getIndexPath(),
// engineFileContext.getIndexPath(), TMP
engineFileContext.getIndexPath().substring(engineFileContext.getIndexPath().lastIndexOf("/") + 1),
NativeMemoryLoadStrategy.IndexLoadStrategy.getInstance(),
getParametersAtLoading(
engineFileContext.getSpaceType(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public NativeMemoryAllocation.IndexAllocation load(NativeMemoryEntryContext.Inde
return new NativeMemoryAllocation.IndexAllocation(
executor,
indexAddress,
indexSize,
indexSize / 1024,
knnEngine,
indexPath,
indexEntryContext.getOpenSearchIndexName(),
Expand Down

0 comments on commit 4238b0b

Please sign in to comment.