Skip to content

Commit

Permalink
update dns cache ttl (#121)
Browse files Browse the repository at this point in the history
Signed-off-by: Khor Shu Heng <khor.heng@gojek.com>

Co-authored-by: Khor Shu Heng <khor.heng@gojek.com>
  • Loading branch information
khorshuheng and khorshuheng committed Mar 3, 2022
1 parent 1016b97 commit 623367c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ object BatchPipeline extends BasePipeline {
sparkSession: SparkSession,
config: IngestionJobConfig
): Option[StreamingQuery] = {
java.security.Security.setProperty("networkaddress.cache.ttl", "0");
java.security.Security.setProperty("networkaddress.cache.negative.ttl", "0");
val featureTable = config.featureTable
val projection =
BasePipeline.inputProjection(config.source, featureTable.features, featureTable.entities)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ class RedisSinkRelation(override val sqlContext: SQLContext, config: SparkRedisC
val isClusterMode = checkIfInClusterMode(endpoint)

dataToStore.foreachPartition { partition: Iterator[Row] =>
java.security.Security.setProperty("networkaddress.cache.ttl", "3");
java.security.Security.setProperty("networkaddress.cache.negative.ttl", "0");

val pipelineProvider = if (isClusterMode) {
ClusterPipelineProvider(endpoint)
} else {
Expand Down

0 comments on commit 623367c

Please sign in to comment.