Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Huo <[email protected]>
  • Loading branch information
penghuo committed Aug 6, 2024
1 parent d270b41 commit 0469317
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class OpenSearchIndexTable(metaData: MetaData, option: FlintOptions) extends Tab
if (docCount == 0) {
maxResultWindow
} else {
val totalSizeBytes = indexStats.total().store().sizeInBytes
val totalSizeBytes = indexStats.primaries().store().sizeInBytes
val docSize = Math.ceil(totalSizeBytes / docCount).toLong
Math.max(Math.min(maxSplitSizeBytes / docSize, maxResultWindow), 1).toInt
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class OpenSearchIndexTableSpec
when(options.supportShard()).thenReturn(supportShard)

when(openSearchClient.stats(any[IndicesStatsRequest])).thenReturn(mockIndicesStatsResp)
when(mockIndicesStatsResp.indices().get(any[String]).total().docs().count())
when(mockIndicesStatsResp.indices().get(any[String]).primaries().docs().count())
.thenReturn(docCount)
when(mockIndicesStatsResp.indices().get(any[String]).total().store().sizeInBytes)
when(mockIndicesStatsResp.indices().get(any[String]).primaries().store().sizeInBytes)
.thenReturn(storeSizeInBytes)

new OpenSearchIndexTable(metaData, options) {
Expand Down

0 comments on commit 0469317

Please sign in to comment.