Skip to content

Commit

Permalink
syntax and comment
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Kao <[email protected]>
  • Loading branch information
seankao-az committed Dec 12, 2024
1 parent 2825d87 commit 4efb097
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ class FlintOpenSearchMetadataCacheWriter(options: FlintOptions)
response.getMappings.get(osIndexName).sourceAsMap()
}

/**
* Merge existing mapping with metadata cache properties. Metadata cache is written into
* _meta.properties field of index mapping.
*/
private def mergeMapping(
existingMapping: JMap[String, AnyRef],
metadataCacheProperties: JMap[String, AnyRef]): JMap[String, AnyRef] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class FlintOpenSearchMetadataCacheWriterITSuite extends FlintSparkSuite with Mat
flintClient.createIndex(testFlintIndex, metadata)

// Simulates index mapping updated by custom implementation of FlintIndexMetadataService
// because our standard FlintOpenSearchIndexMetadataService ignores the "custom" field.
// with the extra "custom" field.
val client = OpenSearchClientUtils.createClient(options)
flintMetadataCacheWriter.updateIndexMapping(client, testFlintIndex, content)

Expand Down Expand Up @@ -396,12 +396,12 @@ class FlintOpenSearchMetadataCacheWriterITSuite extends FlintSparkSuite with Mat

val propertiesJson = compact(render(getPropertiesJValue(testFlintIndex)))
propertiesJson should matchJson(s"""
| {
| "metadataCacheVersion": "${FlintMetadataCache.metadataCacheVersion}",
| "refreshInterval": 600,
| "sourceTables": ["$testTable"]
| }
|""".stripMargin)
| {
| "metadataCacheVersion": "${FlintMetadataCache.metadataCacheVersion}",
| "refreshInterval": 600,
| "sourceTables": ["$testTable"]
| }
|""".stripMargin)

flint.refreshIndex(testFlintIndex)
compact(render(getPropertiesJValue(testFlintIndex))) should not include "lastRefreshTime"
Expand Down

0 comments on commit 4efb097

Please sign in to comment.