Class WindowContextImpl

java.lang.Object
org.apache.pulsar.functions.windowing.WindowContextImpl
All Implemented Interfaces:
org.apache.pulsar.functions.api.WindowContext

public class WindowContextImpl extends Object implements org.apache.pulsar.functions.api.WindowContext
  • Constructor Details

    • WindowContextImpl

      public WindowContextImpl(org.apache.pulsar.functions.api.Context context)
  • Method Details

    • getTenant

      public String getTenant()
      Specified by:
      getTenant in interface org.apache.pulsar.functions.api.WindowContext
    • getNamespace

      public String getNamespace()
      Specified by:
      getNamespace in interface org.apache.pulsar.functions.api.WindowContext
    • getFunctionName

      public String getFunctionName()
      Specified by:
      getFunctionName in interface org.apache.pulsar.functions.api.WindowContext
    • getFunctionId

      public String getFunctionId()
      Specified by:
      getFunctionId in interface org.apache.pulsar.functions.api.WindowContext
    • getInstanceId

      public int getInstanceId()
      Specified by:
      getInstanceId in interface org.apache.pulsar.functions.api.WindowContext
    • getNumInstances

      public int getNumInstances()
      Specified by:
      getNumInstances in interface org.apache.pulsar.functions.api.WindowContext
    • getFunctionVersion

      public String getFunctionVersion()
      Specified by:
      getFunctionVersion in interface org.apache.pulsar.functions.api.WindowContext
    • getInputTopics

      public Collection<String> getInputTopics()
      Specified by:
      getInputTopics in interface org.apache.pulsar.functions.api.WindowContext
    • getOutputTopic

      public String getOutputTopic()
      Specified by:
      getOutputTopic in interface org.apache.pulsar.functions.api.WindowContext
    • getOutputSchemaType

      public String getOutputSchemaType()
      Specified by:
      getOutputSchemaType in interface org.apache.pulsar.functions.api.WindowContext
    • getLogger

      public org.slf4j.Logger getLogger()
      Specified by:
      getLogger in interface org.apache.pulsar.functions.api.WindowContext
    • incrCounter

      public void incrCounter(String key, long amount)
      Specified by:
      incrCounter in interface org.apache.pulsar.functions.api.WindowContext
    • getCounter

      public long getCounter(String key)
      Specified by:
      getCounter in interface org.apache.pulsar.functions.api.WindowContext
    • putState

      public void putState(String key, ByteBuffer value)
      Specified by:
      putState in interface org.apache.pulsar.functions.api.WindowContext
    • getState

      public ByteBuffer getState(String key)
      Specified by:
      getState in interface org.apache.pulsar.functions.api.WindowContext
    • getUserConfigMap

      public Map<String,Object> getUserConfigMap()
      Specified by:
      getUserConfigMap in interface org.apache.pulsar.functions.api.WindowContext
    • getUserConfigValue

      public Optional<Object> getUserConfigValue(String key)
      Specified by:
      getUserConfigValue in interface org.apache.pulsar.functions.api.WindowContext
    • getUserConfigValueOrDefault

      public Object getUserConfigValueOrDefault(String key, Object defaultValue)
      Specified by:
      getUserConfigValueOrDefault in interface org.apache.pulsar.functions.api.WindowContext
    • recordMetric

      public void recordMetric(String metricName, double value)
      Specified by:
      recordMetric in interface org.apache.pulsar.functions.api.WindowContext
    • publish

      public <T> CompletableFuture<Void> publish(String topicName, T object)
      Specified by:
      publish in interface org.apache.pulsar.functions.api.WindowContext
    • publish

      public CompletableFuture<Void> publish(String topicName, Object object, String schemaOrSerdeClassName)
      Specified by:
      publish in interface org.apache.pulsar.functions.api.WindowContext