Class FunctionsImpl

    • Constructor Detail

      • FunctionsImpl

        public FunctionsImpl​(java.util.function.Supplier<PulsarWorkerService> workerServiceSupplier)
    • Method Detail

      • registerFunction

        public void registerFunction​(java.lang.String tenant,
                                     java.lang.String namespace,
                                     java.lang.String functionName,
                                     java.io.InputStream uploadedInputStream,
                                     org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDetail,
                                     java.lang.String functionPkgUrl,
                                     org.apache.pulsar.common.functions.FunctionConfig functionConfig,
                                     org.apache.pulsar.broker.authentication.AuthenticationParameters authParams)
        Description copied from interface: Functions
        Register a new function.
        Specified by:
        registerFunction in interface Functions<PulsarWorkerService>
        Parameters:
        tenant - The tenant of a Pulsar Function
        namespace - The namespace of a Pulsar Function
        functionName - The name of a Pulsar Function
        uploadedInputStream - Input stream of bytes
        fileDetail - A form-data content disposition header
        functionPkgUrl - URL path of the Pulsar Function package
        functionConfig - Configuration of Pulsar Function
        authParams - the authentication parameters associated with the request
      • updateFunction

        public void updateFunction​(java.lang.String tenant,
                                   java.lang.String namespace,
                                   java.lang.String functionName,
                                   java.io.InputStream uploadedInputStream,
                                   org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDetail,
                                   java.lang.String functionPkgUrl,
                                   org.apache.pulsar.common.functions.FunctionConfig functionConfig,
                                   org.apache.pulsar.broker.authentication.AuthenticationParameters authParams,
                                   org.apache.pulsar.common.functions.UpdateOptionsImpl updateOptions)
        Description copied from interface: Functions
        Update a function.
        Specified by:
        updateFunction in interface Functions<PulsarWorkerService>
        Parameters:
        tenant - The tenant of a Pulsar Function
        namespace - The namespace of a Pulsar Function
        functionName - The name of a Pulsar Function
        uploadedInputStream - Input stream of bytes
        fileDetail - A form-data content disposition header
        functionPkgUrl - URL path of the Pulsar Function package
        functionConfig - Configuration of Pulsar Function
        authParams - the authentication parameters associated with the request
        updateOptions - Options while updating the function
      • getFunctionInstanceStatus

        public org.apache.pulsar.common.policies.data.FunctionStatus.FunctionInstanceStatus.FunctionInstanceStatusData getFunctionInstanceStatus​(java.lang.String tenant,
                                                                                                                                                 java.lang.String namespace,
                                                                                                                                                 java.lang.String componentName,
                                                                                                                                                 java.lang.String instanceId,
                                                                                                                                                 java.net.URI uri,
                                                                                                                                                 org.apache.pulsar.broker.authentication.AuthenticationParameters authParams)
        Get status of a function instance. If this worker is not running the function instance,
        Specified by:
        getFunctionInstanceStatus in interface Functions<PulsarWorkerService>
        Parameters:
        tenant - the tenant the function belongs to
        namespace - the namespace the function belongs to
        componentName - the function name
        instanceId - the function instance id
        Returns:
        the function status
      • getFunctionStatus

        public org.apache.pulsar.common.policies.data.FunctionStatus getFunctionStatus​(java.lang.String tenant,
                                                                                       java.lang.String namespace,
                                                                                       java.lang.String componentName,
                                                                                       java.net.URI uri,
                                                                                       org.apache.pulsar.broker.authentication.AuthenticationParameters authParams)
        Get statuses of all function instances.
        Specified by:
        getFunctionStatus in interface Functions<PulsarWorkerService>
        Parameters:
        tenant - the tenant the function belongs to
        namespace - the namespace the function belongs to
        componentName - the function name
        Returns:
        a list of function statuses
        Throws:
        org.apache.pulsar.client.admin.PulsarAdminException
      • updateFunctionOnWorkerLeader

        public void updateFunctionOnWorkerLeader​(java.lang.String tenant,
                                                 java.lang.String namespace,
                                                 java.lang.String functionName,
                                                 java.io.InputStream uploadedInputStream,
                                                 boolean delete,
                                                 java.net.URI uri,
                                                 org.apache.pulsar.broker.authentication.AuthenticationParameters authParams)
        Specified by:
        updateFunctionOnWorkerLeader in interface Functions<PulsarWorkerService>