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, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData) Deprecated.booleanallowFunctionOps(org.apache.pulsar.common.naming.NamespaceName namespaceName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidchangeFunctionInstanceStatus(String tenant, String namespace, String componentName, String instanceId, boolean start, URI uri, String clientRole, org.apache.pulsar.broker.authentication.AuthenticationDataSource clientAuthenticationDataHttps) Deprecated.voidchangeFunctionInstanceStatus(String tenant, String namespace, String componentName, String instanceId, boolean start, URI uri, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidchangeFunctionStatusAllInstances(String tenant, String namespace, String componentName, boolean start, String clientRole, org.apache.pulsar.broker.authentication.AuthenticationDataSource clientAuthenticationDataHttps) Deprecated.voidchangeFunctionStatusAllInstances(String tenant, String namespace, String componentName, boolean start, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) protected voidcomponentInstanceStatusRequestValidate(String tenant, String namespace, String componentName, int instanceId, String clientRole, org.apache.pulsar.broker.authentication.AuthenticationDataSource clientAuthenticationDataHttps) Deprecated.protected voidcomponentInstanceStatusRequestValidate(String tenant, String namespace, String componentName, int instanceId, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) protected voidcomponentStatusRequestValidate(String tenant, String namespace, String componentName, String clientRole, org.apache.pulsar.broker.authentication.AuthenticationDataSource clientAuthenticationDataHttps) Deprecated.protected voidcomponentStatusRequestValidate(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) static StringcreatePackagePath(String tenant, String namespace, String functionName, String fileName) voidderegisterFunction(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) javax.ws.rs.core.StreamingOutputdownloadFunction(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) javax.ws.rs.core.StreamingOutputdownloadFunction(String path, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) protected ClassLoadergetClassLoaderFromPackage(String className, File packageFile, String narExtractionDirectory) org.apache.pulsar.common.functions.FunctionConfiggetFunctionInfo(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) org.apache.pulsar.common.policies.data.FunctionInstanceStatsDataImplgetFunctionsInstanceStats(String tenant, String namespace, String componentName, String instanceId, URI uri, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) org.apache.pulsar.common.functions.FunctionStategetFunctionState(String tenant, String namespace, String functionName, String key, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) org.apache.pulsar.common.policies.data.FunctionStatsImplgetFunctionStats(String tenant, String namespace, String componentName, URI uri, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) List<org.apache.pulsar.common.io.ConnectorDefinition>booleanisAuthorizedRole(String tenant, String namespace, String clientRole, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData) Deprecated.booleanisAuthorizedRole(String tenant, String namespace, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) booleanisSuperUser(String clientRole, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData) Deprecated.booleanisSuperUser(org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) listFunctions(String tenant, String namespace, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidputFunctionState(String tenant, String namespace, String functionName, String key, org.apache.pulsar.common.functions.FunctionState state, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidreloadConnectors(org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidrestartFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidrestartFunctionInstances(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidstartFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidstartFunctionInstances(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidstopFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidstopFunctionInstances(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voidthrowRestExceptionIfUnauthorizedForNamespace(String tenant, String namespace, String componentName, String action, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) triggerFunction(String tenant, String namespace, String functionName, String input, InputStream uploadedInputStream, String topic, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) voiduploadFunction(InputStream uploadedInputStream, String path, org.apache.pulsar.broker.authentication.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, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
deregisterFunctionin interfaceComponent<PulsarWorkerService>
-
getFunctionInfo
public org.apache.pulsar.common.functions.FunctionConfig getFunctionInfo(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
getFunctionInfoin interfaceComponent<PulsarWorkerService>
-
stopFunctionInstance
public void stopFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
stopFunctionInstancein interfaceComponent<PulsarWorkerService>
-
startFunctionInstance
public void startFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, org.apache.pulsar.broker.authentication.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, org.apache.pulsar.broker.authentication.AuthenticationDataSource clientAuthenticationDataHttps) Deprecated. -
changeFunctionInstanceStatus
-
restartFunctionInstance
public void restartFunctionInstance(String tenant, String namespace, String componentName, String instanceId, URI uri, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
restartFunctionInstancein interfaceComponent<PulsarWorkerService>
-
stopFunctionInstances
public void stopFunctionInstances(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
stopFunctionInstancesin interfaceComponent<PulsarWorkerService>
-
startFunctionInstances
public void startFunctionInstances(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
startFunctionInstancesin interfaceComponent<PulsarWorkerService>
-
changeFunctionStatusAllInstances
@Deprecated public void changeFunctionStatusAllInstances(String tenant, String namespace, String componentName, boolean start, String clientRole, org.apache.pulsar.broker.authentication.AuthenticationDataSource clientAuthenticationDataHttps) Deprecated. -
changeFunctionStatusAllInstances
-
restartFunctionInstances
public void restartFunctionInstances(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.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, org.apache.pulsar.broker.authentication.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, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
getFunctionsInstanceStatsin interfaceComponent<PulsarWorkerService>
-
listFunctions
public List<String> listFunctions(String tenant, String namespace, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
listFunctionsin interfaceComponent<PulsarWorkerService>
-
getListOfConnectors
- Specified by:
getListOfConnectorsin interfaceComponent<PulsarWorkerService>
-
reloadConnectors
public void reloadConnectors(org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
reloadConnectorsin interfaceComponent<PulsarWorkerService>
-
triggerFunction
public String triggerFunction(String tenant, String namespace, String functionName, String input, InputStream uploadedInputStream, String topic, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
triggerFunctionin interfaceComponent<PulsarWorkerService>
-
getFunctionState
public org.apache.pulsar.common.functions.FunctionState getFunctionState(String tenant, String namespace, String functionName, String key, org.apache.pulsar.broker.authentication.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, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
putFunctionStatein interfaceComponent<PulsarWorkerService>
-
uploadFunction
public void uploadFunction(InputStream uploadedInputStream, String path, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
uploadFunctionin interfaceComponent<PulsarWorkerService>
-
downloadFunction
public javax.ws.rs.core.StreamingOutput downloadFunction(String tenant, String namespace, String componentName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) - Specified by:
downloadFunctionin interfaceComponent<PulsarWorkerService>
-
downloadFunction
public javax.ws.rs.core.StreamingOutput downloadFunction(String path, org.apache.pulsar.broker.authentication.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, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData) throws org.apache.pulsar.client.admin.PulsarAdminException Deprecated.- Throws:
org.apache.pulsar.client.admin.PulsarAdminException
-
isAuthorizedRole
public boolean isAuthorizedRole(String tenant, String namespace, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) throws org.apache.pulsar.client.admin.PulsarAdminException - Throws:
org.apache.pulsar.client.admin.PulsarAdminException
-
throwRestExceptionIfUnauthorizedForNamespace
-
componentStatusRequestValidate
@Deprecated protected void componentStatusRequestValidate(String tenant, String namespace, String componentName, String clientRole, org.apache.pulsar.broker.authentication.AuthenticationDataSource clientAuthenticationDataHttps) Deprecated. -
componentStatusRequestValidate
-
componentInstanceStatusRequestValidate
@Deprecated protected void componentInstanceStatusRequestValidate(String tenant, String namespace, String componentName, int instanceId, String clientRole, org.apache.pulsar.broker.authentication.AuthenticationDataSource clientAuthenticationDataHttps) Deprecated. -
componentInstanceStatusRequestValidate
-
isSuperUser
public boolean isSuperUser(org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) -
isSuperUser
@Deprecated public boolean isSuperUser(String clientRole, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData) Deprecated. -
allowFunctionOps
@Deprecated public boolean allowFunctionOps(org.apache.pulsar.common.naming.NamespaceName namespaceName, String role, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData) Deprecated. -
allowFunctionOps
public boolean allowFunctionOps(org.apache.pulsar.common.naming.NamespaceName namespaceName, org.apache.pulsar.broker.authentication.AuthenticationParameters authParams) -
getClassLoaderFromPackage
protected ClassLoader getClassLoaderFromPackage(String className, File packageFile, String narExtractionDirectory)
-
isSuperUser(AuthenticationParameters)