thake commented on pull request #9338:
URL: https://github.com/apache/kafka/pull/9338#issuecomment-706352561


   @vvcephei no problem.
   
   I just tried to rebase this on the current master and noticed the 
introduction of the distinguishment between ProcessorContext and 
StateStoreContext. As both interfaces do not share a common super-interface, I 
am forced to duplicate a lot of my code. Would it be possible to create a 
Super-Interface like "TaskContext":
   ```java
   public interface TaskContext {
       /**
        * Returns the application id.
        *
        * @return the application id
        */
       String applicationId();
   
       /**
        * Returns the task id.
        *
        * @return the task id
        */
       TaskId taskId();
   
       /**
        * Returns the default key serde.
        *
        * @return the key serializer
        */
       Serde<?> keySerde();
   
       /**
        * Returns the default value serde.
        *
        * @return the value serializer
        */
       Serde<?> valueSerde();
   
       /**
        * Returns the state directory for the partition.
        *
        * @return the state directory
        */
       File stateDir();
   
       /**
        * Returns Metrics instance.
        *
        * @return StreamsMetrics
        */
       StreamsMetrics metrics();
   
       /**
        * Returns all the application config properties as key/value pairs.
        *
        * <p> The config properties are defined in the {@link 
org.apache.kafka.streams.StreamsConfig}
        * object and associated to the ProcessorContext.
        *
        * <p> The type of the values is dependent on the {@link 
org.apache.kafka.common.config.ConfigDef.Type type} of the property
        * (e.g. the value of {@link 
org.apache.kafka.streams.StreamsConfig#DEFAULT_KEY_SERDE_CLASS_CONFIG 
DEFAULT_KEY_SERDE_CLASS_CONFIG}
        * will be of type {@link Class}, even if it was specified as a String to
        * {@link org.apache.kafka.streams.StreamsConfig#StreamsConfig(Map) 
StreamsConfig(Map)}).
        *
        * @return all the key/values from the StreamsConfig properties
        */
       Map<String, Object> appConfigs();
   
       /**
        * Returns all the application config properties with the given key 
prefix, as key/value pairs
        * stripping the prefix.
        *
        * <p> The config properties are defined in the {@link 
org.apache.kafka.streams.StreamsConfig}
        * object and associated to the ProcessorContext.
        *
        * @param prefix the properties prefix
        * @return the key/values matching the given prefix from the 
StreamsConfig properties.
        */
       Map<String, Object> appConfigsWithPrefix(String prefix);
   }
   
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to