1. 04 9月, 2020 1 次提交
    • B
      Various fixes for Batch Source (#7965) · 1632dcaf
      Boyang Jerry Peng 提交于
      * Various fixes for Batch Source
      1. Create intermediate topic/subscription prior to function running in case auto topic creation is turned off
      2. Fix possible NPE in CronTrigger when calling stop()
      3. Stop all producers created in ContextImpl
      4. Delete intermediate topic for batch source
      Co-authored-by: NJerry Peng <jerryp@splunk.com>
      1632dcaf
  2. 30 8月, 2020 1 次提交
  3. 28 8月, 2020 1 次提交
  4. 21 8月, 2020 1 次提交
  5. 10 8月, 2020 1 次提交
    • S
      Allow the option to make producers thread local (#7764) · a3eb5565
      Sanjeev Kulkarni 提交于
      If a function has many threads who are doing context.newOutputMessage().send(), there could be a lot of contention due to big synchronization blocks in the ProducerImpl. By allowing functions to use thread local producers, this synchronization can be avoided leading to increased performance.
      This pr adds the configurability of using thread local producers in functions and sources
      Co-authored-by: NSanjeev Kulkarni <sanjeevk@splunk.com>
      a3eb5565
  6. 05 8月, 2020 1 次提交
  7. 04 8月, 2020 1 次提交
  8. 25 7月, 2020 3 次提交
  9. 17 7月, 2020 1 次提交
  10. 02 7月, 2020 1 次提交
    • F
      function to read compacted topics (#7193) · 7a80ca98
      feynmanlin 提交于
      
      Fixes #5538
      
      ### Motivation
      
      
      
      ### Modifications
      In function mode and sink mode, PulsarSource can read compacted topic。
      By `inputSpecs` parameter, each topic can independently decide whether to read compacted
      
      ### Verifying this change
      unit test:
      org.apache.pulsar.io.PulsarFunctionE2ETest#testReadCompactedFunction
      org.apache.pulsar.io.PulsarFunctionE2ETest#testReadCompactedSink
      7a80ca98
  11. 09 6月, 2020 1 次提交
    • F
      [issue #6765] Expose definition flags to function (#6868) · 2aff473e
      feynmanlin 提交于
      1)
      Change the value of the CLI tool parameter "--custom-schema-input" from
      "TopicName-> schemaType" 
       to
      "topicName-> {" schemaType ":" type"," jsr310ConversionEnabled ": true," alwaysAllowNull ": true}"
      
      2)
      Modify Function.proto, add properties "jsr310ConversionEnabled", "alwaysAllowNull"。So that we can receive the above 2 parameters
      
      3)
      Modify the "FunctionConfigUtils#convert" method , put the two parameters in "CustomSchemaInputs" into ConsumerSpec
      
      4)
      In “JavaInstanceRunnable#setupInput” method, put the above 2 parameters into "ConsumerConfig" and pass it to "PulsarSource", let it set the parameters into "schema" when creating the consumer of Source。
      So that,The “function” can get these 2 parameters from the message of 
      ”currentRecord“
      2aff473e
  12. 30 5月, 2020 2 次提交
  13. 23 5月, 2020 1 次提交
  14. 19 5月, 2020 1 次提交
  15. 12 5月, 2020 1 次提交
  16. 08 5月, 2020 1 次提交
    • J
      Support function with format: Function<I, CompletableFuture<O>> (#6684) · 7cd28b9d
      Jia Zhai 提交于
      Fixes #6519
      
      ### Motivation
      
      Currently, Pulsar Functions not support Async mode, e.g. user passed in a Function in format :
      ```
      Function<I, CompletableFuture<O>>
      ```
      This kind of function is useful if the function might use RPCs to call external systems.
      
      e.g.
      ```java
      public class AsyncFunction implements Function<String, CompletableFuture<O>> {
          CompletableFuture<O> apply (String input) {
              CompletableFuture future = new CompletableFuture();
              ...function compute...
              future.whenComplete(() -> {
                  ...  call external system  ...
              });
              return future;
          }
      ```
      
      ### Modifications
      - add support for Async Functions support.
      
      ### Verifying this change
      current ut passed.
      
      
      
      * support func: Function<I, CompletableFuture<O>>
      
      * add 2 examples
      
      * add limit to the max outstanding items
      7cd28b9d
  17. 30 4月, 2020 1 次提交
    • G
      [Pulsar IO][Issue 5633]Support avro schema for debezium connector (#6034) · e08be96d
      guangning 提交于
      Fixes #5633 
      
      
      ### Motivation
      
      Currently, some users want to support Avro schema in debezium, so this pr supports this feature.
      For Kafka's Avro schema, it depends on the Avro 1.8 version, but Avro version has just been upgraded to 1.9 in pulsar, so shade is needed to avoid finding `addProp` function
      
      ### Modifications
      
      * Add a package `kafka-connect-avro-converter-shaded`
      * Add class KafkaSchema to converter Kafka's Avro schema to pulsar's schema
      
      ### Verifying this change 
      
      Unit test and integration tests
      e08be96d
  18. 22 4月, 2020 1 次提交
  19. 05 4月, 2020 1 次提交
    • R
      Fixed avro schema decode error in functions (#6662) · 52ae1823
      ran 提交于
      Fixes #5503 
      From #6445 
      
      # Motivation
      In functions, it will encounter ```ClassCastException``` when using the Avro schema for topics.
      
      ```
      Exception in thread "main" java.lang.ClassCastException: org.apache.pulsar.shade.org.apache.avro.generic.GenericData$Record cannot be cast to io.streamnative.KeyValueSchemaTest$Foo2
      	at io.streamnative.KeyValueSchemaTest.testConsumerByPythonProduce(KeyValueSchemaTest.java:412)
      	at io.streamnative.KeyValueSchemaTest.main(KeyValueSchemaTest.java:305)
      ```
      
      # Modifications
      In functions, when using Avro schema specific the ClassLoader for ReflectDatumReader.
      
      Add integration test ```testAvroSchemaFunction``` in class ```PulsarFunctionsTest```.
      52ae1823
  20. 28 3月, 2020 1 次提交
    • Y
      [cleanup] Optional usage (#6613) · acc161b4
      Yijie Shen 提交于
      This PR aims to fix or simplify `Optional` type usage logic:
      - Null value used for optional type.
      - Optional.isPresent() can be replaced with functional style expression
      - Optional call chain that can be simplified.
      acc161b4
  21. 27 3月, 2020 2 次提交
  22. 26 3月, 2020 2 次提交
  23. 06 3月, 2020 1 次提交
    • C
      Independent schema is set for each consumer generated by topic (#6356) · 8003d08e
      congbo 提交于
      ### Motivation
      
      Master Issue: #5454 
      
      When one Consumer subscribe multi topic, setSchemaInfoPorvider() will be covered by the consumer generated by the last topic.
      
      ### Modification
      clone schema for each consumer generated by topic.
      ### Verifying this change
      Add the schemaTest for it.
      8003d08e
  24. 20 2月, 2020 1 次提交
  25. 16 2月, 2020 1 次提交
    • D
      [Issue 4175] [pulsar-function-go] Create integration tests for Go Functions... · bf7302a7
      Devin Bost 提交于
      [Issue 4175] [pulsar-function-go] Create integration tests for Go Functions for production-readiness (#6104)
      
      This PR is to provide integration tests that test execution of Go functions that are managed by the Java FunctionManager. This will allow us to test things like behavior during function timeouts, heartbeat failures, and other situations that can only be effectively tested in an integration test. 
      
      Master issue: #4175
      Fixes issue: #6204 
      
      ### Modifications
      
      We must add Go to the integration testing logic. We must also build the Go dependencies into the test Dockerfile to ensure the Go binaries are available at runtime for the integration tests. 
      bf7302a7
  26. 14 2月, 2020 1 次提交
    • N
      add passSourceMessageProperty switch to pulsar functions (#6318) · bce14edd
      Neng Lu 提交于
      Fixes #5116 
      
      ### Motivation
      Based on the request in #5116, adding this flag can help reduce ambiguity and increase flexibility. By default, the function passes source message properties.
      
      ### Modifications
      - add flags in pulsar admin client tools
      - update functions proto and functionConfig to contain the flag
      - update the pulsar sink to pass source message property if the flag is set
      bce14edd
  27. 25 1月, 2020 1 次提交
  28. 21 1月, 2020 1 次提交
    • S
      Remove duplicated lombok annotations in the pulsar-functions modules (#6063) · f8a73866
      Sergii Zhevzhyk 提交于
      ### Motivation
      
      Some of the classes in the pulsar-functions module had a mixture of the following lombok annotations:
      
      ```
      @data
      @Setter	
      @Getter	
      @EqualsAndHashCode	
      @ToString
      ```
      
      The [@data](https://projectlombok.org/features/Data) annotation includes all other annotations:
      
      > All together now: A shortcut for @ToString, @EqualsAndHashCode, @Getter on all fields, @Setter on all non-final fields, and @RequiredArgsConstructor!
      
      
      ### Modifications
      
      Removed `@Setter`, `@Getter`, `@EqualsAndHashCode`, and '@ToString' if the `@data` annotation was also present
      f8a73866
  29. 20 12月, 2019 1 次提交
  30. 08 12月, 2019 1 次提交
    • R
      PIP-52: [pulsar-sever] Add support of dispatch throttling relative to publish-rate (#5797) · 02bf9a0b
      Rajan Dhabalia 提交于
      ### Motivation
      With [PIP-3](https://github.com/apache/pulsar/wiki/PIP-3:-Message-dispatch-throttling) , Pulsar broker already supports to configure dispatch rate-limiting for a given topic. Dispatch-throttling feature allows user to configure absolute dispatch rate based on current publish-rate for a given topic or subscriber, and broker will make sure to dispatch only configured number of messages to the consumers regardless current publish-rate or backlog on that topic.
      
      Current dispatch-rate limiting doesn't consider change in publish-rate so, increasing publish-rate on the topic might be larger than configured dispatch-rate which will cause backlog on the topic and consumers will never be able to catch up the backlog unless user again reconfigured the dispatch-rate based on current publish-rate. Reconfiguring dispatch-rate based on publish-rate requires human interaction and monitoring. Therefore, we need a mechanism to configure dispatch rate relative to the current publish-rate on the topic.
      
      ### Modification
      `set-dispatch-rate` cli have a flag `--relative-to-publish-rate` to enable relative dispatch throttling.
      
      ```
      pulsar-admin namespaces <property/cluster/namespace> set-dispatch-rate --msg-dispatch-rate 1000 --relative-to-publish-rate
      ```
      
      ### Note:
      I will add broker-level configuration and documentation into separate PR.
      02bf9a0b
  31. 06 11月, 2019 1 次提交
  32. 04 11月, 2019 2 次提交
  33. 28 10月, 2019 2 次提交
    • [functions][Issue:5350]Fix pulsar can't load the customized SerDe (#5357) · 18712eb9
      冉小龙 提交于
      Fixes #5350
      
      ### Motivation
      
      When using the `--output-serde-classname` option, `functionClassLoader` is not set correctly.
      18712eb9
    • J
      added deletion of state for Functions (#5469) · 309c78e7
      johnwagster 提交于
      ### Motivation
      
      Adding support for state deletion for Functions.  Ran into a use-case where it would be nice to be able to let go of state wherein the key is changing but the data itself is ephemeral. 
      
      ### Modifications
      
      I've reflected the changes in the bookkeepr API back through in the context and state context API's so that you can delete on a put by passing null or call the new api for delete.
      
      ### Verifying this change
      
      This change added tests and can be verified as follows:
       - Running the unit tests available in the ContextImplTest and ContextStateImplTest
      309c78e7