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

Allow subclasses to override/extend FlinkKafkaConsumerBase checkpoint methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Reopened
    • Not a Priority
    • Resolution: Unresolved
    • 1.11.0, 1.11.1
    • None
    • Connectors / Kafka
    • None

    Description

      I'm working on a class that extends the FlinkKafkaConsumer to add some additional functionality the first time the consumer runs. I'd like to be able to store some additional state, but am unable to do so as the initializeState() and snapshotState() are marked as final. Ideally I'd like to be able to do something like

      @Override	
      public void initializeState(FunctionInitializationContext context) throws Exception {
          super.initializeState(context);
          // some additional initialization here
      }
      
      @Override	
      public void snapshotState(FunctionSnapshotContext context) throws Exception {
          super.snapshotState(context);
          // set some additional state here
      }

      I'm guessing it was marked final for a reason, is there a reason this would be problematic? The restoredState and unionOffsetStates properties are still private which would prevent subclasses from modifying the offset state.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            adriank Adrian Kreuziger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: