Search in sources :

Example 1 with ThreadRuntimeFactoryConfig

use of org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig in project pulsar by apache.

the class PulsarFunctionE2ESecurityTest method createPulsarFunctionWorker.

private PulsarWorkerService createPulsarFunctionWorker(ServiceConfiguration config) {
    System.setProperty(JAVA_INSTANCE_JAR_PROPERTY, FutureUtil.class.getProtectionDomain().getCodeSource().getLocation().getPath());
    workerConfig = new WorkerConfig();
    tempDirectory = PulsarFunctionTestTemporaryDirectory.create(getClass().getSimpleName());
    tempDirectory.useTemporaryDirectoriesForWorkerConfig(workerConfig);
    workerConfig.setPulsarFunctionsNamespace(pulsarFunctionsNamespace);
    workerConfig.setSchedulerClassName(org.apache.pulsar.functions.worker.scheduler.RoundRobinScheduler.class.getName());
    workerConfig.setFunctionRuntimeFactoryClassName(ThreadRuntimeFactory.class.getName());
    workerConfig.setFunctionRuntimeFactoryConfigs(ObjectMapperFactory.getThreadLocal().convertValue(new ThreadRuntimeFactoryConfig().setThreadGroupName("use"), Map.class));
    // worker talks to local broker
    workerConfig.setPulsarServiceUrl("pulsar://127.0.0.1:" + config.getBrokerServicePort().get());
    workerConfig.setPulsarWebServiceUrl("http://127.0.0.1:" + config.getWebServicePort().get());
    workerConfig.setFailureCheckFreqMs(100);
    workerConfig.setNumFunctionPackageReplicas(1);
    workerConfig.setClusterCoordinationTopicName("coordinate");
    workerConfig.setFunctionAssignmentTopicName("assignment");
    workerConfig.setFunctionMetadataTopicName("metadata");
    workerConfig.setInstanceLivenessCheckFreqMs(100);
    workerConfig.setWorkerPort(0);
    workerConfig.setPulsarFunctionsCluster(config.getClusterName());
    String hostname = ServiceConfigurationUtils.getDefaultOrConfiguredAddress(config.getAdvertisedAddress());
    this.workerId = "c-" + config.getClusterName() + "-fw-" + hostname + "-" + workerConfig.getWorkerPort();
    workerConfig.setWorkerHostname(hostname);
    workerConfig.setWorkerId(workerId);
    workerConfig.setBrokerClientAuthenticationPlugin(AuthenticationToken.class.getName());
    workerConfig.setBrokerClientAuthenticationParameters(String.format("token:%s", adminToken));
    workerConfig.setAuthenticationEnabled(config.isAuthenticationEnabled());
    workerConfig.setAuthenticationProviders(config.getAuthenticationProviders());
    workerConfig.setAuthorizationEnabled(config.isAuthorizationEnabled());
    workerConfig.setAuthorizationProvider(config.getAuthorizationProvider());
    PulsarWorkerService workerService = new PulsarWorkerService();
    workerService.init(workerConfig, null, false);
    return workerService;
}
Also used : ThreadRuntimeFactoryConfig(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig) AuthenticationToken(org.apache.pulsar.client.impl.auth.AuthenticationToken) ThreadRuntimeFactory(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactory) Map(java.util.Map)

Example 2 with ThreadRuntimeFactoryConfig

use of org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig in project pulsar by apache.

the class PulsarWorkerAssignmentTest method createPulsarFunctionWorker.

