Class WindowContextImpl

  • All Implemented Interfaces:
    org.apache.pulsar.functions.api.WindowContext

    public class WindowContextImpl
    extends java.lang.Object
    implements org.apache.pulsar.functions.api.WindowContext
    • Constructor Detail

      • WindowContextImpl

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

      • getTenant

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

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

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

        public java.lang.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 java.lang.String getFunctionVersion()
        Specified by:
        getFunctionVersion in interface org.apache.pulsar.functions.api.WindowContext
      • getInputTopics

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

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

        public java.lang.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​(java.lang.String key,
                                long amount)
        Specified by:
        incrCounter in interface org.apache.pulsar.functions.api.WindowContext
      • getCounter

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

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

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

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

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

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

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

        public <O> java.util.concurrent.CompletableFuture<java.lang.Void> publish​(java.lang.String topicName,
                                                                                  O object)
        Specified by:
        publish in interface org.apache.pulsar.functions.api.WindowContext
      • publish

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