-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support refresh interval and checkpoint location option (#39)
* Add Flint index options and pass it from parser to index Signed-off-by: Chen Dai <[email protected]> * Update more javadoc Signed-off-by: Chen Dai <[email protected]> * Pass index option to Flint metadata and streaming job Signed-off-by: Chen Dai <[email protected]> * Fix IT and add new IT Signed-off-by: Chen Dai <[email protected]> * Add more IT Signed-off-by: Chen Dai <[email protected]> * Update job id var name Signed-off-by: Chen Dai <[email protected]> * Update doc with index options Signed-off-by: Chen Dai <[email protected]> * Update doc with default behavior Signed-off-by: Chen Dai <[email protected]> --------- Signed-off-by: Chen Dai <[email protected]>
- Loading branch information
Showing
15 changed files
with
294 additions
and
66 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
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
47 changes: 47 additions & 0 deletions
47
...-spark-integration/src/main/scala/org/opensearch/flint/spark/FlintSparkIndexOptions.scala
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,47 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.flint.spark | ||
|
||
/** | ||
* Flint Spark index configurable options. | ||
* | ||
* @param options | ||
* index option mappings | ||
*/ | ||
case class FlintSparkIndexOptions(options: Map[String, String]) { | ||
|
||
/** | ||
* Is Flint index auto refreshed or manual refreshed. | ||
* | ||
* @return | ||
* auto refresh option value | ||
*/ | ||
def autoRefresh(): Boolean = options.getOrElse("auto_refresh", "false").toBoolean | ||
|
||
/** | ||
* The refresh interval (only valid if auto refresh enabled). | ||
* | ||
* @return | ||
* refresh interval expression | ||
*/ | ||
def refreshInterval(): Option[String] = options.get("refresh_interval") | ||
|
||
/** | ||
* The checkpoint location which maybe required by Flint index's refresh. | ||
* | ||
* @return | ||
* checkpoint location path | ||
*/ | ||
def checkpointLocation(): Option[String] = options.get("checkpoint_location") | ||
} | ||
|
||
object FlintSparkIndexOptions { | ||
|
||
/** | ||
* Empty options | ||
*/ | ||
val empty: FlintSparkIndexOptions = FlintSparkIndexOptions(Map.empty) | ||
} |
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.