private PulsarWorkerService createPulsarFunctionWorker(ServiceConfiguration config) {
    workerConfig = new WorkerConfig();
    tempDirectory = PulsarFunctionTestTemporaryDirectory.create(getClass().getSimpleName());
    tempDirectory.useTemporaryDirectoriesForWorkerConfig(workerConfig);
    workerConfig.setPulsarFunctionsNamespace(pulsarFunctionsNamespace);
    workerConfig.setSchedulerClassName(org.apache.pulsar.functions.worker.scheduler.RoundRobinScheduler.class.getName());
    workerConfig.setFunctionRuntimeFactoryClassName(ThreadRuntimeFactory.class.getName());
    workerConfig.setFunctionRuntimeFactoryConfigs(ObjectMapperFactory.getThreadLocal().convertValue(new ThreadRuntimeFactoryConfig().setThreadGroupName("use"), Map.class));
    // worker talks to local broker
    workerConfig.setPulsarServiceUrl("pulsar://127.0.0.1:" + config.getBrokerServicePort().get());
    workerConfig.setPulsarWebServiceUrl("http://127.0.0.1:" + config.getWebServicePort().get());
    workerConfig.setFailureCheckFreqMs(100);
    workerConfig.setNumFunctionPackageReplicas(1);
    workerConfig.setClusterCoordinationTopicName("coordinate");
    workerConfig.setFunctionAssignmentTopicName("assignment");
    workerConfig.setFunctionMetadataTopicName("metadata");
    workerConfig.setInstanceLivenessCheckFreqMs(100);
    workerConfig.setWorkerPort(0);
    workerConfig.setPulsarFunctionsCluster(config.getClusterName());
    final String hostname = ServiceConfigurationUtils.getDefaultOrConfiguredAddress(config.getAdvertisedAddress());
    workerId = "c-" + config.getClusterName() + "-fw-" + hostname + "-" + workerConfig.getWorkerPort();
    workerConfig.setWorkerHostname(hostname);
    workerConfig.setWorkerId(workerId);
    workerConfig.setTopicCompactionFrequencySec(1);
    PulsarWorkerService workerService = new PulsarWorkerService();
    workerService.init(workerConfig, null, false);
    return workerService;
}
Also used : ThreadRuntimeFactoryConfig(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig) ThreadRuntimeFactory(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactory) Map(java.util.Map)

Example 3 with ThreadRuntimeFactoryConfig

use of org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig in project pulsar by apache.

the class AbstractPulsarE2ETest method createPulsarFunctionWorker.

private PulsarWorkerService createPulsarFunctionWorker(ServiceConfiguration config) throws IOException {
    System.setProperty(JAVA_INSTANCE_JAR_PROPERTY, FutureUtil.class.getProtectionDomain().getCodeSource().getLocation().getPath());
    workerConfig = new WorkerConfig();
    tempDirectory = PulsarFunctionTestTemporaryDirectory.create(getClass().getSimpleName());
    tempDirectory.useTemporaryDirectoriesForWorkerConfig(workerConfig);
    workerConfig.setPulsarFunctionsNamespace(pulsarFunctionsNamespace);
    workerConfig.setSchedulerClassName(org.apache.pulsar.functions.worker.scheduler.RoundRobinScheduler.class.getName());
    workerConfig.setFunctionRuntimeFactoryClassName(ThreadRuntimeFactory.class.getName());
    workerConfig.setFunctionRuntimeFactoryConfigs(// worker talks to local broker
    ObjectMapperFactory.getThreadLocal().convertValue(new ThreadRuntimeFactoryConfig().setThreadGroupName("use"), Map.class));
    workerConfig.setFailureCheckFreqMs(100);
    workerConfig.setNumFunctionPackageReplicas(1);
    workerConfig.setClusterCoordinationTopicName("coordinate");
    workerConfig.setFunctionAssignmentTopicName("assignment");
    workerConfig.setFunctionMetadataTopicName("metadata");
    workerConfig.setInstanceLivenessCheckFreqMs(100);
    workerConfig.setWorkerPort(0);
    workerConfig.setPulsarFunctionsCluster(config.getClusterName());
    String hostname = ServiceConfigurationUtils.getDefaultOrConfiguredAddress(config.getAdvertisedAddress());
    this.workerId = "c-" + config.getClusterName() + "-fw-" + hostname + "-" + workerConfig.getWorkerPort();
    workerConfig.setWorkerHostname(hostname);
    workerConfig.setWorkerId(workerId);
    workerConfig.setBrokerClientAuthenticationPlugin(AuthenticationTls.class.getName());
    workerConfig.setBrokerClientAuthenticationParameters(String.format("tlsCertFile:%s,tlsKeyFile:%s", TLS_CLIENT_CERT_FILE_PATH, TLS_CLIENT_KEY_FILE_PATH));
    workerConfig.setUseTls(true);
    workerConfig.setTlsAllowInsecureConnection(true);
    workerConfig.setTlsTrustCertsFilePath(TLS_TRUST_CERT_FILE_PATH);
    workerConfig.setAuthenticationEnabled(true);
    workerConfig.setAuthorizationEnabled(true);
    PulsarWorkerService workerService = new PulsarWorkerService();
    workerService.init(workerConfig, null, false);
    return workerService;
}
Also used : ThreadRuntimeFactoryConfig(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig) AuthenticationTls(org.apache.pulsar.client.impl.auth.AuthenticationTls) PulsarWorkerService(org.apache.pulsar.functions.worker.PulsarWorkerService) WorkerConfig(org.apache.pulsar.functions.worker.WorkerConfig) ThreadRuntimeFactory(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactory) Map(java.util.Map) HashMap(java.util.HashMap)

Example 4 with ThreadRuntimeFactoryConfig

use of org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig in project pulsar by apache.

the class PulsarFunctionAdminTest method createPulsarFunctionWorker.

private PulsarWorkerService createPulsarFunctionWorker(ServiceConfiguration config) {
    workerConfig = new WorkerConfig();
    workerConfig.setPulsarFunctionsNamespace(pulsarFunctionsNamespace);
    workerConfig.setSchedulerClassName(org.apache.pulsar.functions.worker.scheduler.RoundRobinScheduler.class.getName());
    workerConfig.setFunctionRuntimeFactoryClassName(ThreadRuntimeFactory.class.getName());
    workerConfig.setFunctionRuntimeFactoryConfigs(ObjectMapperFactory.getThreadLocal().convertValue(new ThreadRuntimeFactoryConfig().setThreadGroupName("use"), Map.class));
    // worker talks to local broker
    workerConfig.setPulsarServiceUrl("pulsar://127.0.0.1:" + config.getBrokerServicePortTls().get());
    workerConfig.setPulsarWebServiceUrl("https://127.0.0.1:" + config.getWebServicePortTls().get());
    workerConfig.setFailureCheckFreqMs(100);
    workerConfig.setNumFunctionPackageReplicas(1);
    workerConfig.setClusterCoordinationTopicName("coordinate");
    workerConfig.setFunctionAssignmentTopicName("assignment");
    workerConfig.setFunctionMetadataTopicName("metadata");
    workerConfig.setInstanceLivenessCheckFreqMs(100);
    workerConfig.setWorkerPort(0);
    workerConfig.setPulsarFunctionsCluster(config.getClusterName());
    String hostname = ServiceConfigurationUtils.getDefaultOrConfiguredAddress(config.getAdvertisedAddress());
    workerConfig.setWorkerHostname(hostname);
    workerConfig.setWorkerId("c-" + config.getClusterName() + "-fw-" + hostname + "-" + workerConfig.getWorkerPort());
    workerConfig.setBrokerClientAuthenticationPlugin(AuthenticationTls.class.getName());
    workerConfig.setBrokerClientAuthenticationParameters(String.format("tlsCertFile:%s,tlsKeyFile:%s", TLS_CLIENT_CERT_FILE_PATH, TLS_CLIENT_KEY_FILE_PATH));
    workerConfig.setUseTls(true);
    workerConfig.setTlsAllowInsecureConnection(true);
    workerConfig.setTlsTrustCertsFilePath(TLS_CLIENT_CERT_FILE_PATH);
    PulsarWorkerService workerService = new PulsarWorkerService();
    workerService.init(workerConfig, null, false);
    return workerService;
}
Also used : ThreadRuntimeFactoryConfig(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig) AuthenticationTls(org.apache.pulsar.client.impl.auth.AuthenticationTls) PulsarWorkerService(org.apache.pulsar.functions.worker.PulsarWorkerService) WorkerConfig(org.apache.pulsar.functions.worker.WorkerConfig) ThreadRuntimeFactory(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactory) HashMap(java.util.HashMap) Map(java.util.Map)

Example 5 with ThreadRuntimeFactoryConfig

use of org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig in project pulsar by apache.

the class FunctionRuntimeManagerTest method testProcessAssignmentUpdateModifyFunctions.

@Test
public void testProcessAssignmentUpdateModifyFunctions() throws Exception {
    WorkerConfig workerConfig = new WorkerConfig();
    workerConfig.setWorkerId("worker-1");
    workerConfig.setFunctionRuntimeFactoryClassName(ThreadRuntimeFactory.class.getName());
    workerConfig.setFunctionRuntimeFactoryConfigs(ObjectMapperFactory.getThreadLocal().convertValue(new ThreadRuntimeFactoryConfig().setThreadGroupName("test"), Map.class));
    workerConfig.setPulsarServiceUrl(PULSAR_SERVICE_URL);
    workerConfig.setStateStorageServiceUrl("foo");
    PulsarClient pulsarClient = mock(PulsarClient.class);
    ReaderBuilder readerBuilder = mock(ReaderBuilder.class);
    doReturn(readerBuilder).when(pulsarClient).newReader();
    doReturn(readerBuilder).when(readerBuilder).topic(anyString());
    doReturn(readerBuilder).when(readerBuilder).startMessageId(any());
    doReturn(readerBuilder).when(readerBuilder).readCompacted(anyBoolean());
    doReturn(mock(Reader.class)).when(readerBuilder).create();
    PulsarWorkerService workerService = mock(PulsarWorkerService.class);
    doReturn(pulsarClient).when(workerService).getClient();
    doReturn(mock(PulsarAdmin.class)).when(workerService).getFunctionAdmin();
    try (final MockedStatic<RuntimeFactory> runtimeFactoryMockedStatic = Mockito.mockStatic(RuntimeFactory.class)) {
        mockRuntimeFactory(runtimeFactoryMockedStatic);
        // test new assignment update functions
        FunctionRuntimeManager functionRuntimeManager = new FunctionRuntimeManager(workerConfig, workerService, mock(Namespace.class), mock(MembershipManager.class), mock(ConnectorsManager.class), mock(FunctionsManager.class), mock(FunctionMetaDataManager.class), mock(WorkerStatsManager.class), mock(ErrorNotifier.class));
        FunctionActioner functionActioner = spy(functionRuntimeManager.getFunctionActioner());
        doNothing().when(functionActioner).startFunction(any(FunctionRuntimeInfo.class));
        doNothing().when(functionActioner).stopFunction(any(FunctionRuntimeInfo.class));
        doNothing().when(functionActioner).terminateFunction(any(FunctionRuntimeInfo.class));
        functionRuntimeManager.setFunctionActioner(functionActioner);
        Function.FunctionMetaData function1 = Function.FunctionMetaData.newBuilder().setFunctionDetails(Function.FunctionDetails.newBuilder().setTenant("test-tenant").setNamespace("test-namespace").setName("func-1")).build();
        Function.FunctionMetaData function2 = Function.FunctionMetaData.newBuilder().setFunctionDetails(Function.FunctionDetails.newBuilder().setTenant("test-tenant").setNamespace("test-namespace").setName("func-2")).build();
        Function.Assignment assignment1 = Function.Assignment.newBuilder().setWorkerId("worker-1").setInstance(Function.Instance.newBuilder().setFunctionMetaData(function1).setInstanceId(0).build()).build();
        Function.Assignment assignment2 = Function.Assignment.newBuilder().setWorkerId("worker-2").setInstance(Function.Instance.newBuilder().setFunctionMetaData(function2).setInstanceId(0).build()).build();
        // add existing assignments
        functionRuntimeManager.setAssignment(assignment1);
        functionRuntimeManager.setAssignment(assignment2);
        reset(functionActioner);
        Function.Assignment assignment3 = Function.Assignment.newBuilder().setWorkerId("worker-1").setInstance(Function.Instance.newBuilder().setFunctionMetaData(function2).setInstanceId(0).build()).build();
        functionRuntimeManager.functionRuntimeInfos.put("test-tenant/test-namespace/func-1:0", new FunctionRuntimeInfo().setFunctionInstance(Function.Instance.newBuilder().setFunctionMetaData(function1).setInstanceId(0).build()));
        functionRuntimeManager.functionRuntimeInfos.put("test-tenant/test-namespace/func-2:0", new FunctionRuntimeInfo().setFunctionInstance(Function.Instance.newBuilder().setFunctionMetaData(function2).setInstanceId(0).build()));
        functionRuntimeManager.processAssignment(assignment1);
        functionRuntimeManager.processAssignment(assignment3);
        verify(functionActioner, times(1)).stopFunction(any(FunctionRuntimeInfo.class));
        // make sure terminate is not called since this is a update operation
        verify(functionActioner, times(0)).terminateFunction(any(FunctionRuntimeInfo.class));
        verify(functionActioner).stopFunction(argThat(functionRuntimeInfo -> functionRuntimeInfo.getFunctionInstance().getFunctionMetaData().equals(function2)));
        verify(functionActioner, times(1)).startFunction(any(FunctionRuntimeInfo.class));
        verify(functionActioner).startFunction(argThat(functionRuntimeInfo -> functionRuntimeInfo.getFunctionInstance().getFunctionMetaData().equals(function2)));
        assertEquals(functionRuntimeManager.functionRuntimeInfos.size(), 2);
        assertEquals(functionRuntimeManager.workerIdToAssignments.size(), 1);
        assertEquals(functionRuntimeManager.workerIdToAssignments.get("worker-1").get("test-tenant/test-namespace/func-1:0"), assignment1);
        assertEquals(functionRuntimeManager.workerIdToAssignments.get("worker-1").get("test-tenant/test-namespace/func-2:0"), assignment3);
        reset(functionActioner);
        // add a stop
        Function.FunctionMetaData.Builder function2StoppedBldr = function2.toBuilder();
        function2StoppedBldr.putInstanceStates(0, Function.FunctionState.STOPPED);
        Function.FunctionMetaData function2Stopped = function2StoppedBldr.build();
        Function.Assignment assignment4 = Function.Assignment.newBuilder().setWorkerId("worker-1").setInstance(Function.Instance.newBuilder().setFunctionMetaData(function2Stopped).setInstanceId(0).build()).build();
        functionRuntimeManager.processAssignment(assignment4);
        verify(functionActioner, times(1)).stopFunction(any(FunctionRuntimeInfo.class));
        // make sure terminate is not called since this is a update operation
        verify(functionActioner, times(0)).terminateFunction(any(FunctionRuntimeInfo.class));
        verify(functionActioner).stopFunction(argThat(functionRuntimeInfo -> functionRuntimeInfo.getFunctionInstance().getFunctionMetaData().equals(function2)));
        verify(functionActioner, times(0)).startFunction(any(FunctionRuntimeInfo.class));
        assertEquals(functionRuntimeManager.functionRuntimeInfos.size(), 2);
        assertEquals(functionRuntimeManager.workerIdToAssignments.size(), 1);
        assertEquals(functionRuntimeManager.workerIdToAssignments.get("worker-1").get("test-tenant/test-namespace/func-1:0"), assignment1);
        assertEquals(functionRuntimeManager.workerIdToAssignments.get("worker-1").get("test-tenant/test-namespace/func-2:0"), assignment4);
    }
}
Also used : ArgumentMatchers(org.mockito.ArgumentMatchers) KubernetesRuntimeFactoryConfig(org.apache.pulsar.functions.runtime.kubernetes.KubernetesRuntimeFactoryConfig) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) ObjectMapperFactory(org.apache.pulsar.common.util.ObjectMapperFactory) Test(org.testng.annotations.Test) Mockito.argThat(org.mockito.Mockito.argThat) Unpooled(io.netty.buffer.Unpooled) CALLS_REAL_METHODS(org.mockito.Mockito.CALLS_REAL_METHODS) MessageImpl(org.apache.pulsar.client.impl.MessageImpl) Mockito.anyBoolean(org.mockito.Mockito.anyBoolean) Map(java.util.Map) KubernetesRuntime(org.apache.pulsar.functions.runtime.kubernetes.KubernetesRuntime) ThreadRuntimeFactoryConfig(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig) WorkerInfo(org.apache.pulsar.common.functions.WorkerInfo) Mockito.doReturn(org.mockito.Mockito.doReturn) RuntimeFactory(org.apache.pulsar.functions.runtime.RuntimeFactory) MockedConstruction(org.mockito.MockedConstruction) Function(org.apache.pulsar.functions.proto.Function) Mockito.doNothing(org.mockito.Mockito.doNothing) Assert.assertNotNull(org.testng.Assert.assertNotNull) Sinks(org.apache.pulsar.client.admin.Sinks) MessageIdImpl(org.apache.pulsar.client.impl.MessageIdImpl) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) MockedStatic(org.mockito.MockedStatic) MessageMetadata(org.apache.pulsar.common.api.proto.MessageMetadata) KubernetesRuntimeFactory(org.apache.pulsar.functions.runtime.kubernetes.KubernetesRuntimeFactory) Mockito.withSettings(org.mockito.Mockito.withSettings) Mockito.any(org.mockito.Mockito.any) Mockito.mock(org.mockito.Mockito.mock) Assert.assertNull(org.testng.Assert.assertNull) Assert.assertEquals(org.testng.Assert.assertEquals) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) AuthenticationConfig(org.apache.pulsar.functions.instance.AuthenticationConfig) ProcessRuntimeFactory(org.apache.pulsar.functions.runtime.process.ProcessRuntimeFactory) PulsarAdmin(org.apache.pulsar.client.admin.PulsarAdmin) Message(org.apache.pulsar.client.api.Message) Mockito.spy(org.mockito.Mockito.spy) Answer(org.mockito.stubbing.Answer) InvocationOnMock(org.mockito.invocation.InvocationOnMock) ImmutableList(com.google.common.collect.ImmutableList) ThreadRuntimeFactory(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactory) LinkedList(java.util.LinkedList) Functions(org.apache.pulsar.client.admin.Functions) PulsarClient(org.apache.pulsar.client.api.PulsarClient) Mockito.anyString(org.mockito.Mockito.anyString) Iterator(java.util.Iterator) Sources(org.apache.pulsar.client.admin.Sources) Assert.fail(org.testng.Assert.fail) Reader(org.apache.pulsar.client.api.Reader) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) Namespace(org.apache.distributedlog.api.namespace.Namespace) Mockito(org.mockito.Mockito) MessageId(org.apache.pulsar.client.api.MessageId) SecretsProviderConfigurator(org.apache.pulsar.functions.secretsproviderconfigurator.SecretsProviderConfigurator) FunctionCommon(org.apache.pulsar.functions.utils.FunctionCommon) Assert.assertTrue(org.testng.Assert.assertTrue) ReaderBuilder(org.apache.pulsar.client.api.ReaderBuilder) Mockito.reset(org.mockito.Mockito.reset) ThreadRuntimeFactoryConfig(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig) Reader(org.apache.pulsar.client.api.Reader) ReaderBuilder(org.apache.pulsar.client.api.ReaderBuilder) Function(org.apache.pulsar.functions.proto.Function) PulsarClient(org.apache.pulsar.client.api.PulsarClient) PulsarAdmin(org.apache.pulsar.client.admin.PulsarAdmin) RuntimeFactory(org.apache.pulsar.functions.runtime.RuntimeFactory) KubernetesRuntimeFactory(org.apache.pulsar.functions.runtime.kubernetes.KubernetesRuntimeFactory) ProcessRuntimeFactory(org.apache.pulsar.functions.runtime.process.ProcessRuntimeFactory) ThreadRuntimeFactory(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactory) Namespace(org.apache.distributedlog.api.namespace.Namespace) ThreadRuntimeFactory(org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactory) Map(java.util.Map) HashMap(java.util.HashMap) Test(org.testng.annotations.Test)

Aggregations

Map (java.util.Map)71 ThreadRuntimeFactory (org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactory)71 ThreadRuntimeFactoryConfig (org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactoryConfig)71 PulsarAdmin (org.apache.pulsar.client.admin.PulsarAdmin)50 HashMap (java.util.HashMap)48 Test (org.testng.annotations.Test)47 Function (org.apache.pulsar.functions.proto.Function)44 PulsarClient (org.apache.pulsar.client.api.PulsarClient)36 Namespace (org.apache.distributedlog.api.namespace.Namespace)26 RuntimeFactory (org.apache.pulsar.functions.runtime.RuntimeFactory)26 CompletableFuture (java.util.concurrent.CompletableFuture)24 ReaderBuilder (org.apache.pulsar.client.api.ReaderBuilder)24 LinkedList (java.util.LinkedList)21 Message (org.apache.pulsar.client.api.Message)21 Reader (org.apache.pulsar.client.api.Reader)21 MessageImpl (org.apache.pulsar.client.impl.MessageImpl)21 MessageMetadata (org.apache.pulsar.common.api.proto.MessageMetadata)21 WorkerInfo (org.apache.pulsar.common.functions.WorkerInfo)21 InvocationOnMock (org.mockito.invocation.InvocationOnMock)21 MessageId (org.apache.pulsar.client.api.MessageId)18