Class ComponentImpl
java.lang.Object
org.apache.pulsar.functions.worker.rest.api.ComponentImpl
- All Implemented Interfaces:
Component<PulsarWorkerService>
- Direct Known Subclasses:
FunctionsImpl,SinksImpl,SourcesImpl
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentTypeprotected final Supplier<PulsarWorkerService> -
Constructor Summary
ConstructorsConstructorDescriptionComponentImpl(Supplier<PulsarWorkerService> workerServiceSupplier, org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType) -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowFunctionOps(org.apache.pulsar.common.naming.NamespaceName namespaceName, String role, AuthenticationDataSource authenticationData) Deprecated.booleanallowFunctionOps(org.apache.pulsar.common.naming.NamespaceName namespaceName, AuthenticationParameters authParams) voidchangeFunctionInstanceStatus(String tenant, String namespace, String componentName, String instanceId, boolean start, URI uri, String clientRole, AuthenticationDataSource clientAuthenticationDataHttps) Deprecated.voidchangeFunctionInstanceStatus(String tenant, String namespace, String componentName, String instanceId, boolean start, URI uri, AuthenticationParameters authParams) voidchangeFunctionStatusAllInstances(String tenant, String namespace, String componentName, boolean start, String clientRole, AuthenticationDataSource clientAuthenticationDataHttps) Deprecated.voidchangeFunctionStatusAllInstances(String tenant, String namespace, String componentName, boolean start, AuthenticationParameters authParams) protected voidcomponentInstanceStatusRequestValidate(String tenant, String namespace, String componentName, int instanceId, String clientRole, AuthenticationDataSource clientAuthenticationDataHttps) Deprecated.protected voidcomponentInstanceStatusRequestValidate(String tenant, String namespace, String componentName, int instanceId, AuthenticationParameters authParams) protected voidcomponentStatusRequestValidate(String tenant, String namespace, String componentName, String clientRole, AuthenticationDataSource clientAuthenticationDataHttps) Deprecated.protected voidcomponentStatusRequestValidate(String tenant, String namespace, String componentName, AuthenticationParameters authParams) static StringcreatePackagePath(String tenant, String namespace, String functionName, String fileName) voidderegisterFunction(String tenant, String namespace, String componentName, AuthenticationParameters authParams) javax.ws.rs.core.StreamingOutputdownloadFunction(String tenant, String namespace, String componentName, AuthenticationParameters authParams, boolean transformFunction) javax.ws.rs.core.StreamingOutputdownloadFunction(String path, AuthenticationParameters authParams) protected org.apache.pulsar.functions.utils.ValidatableFunctionPackagegetBuiltinFunctionPackage(String archive) org.apache.pulsar.common.functions.FunctionConfiggetFunctionInfo(String tenant, String namespace, String componentName, AuthenticationParameters authParams) org.apache.pulsar.common.policies.data.FunctionInstanceStatsDataImplgetFunctionsInstanceStats(String tenant, String namespace, String componentName, String instanceId, URI uri, AuthenticationParameters authParams) org.apache.pulsar.common.functions.FunctionStategetFunctionState(String tenant, String namespace, String functionName, String key, AuthenticationParameters authParams) org.apache.pulsar.common.policies.data.FunctionStatsImplgetFunctionStats(String tenant, String namespace, String componentName, URI uri, AuthenticationParameters authParams) List<org.apache.pulsar.common.io.ConnectorDefinition>protected FilegetPackageFile(org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType, String functionPkgUrl) protected FilegetPackageFile(org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType, String functionPkgUrl, String existingPackagePath, InputStream uploadedInputStream) booleanisAuthorizedRole(String tenant, String namespace, String clientRole, AuthenticationDataSource authenticationData) Deprecated.booleanisAuthorizedRole(String tenant, String namespace, AuthenticationParameters authParams) booleanisSuperUser(String clientRole, AuthenticationDataSource authenticationData) Deprecated.booleanisSuperUser(AuthenticationParameters authParams) listFunctions(String tenant, String namespace, AuthenticationParameters authParams) voidputFunctionState(String tenant, String namespace, String functionName, String key, org.apache.pulsar.common.functions.FunctionState state, AuthenticationParameters authParams) voidreloadConnectors(AuthenticationParameters authParams) voidrestartFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, AuthenticationParameters authParams) voidrestartFunctionInstances(String tenant, String namespace, String componentName, AuthenticationParameters authParams) voidstartFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, AuthenticationParameters authParams) voidstartFunctionInstances(String tenant, String namespace, String componentName, AuthenticationParameters authParams) voidstopFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, AuthenticationParameters authParams) voidstopFunctionInstances(String tenant, String namespace, String componentName, AuthenticationParameters authParams) voidthrowRestExceptionIfUnauthorizedForNamespace(String tenant, String namespace, String componentName, String action, AuthenticationParameters authParams) triggerFunction(String tenant, String namespace, String functionName, String input, InputStream uploadedInputStream, String topic, AuthenticationParameters authParams) voiduploadFunction(InputStream uploadedInputStream, String path, AuthenticationParameters authParams) protected voidvalidateGetFunctionInstanceRequestParams(String tenant, String namespace, String componentName, org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType, String instanceId) protected voidvalidateGetFunctionRequestParams(String tenant, String namespace, String subject, org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType) worker()
-
Field Details
-
workerServiceSupplier
-
componentType
protected final org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType
-
-
Constructor Details
-
ComponentImpl
public ComponentImpl(Supplier<PulsarWorkerService> workerServiceSupplier, org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType)
-
-
Method Details
-
worker
- Specified by:
workerin interfaceComponent<PulsarWorkerService>
-
deregisterFunction
public void deregisterFunction(String tenant, String namespace, String componentName, AuthenticationParameters authParams) - Specified by:
deregisterFunctionin interfaceComponent<PulsarWorkerService>
-
getFunctionInfo
public org.apache.pulsar.common.functions.FunctionConfig getFunctionInfo(String tenant, String namespace, String componentName, AuthenticationParameters authParams) - Specified by:
getFunctionInfoin interfaceComponent<PulsarWorkerService>
-
stopFunctionInstance
public void stopFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, AuthenticationParameters authParams) - Specified by:
stopFunctionInstancein interfaceComponent<PulsarWorkerService>
-
startFunctionInstance
public void startFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, AuthenticationParameters authParams) - Specified by:
startFunctionInstancein interfaceComponent<PulsarWorkerService>
-
changeFunctionInstanceStatus
@Deprecated public void changeFunctionInstanceStatus(String tenant, String namespace, String componentName, String instanceId, boolean start, URI uri, String clientRole, AuthenticationDataSource clientAuthenticationDataHttps) Deprecated. -
changeFunctionInstanceStatus
-
restartFunctionInstance
public void restartFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, AuthenticationParameters authParams) - Specified by:
restartFunctionInstancein interfaceComponent<PulsarWorkerService>
-
stopFunctionInstances
public void stopFunctionInstances(String tenant, String namespace, String componentName, AuthenticationParameters authParams) - Specified by:
stopFunctionInstancesin interfaceComponent<PulsarWorkerService>
-
startFunctionInstances
public void startFunctionInstances(String tenant, String namespace, String componentName, AuthenticationParameters authParams) - Specified by:
startFunctionInstancesin interfaceComponent<PulsarWorkerService>
-
changeFunctionStatusAllInstances
@Deprecated public void changeFunctionStatusAllInstances(String tenant, String namespace, String componentName, boolean start, String clientRole, AuthenticationDataSource clientAuthenticationDataHttps) Deprecated. -
changeFunctionStatusAllInstances
public void changeFunctionStatusAllInstances(String tenant, String namespace, String componentName, boolean start, AuthenticationParameters authParams) -
restartFunctionInstances
public void restartFunctionInstances(String tenant, String namespace, String componentName, AuthenticationParameters authParams) - Specified by:
restartFunctionInstancesin interfaceComponent<PulsarWorkerService>
-
getFunctionStats
public org.apache.pulsar.common.policies.data.FunctionStatsImpl getFunctionStats(String tenant, String namespace, String componentName, URI uri, AuthenticationParameters authParams) - Specified by:
getFunctionStatsin interfaceComponent<PulsarWorkerService>
-
getFunctionsInstanceStats
public org.apache.pulsar.common.policies.data.FunctionInstanceStatsDataImpl getFunctionsInstanceStats(String tenant, String namespace, String componentName, String instanceId, URI uri, AuthenticationParameters authParams) - Specified by:
getFunctionsInstanceStatsin interfaceComponent<PulsarWorkerService>
-
listFunctions
public List<String> listFunctions(String tenant, String namespace, AuthenticationParameters authParams) - Specified by:
listFunctionsin interfaceComponent<PulsarWorkerService>
-
getListOfConnectors
- Specified by:
getListOfConnectorsin interfaceComponent<PulsarWorkerService>
-
reloadConnectors
- Specified by:
reloadConnectorsin interfaceComponent<PulsarWorkerService>
-
triggerFunction
public String triggerFunction(String tenant, String namespace, String functionName, String input, InputStream uploadedInputStream, String topic, AuthenticationParameters authParams) - Specified by:
triggerFunctionin interfaceComponent<PulsarWorkerService>
-
getFunctionState
public org.apache.pulsar.common.functions.FunctionState getFunctionState(String tenant, String namespace, String functionName, String key, AuthenticationParameters authParams) - Specified by:
getFunctionStatein interfaceComponent<PulsarWorkerService>
-
putFunctionState
public void putFunctionState(String tenant, String namespace, String functionName, String key, org.apache.pulsar.common.functions.FunctionState state, AuthenticationParameters authParams) - Specified by:
putFunctionStatein interfaceComponent<PulsarWorkerService>
-
uploadFunction
public void uploadFunction(InputStream uploadedInputStream, String path, AuthenticationParameters authParams) - Specified by:
uploadFunctionin interfaceComponent<PulsarWorkerService>
-
downloadFunction
public javax.ws.rs.core.StreamingOutput downloadFunction(String tenant, String namespace, String componentName, AuthenticationParameters authParams, boolean transformFunction) - Specified by:
downloadFunctionin interfaceComponent<PulsarWorkerService>
-
downloadFunction
public javax.ws.rs.core.StreamingOutput downloadFunction(String path, AuthenticationParameters authParams) - Specified by:
downloadFunctionin interfaceComponent<PulsarWorkerService>
-
validateGetFunctionInstanceRequestParams
protected void validateGetFunctionInstanceRequestParams(String tenant, String namespace, String componentName, org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType, String instanceId) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
validateGetFunctionRequestParams
protected void validateGetFunctionRequestParams(String tenant, String namespace, String subject, org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
createPackagePath
-
isAuthorizedRole
@Deprecated public boolean isAuthorizedRole(String tenant, String namespace, String clientRole, AuthenticationDataSource authenticationData) throws PulsarAdminException Deprecated.- Throws:
PulsarAdminException
-
isAuthorizedRole
public boolean isAuthorizedRole(String tenant, String namespace, AuthenticationParameters authParams) throws PulsarAdminException - Throws:
PulsarAdminException
-
throwRestExceptionIfUnauthorizedForNamespace
public void throwRestExceptionIfUnauthorizedForNamespace(String tenant, String namespace, String componentName, String action, AuthenticationParameters authParams) -
componentStatusRequestValidate
@Deprecated protected void componentStatusRequestValidate(String tenant, String namespace, String componentName, String clientRole, AuthenticationDataSource clientAuthenticationDataHttps) Deprecated. -
componentStatusRequestValidate
protected void componentStatusRequestValidate(String tenant, String namespace, String componentName, AuthenticationParameters authParams) -
componentInstanceStatusRequestValidate
@Deprecated protected void componentInstanceStatusRequestValidate(String tenant, String namespace, String componentName, int instanceId, String clientRole, AuthenticationDataSource clientAuthenticationDataHttps) Deprecated. -
componentInstanceStatusRequestValidate
protected void componentInstanceStatusRequestValidate(String tenant, String namespace, String componentName, int instanceId, AuthenticationParameters authParams) -
isSuperUser
-
isSuperUser
@Deprecated public boolean isSuperUser(String clientRole, AuthenticationDataSource authenticationData) Deprecated. -
allowFunctionOps
@Deprecated public boolean allowFunctionOps(org.apache.pulsar.common.naming.NamespaceName namespaceName, String role, AuthenticationDataSource authenticationData) Deprecated. -
allowFunctionOps
public boolean allowFunctionOps(org.apache.pulsar.common.naming.NamespaceName namespaceName, AuthenticationParameters authParams) -
getPackageFile
protected File getPackageFile(org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType, String functionPkgUrl, String existingPackagePath, InputStream uploadedInputStream) throws IOException, PulsarAdminException - Throws:
IOExceptionPulsarAdminException
-
getPackageFile
protected File getPackageFile(org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType, String functionPkgUrl) throws IOException, PulsarAdminException - Throws:
IOExceptionPulsarAdminException
-
getBuiltinFunctionPackage
protected org.apache.pulsar.functions.utils.ValidatableFunctionPackage getBuiltinFunctionPackage(String archive)
-
isSuperUser(AuthenticationParameters)