Skip to content

Commit

Permalink
change DEFAULT_REFRESH_POLICY to false
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Huo <[email protected]>
  • Loading branch information
penghuo committed May 2, 2024
1 parent 4ffb413 commit 7396f61
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class FlintOptions implements Serializable {
*
* WAIT_UNTIL("wait_for")
*/
public static final String DEFAULT_REFRESH_POLICY = "wait_for";
public static final String DEFAULT_REFRESH_POLICY = "false";

public static final String SOCKET_TIMEOUT_MILLIS = "socket_timeout_millis";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class AutoIndexRefresh(indexName: String, index: FlintSparkIndex)
.queryName(indexName)
.format(FLINT_DATASOURCE)
.options(flintSparkConf.properties)
.option(FlintSparkConf.REFRESH_POLICY.optionKey, "false")
.addSinkOptions(options, flintSparkConf)
.start(indexName)
Some(job.id.toString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.flint.spark.refresh

import org.opensearch.flint.core.FlintOptions
import org.opensearch.flint.spark.FlintSparkIndex
import org.opensearch.flint.spark.refresh.FlintSparkIndexRefresh.RefreshMode.{FULL, RefreshMode}

Expand Down Expand Up @@ -44,7 +43,6 @@ class FullIndexRefresh(
.write
.format(FLINT_DATASOURCE)
.options(flintSparkConf.properties)
.option(FlintSparkConf.REFRESH_POLICY.optionKey, "false")
.mode(Overwrite)
.save(indexName)
None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import play.api.libs.json._
import org.apache.spark.{SparkConf, SparkException}
import org.apache.spark.internal.Logging
import org.apache.spark.sql.catalyst.parser.ParseException
import org.apache.spark.sql.flint.config.FlintSparkConf.REFRESH_POLICY
import org.apache.spark.sql.types._
import org.apache.spark.sql.util._

Expand Down Expand Up @@ -97,6 +98,7 @@ trait FlintJobExecutor {
try {
resultData.write
.format("flint")
.option(REFRESH_POLICY.optionKey, "wait_for")
.mode("append")
.save(resultIndex)
IRestHighLevelClient.recordOperationSuccess(
Expand Down

0 comments on commit 7396f61

Please sign in to comment.