Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-11213

Is there any condition that large amount of redis connection created on each TM?

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Invalid
    • None
    • None
    • None
    • None

    Description

      In the job, large amount of redis connections are created on each TM, is there some ideas? code like:

      def main(args:Array[String]): Unit =

      { val env = StreamExecutionEnvironment.getExecutionEnvironment env.addSource(new Source).setParallelism(4).addSink(new Sinker).setParallelism(4) env.execute() }

      class Sinker extends RichSinkFunction[String]{

      lazy val applicationContext = new ClassPathXmlApplicationContext("application-redis-context.xml")
      lazy val redisTemplate =applicationContext.getBean("redisTemplate", classOf[RedisTemplate[String, String]])

      override def invoke(value: String, context: SinkFunction.Context[_]): Unit =

      { val value = redisTemplate.opsForValue().get("key01") println(value) }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            lzh9 lzh9
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: