public class FunctionRuntimeManager extends Object implements AutoCloseable
| Constructor and Description |
|---|
FunctionRuntimeManager(WorkerConfig workerConfig,
WorkerService workerService,
org.apache.distributedlog.api.namespace.Namespace dlogNamespace,
MembershipManager membershipManager,
ConnectorsManager connectorsManager,
FunctionsManager functionsManager,
FunctionMetaDataManager functionMetaDataManager,
WorkerStatsManager workerStatsManager,
ErrorNotifier errorNotifier) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
deleteAssignment(String fullyQualifiedInstanceId) |
org.apache.pulsar.functions.proto.Function.Assignment |
findFunctionAssignment(String tenant,
String namespace,
String functionName,
int instanceId)
Find a assignment of a function
|
Collection<org.apache.pulsar.functions.proto.Function.Assignment> |
findFunctionAssignments(String tenant,
String namespace,
String functionName)
Find all instance assignments of function
|
static Collection<org.apache.pulsar.functions.proto.Function.Assignment> |
findFunctionAssignments(String tenant,
String namespace,
String functionName,
Map<String,Map<String,org.apache.pulsar.functions.proto.Function.Assignment>> workerIdToAssignments) |
Map<String,Map<String,org.apache.pulsar.functions.proto.Function.Assignment>> |
getCurrentAssignments()
Get current assignments
|
org.apache.pulsar.common.policies.data.FunctionStats.FunctionInstanceStats.FunctionInstanceStatsData |
getFunctionInstanceStats(String tenant,
String namespace,
String functionName,
int instanceId,
URI uri)
Get stats of a function instance.
|
FunctionRuntimeInfo |
getFunctionRuntimeInfo(String fullyQualifiedInstanceId) |
Map<String,FunctionRuntimeInfo> |
getFunctionRuntimeInfos() |
org.apache.pulsar.common.policies.data.FunctionStats |
getFunctionStats(String tenant,
String namespace,
String functionName,
URI uri)
Get stats of all function instances.
|
int |
getMyInstances()
Methods for metrics
|
org.apache.pulsar.client.api.MessageId |
initialize()
Initializes the FunctionRuntimeManager.
|
void |
processAssignment(org.apache.pulsar.functions.proto.Function.Assignment newAssignment)
Process an assignment update from the assignment topic
|
void |
processAssignmentMessage(org.apache.pulsar.client.api.Message<byte[]> msg) |
void |
removeAssignments(Collection<org.apache.pulsar.functions.proto.Function.Assignment> assignments)
Removes a collection of assignments
|
void |
restartFunctionInstance(String tenant,
String namespace,
String functionName,
int instanceId,
URI uri) |
void |
restartFunctionInstances(String tenant,
String namespace,
String functionName) |
void |
stopAllOwnedFunctions()
It stops all functions instances owned by current worker
|
public FunctionRuntimeManager(WorkerConfig workerConfig, WorkerService workerService, org.apache.distributedlog.api.namespace.Namespace dlogNamespace, MembershipManager membershipManager, ConnectorsManager connectorsManager, FunctionsManager functionsManager, FunctionMetaDataManager functionMetaDataManager, WorkerStatsManager workerStatsManager, ErrorNotifier errorNotifier) throws Exception
Exceptionpublic org.apache.pulsar.client.api.MessageId initialize()
public Map<String,Map<String,org.apache.pulsar.functions.proto.Function.Assignment>> getCurrentAssignments()
public org.apache.pulsar.functions.proto.Function.Assignment findFunctionAssignment(String tenant, String namespace, String functionName, int instanceId)
tenant - the tenant the function belongs tonamespace - the namespace the function belongs tofunctionName - the function namepublic Collection<org.apache.pulsar.functions.proto.Function.Assignment> findFunctionAssignments(String tenant, String namespace, String functionName)
tenant - namespace - functionName - public static Collection<org.apache.pulsar.functions.proto.Function.Assignment> findFunctionAssignments(String tenant, String namespace, String functionName, Map<String,Map<String,org.apache.pulsar.functions.proto.Function.Assignment>> workerIdToAssignments)
public void removeAssignments(Collection<org.apache.pulsar.functions.proto.Function.Assignment> assignments)
assignments - assignments to removepublic void restartFunctionInstance(String tenant, String namespace, String functionName, int instanceId, URI uri) throws Exception
Exceptionpublic void restartFunctionInstances(String tenant, String namespace, String functionName) throws Exception
Exceptionpublic void stopAllOwnedFunctions()
Exceptionpublic org.apache.pulsar.common.policies.data.FunctionStats.FunctionInstanceStats.FunctionInstanceStatsData getFunctionInstanceStats(String tenant, String namespace, String functionName, int instanceId, URI uri)
tenant - the tenant the function belongs tonamespace - the namespace the function belongs tofunctionName - the function nameinstanceId - the function instance idpublic org.apache.pulsar.common.policies.data.FunctionStats getFunctionStats(String tenant, String namespace, String functionName, URI uri) throws PulsarAdminException
tenant - the tenant the function belongs tonamespace - the namespace the function belongs tofunctionName - the function namePulsarAdminExceptionpublic void processAssignmentMessage(org.apache.pulsar.client.api.Message<byte[]> msg)
public void processAssignment(org.apache.pulsar.functions.proto.Function.Assignment newAssignment)
newAssignment - the assignmentpublic void deleteAssignment(String fullyQualifiedInstanceId)
public Map<String,FunctionRuntimeInfo> getFunctionRuntimeInfos()
public void close()
throws Exception
close in interface AutoCloseableExceptionpublic FunctionRuntimeInfo getFunctionRuntimeInfo(String fullyQualifiedInstanceId)
public int getMyInstances()
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.