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. 24 6月, 2020 1 次提交
    • B
      Various fixes and optimizations for processing assignments in function worker (#7338) · df0d189d
      Boyang Jerry Peng 提交于
      1. FunctionRuntimeManager initialize() should return messageId of last read message which is the position assignment tailer should start reading from
      2. Inefficient use of data structures in processAssignment()
      3. Wait for leader to finish init routine before allowing scheduler to compute new assignments
      4. Start leader service early so that the worker joins the worker membership sooner and its assignments don't get re-scheduled because initialize() routines for function runtime manager and metadata manager may take a while
      Co-authored-by: NJerry Peng <jerryp@splunk.com>
      df0d189d
  3. 05 6月, 2020 1 次提交
    • O
      [#6003][pulsar-functions] Possibility to add builtin Functions (#6895) · 9b0098a1
      oncode 提交于
      Master Issue: #6003
      
      ### Motivation
      
      This pull request implements the possibility to add builtin functions (in the same way of the build in connectors). 
      
      The builtin function must include a `pulsar-io.yml` file with the following content
      
      ```yml
      name: <function-name>
      description: <function-desciption>
      functionClass: <function-class>
      ```
      
      e.g.
      ```yml
      name: test-function
      description: test function description
      functionClass: it.oncode.pulsar.functions.TestFunction
      ```
      
      it is possible to create a builtin function in the same way of the builtin sinks/sources.
      
      Example in scala
      ```scala
      val functionConfigBuilder: FunctionConfigBuilder = FunctionConfig.builder()
          val function =
            functionConfigBuilder
              .tenant("public")
              .namespace("default")
              .jar("builtin://test-function")
              .name("test-function-name")
              .className("it.oncode.pulsar.functions.TestFunction")
              .inputs(Seq("channel_in").asJava)
              .output("channel_out")
              .runtime(FunctionConfig.Runtime.JAVA)
              .build()
      
      Pulsar.admin.functions
            .createFunction(function, null)
      
      ```
      
      Function folder to be specified in the `conf/functions_worker.yml` conf file
      
      e.g.
      `functionsDirectory: ./functions`
      
      Function package must be in `*.nar` format like for source/sink connectors
      
      ### Modifications
      
      I modified the `pulsar-function-utils`, `pulsar-functions-worker` and `pulsar-common` modules on the basis of the built in connectors implementation.
      Also `Function.proto` has been modified in order to include the `builtin` property
      
      #### What this MR does not include
      
      - modification of pulsar-admin to fetch the available buildin functions
      - the related documentation
      
      This is a feature that is critical for us, I think we could open an issue for the remaining points and consider to merge this PR.
      9b0098a1
  4. 03 6月, 2020 1 次提交
  5. 12 5月, 2020 1 次提交
  6. 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
  7. 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
  8. 14 11月, 2019 1 次提交
    • A
      [functions] Allow functions to pass runtime specific options (#5400) · 320cebe0
      Addison Higham 提交于
      ### Motivation
      
      This commit adds a new argument for functions, customRuntimeOptions, which is passed to
      funcions (as well as sources/sinks) that enables the ability to
      customize the runtime.
      
      This is added primarily to support the `KubernetesManifestCustomizer`
      interface. This interface is intended, as the name indicates, allows for
      customizing how the kubernetes manifests are generated before they
      are sent off to the k8s cluster. 
      
      This interface has a default implementation, which allows for
      changing the namespace, labels, nodeSelector labels, and toleratations per function.
      
      This interface is also pluggable, allowing for more customized
      implementations. For example, the functions for a given tenant could be
      mapped to different pools of compute for isolation.
      
      ### Modifications
      
      For the CLI and protobufs, the modifications just involve plumbing through the new option, `customRuntimeOptions` through the relevant code. 
      
      For kubernetes runtime, the modifications are fairly straight forward, adding a new configuration option, `kubernetesManifestCustomizerClassName` and `kubernetesManifestCustomizerConfig` which are options under the kubernetes runtime.
      320cebe0
  9. 04 11月, 2019 1 次提交
  10. 23 10月, 2019 1 次提交
  11. 18 8月, 2019 1 次提交
  12. 21 7月, 2019 1 次提交
    • R
      set go function executable when download to local (#4743) · bf58c8eb
      Rui Fu 提交于
      ### Motivation
      
      Currently golang function needs to be compiled before deploy to pulsar, so the executable permission is required when function package is downloaded to local node from bookkeeper. This PR is intent to make golang function package executable after download from bookkeeper, to make sure the function is ok to run.
      bf58c8eb
  13. 04 6月, 2019 1 次提交
  14. 17 5月, 2019 1 次提交
  15. 07 5月, 2019 1 次提交
  16. 06 5月, 2019 1 次提交
  17. 18 4月, 2019 1 次提交
  18. 08 4月, 2019 1 次提交
  19. 05 4月, 2019 1 次提交
  20. 02 4月, 2019 1 次提交
  21. 20 3月, 2019 1 次提交
    • B
      Implementing authentication for Pulsar Functions (#3735) · b50760ca
      Boyang Jerry Peng 提交于
      * Implementing authentication for Pulsar Functions
      
      * delete unnecessary changes
      
      * cleaning up
      
      * improving implementation
      
      * fixing tests
      
      * cleaning up
      
      * add no op implementation
      
      * cleaning up unnecessary changes
      
      * refactoring based on comments
      
      * adding comments
      
      * change data from string type to bytes
      
      * add proto file
      
      * addressing comments
      
      * up merging
      
      * refactoring get token code
      
      * cleaning up
      
      * fix bugs and add tests
      
      * add tests
      
      * remove service account creation
      
      * cleanup unused imports
      
      * add field for auth provider
      
      * adding comments
      b50760ca
  22. 07 3月, 2019 1 次提交
  23. 27 2月, 2019 1 次提交
  24. 16 2月, 2019 1 次提交
  25. 08 2月, 2019 1 次提交
  26. 15 1月, 2019 1 次提交
  27. 09 11月, 2018 1 次提交
    • B
      Expose metrics via http port in function instance (#2930) · 900e7479
      Boyang Jerry Peng 提交于
      * fix bugs in python metrics
      
      * instance expose metrics
      
      * remove commented out code
      
      * fix unit tests
      
      * remove commented out code
      
      * fixing test
      
      * fix python instance test
      
      * removing old code
      
      * fix bug
      
      * refactoring java metrics
      
      * refactoring python metrics
      
      * cleaning up code
      
      * removing unneccessary code
      
      * improving metrics format
      
      * fixing test
      
      * fix bugs and revising format
      
      * fix bug
      
      * fix for python3
      
      * change user defined metric to summary
      
      * renaming labels
      
      * change back python
      900e7479
  28. 03 11月, 2018 1 次提交
  29. 25 10月, 2018 1 次提交
  30. 02 10月, 2018 1 次提交
    • S
      Enable Pulsar Functions to be deployed on a kubernetes cluster (#1950) · d0858065
      Sanjeev Kulkarni 提交于
      * Support submitting pulsar functions to kubernetes
      
      * Adjusted pom
      
      * Added helper function
      
      * Added port to instance config
      
      * Made things public
      
      * More fixes
      
      * Made changes to kubernetes controller
      
      * refactored jobname
      
      * Removed resource
      
      * Bumped to 2.1.0
      
      * Fix compilation bug
      
      * Fix compile bugs
      
      * Fixed compile
      
      * Compile fix
      
      * Some remant
      
      * Unnecessary imports
      
      * Added dep
      
      * Default values
      
      * Fix
      
      * Use kubectl proxy stuff
      
      * Corrected the path of pulsar-amin
      
      * Fixed bugs
      
      * No longer required
      
      * Download first
      
      * make shard id work
      
      * Removed using runtime
      
      * Fixed npe
      
      * Corrected command name
      
      * Fixed bugs
      
      * Removed commented sections
      
      * Uncommented some stuff
      
      * Address Jerry's comments
      
      * Change to 2.2
      
      * Use non camel case style for passing arguments
      
      * removed cmdline changes
      
      * Second set of changes
      
      * Next set of canges
      
      * no such module
      
      * Code complete
      
      * Fixed logic wrt packages
      
      * Do not stop externally managed functions upon exit
      
      * Modified to use AppV1 instead of beta
      
      * use lower case
      
      * Unpretty the function details
      
      * If the job exists, don't flag as error
      
      * Give ability to submit from inside a pod
      
      * remove encode/decode
      
      * Escape function details
      
      * Working copy with getstatus and stop. Restart needs some work
      
      * removed unused function
      
      * Fixed bugs
      
      * Fixed unittest
      
      * Fixed unittest
      
      * Fixed unittest
      
      * Fixed tests
      
      * Reverted conf changes
      
      * Minor nit
      
      * Exlcude logback
      
      * Updated comments
      
      * Changed jobname to include namespace/tenant
      
      * Fix unittest
      
      * Updated licenses
      
      * Use 2.0.0 instead of beta1
      d0858065
  31. 27 9月, 2018 1 次提交
    • S
      [functions] change instance id from string to int and expose number of instances in context (#2411) · be5e847a
      Sijie Guo 提交于
      * [functions] change instance id from string to int and expose number of instances in context
      
       ### Motivation
      
      When writing a connector reading from a list of sources, it is hard for the connector implementation to decide how
      to distribute the list of sources across the function instances. because there is no way to tell how many function
      instances is running.
      
       ### Changes
      
      - change instance id from string to integer (since the implementation is already assuming instance id is an integer)
      - add getNumInstances in the context
      - expose both interfaces in source and sink connector context
      
      * Fix compilation
      be5e847a
  32. 17 9月, 2018 1 次提交
    • S
      Preserve filename of the original function submission (#2588) · a1233803
      Sanjeev Kulkarni 提交于
      ### Motivation
      
      When we submit a function, currently we don't note down the original filename that was uploaded from the client. For regular java functions this works fine. For python workers we manage by doing tricks wrt tricks like filename using classnames. However when we add things like wheel support, the filename encodes information that cannot be discarded away.
      This pr preserves that filename
      a1233803
  33. 15 8月, 2018 1 次提交
  34. 14 8月, 2018 1 次提交
  35. 16 7月, 2018 1 次提交
    • S
      FunctionActioner should set the type class name for both source and sink (#2167) · 555dd57a
      Sijie Guo 提交于
      * FunctionActioner should set the type class name for both source and sink
      
      *Motivation*
      
      The type class names are not set correctly for builtin connectors by FunctionActioner.
      
      *Changes*
      
      Set the type class name inferred from NAR package in FunctionActioner.
      
      * Add an integration for connectors
      
      * Fix ProcessRuntimeTest
      555dd57a
  36. 13 7月, 2018 1 次提交
  37. 12 7月, 2018 1 次提交
  38. 20 6月, 2018 1 次提交
  39. 08 6月, 2018 1 次提交
  40. 07 6月, 2018 1 次提交