public RemoteWorkerManager(ProgramId programId, ClientConfig clientConfig, RESTClient restClient, RemoteApplicationManager applicationManager) { super(programId, applicationManager); this.workerId = programId; this.programClient = new ProgramClient(clientConfig, restClient); }
public RemoteApplicationManager(ApplicationId application, ClientConfig clientConfig, RESTClient restClient) { super(application); this.clientConfig = clientConfig; this.programClient = new ProgramClient(clientConfig, restClient); this.applicationClient = new ApplicationClient(clientConfig, restClient); this.restClient = restClient; }
public RemoteServiceManager(ServiceId serviceId, ClientConfig clientConfig, RESTClient restClient, RemoteApplicationManager remoteApplicationManager) { super(serviceId, remoteApplicationManager); this.serviceId = serviceId; this.metricsClient = new MetricsClient(clientConfig, restClient); this.programClient = new ProgramClient(clientConfig, restClient); this.serviceClient = new ServiceClient(clientConfig, restClient); }
@SuppressWarnings("unused") protected ProgramClient getProgramClient() { return new ProgramClient(getClientConfig(), getRestClient()); }
public IntegrationTestManager(ClientConfig clientConfig, RESTClient restClient, File tmpFolder) { this.clientConfig = clientConfig; this.restClient = restClient; this.tmpFolder = tmpFolder; this.locationFactory = new LocalLocationFactory(tmpFolder); this.applicationClient = new ApplicationClient(clientConfig, restClient); this.artifactClient = new ArtifactClient(clientConfig, restClient); this.datasetClient = new DatasetClient(clientConfig, restClient); this.datasetModuleClient = new DatasetModuleClient(clientConfig, restClient); this.namespaceClient = new NamespaceClient(clientConfig, restClient); this.programClient = new ProgramClient(clientConfig, restClient); this.scheduleClient = new ScheduleClient(clientConfig, restClient); }
public void programClient() throws Exception { // Construct the client used to interact with CDAP ProgramClient programClient = new ProgramClient(clientConfig); // Start a service in the WordCount example programClient.start(NamespaceId.DEFAULT.app("WordCount").service("RetrieveCounts")); // Fetch live information from the HelloWorld example // Live info includes the address of an component’s container host and the container’s debug port, // formatted in JSON programClient.getLiveInfo(NamespaceId.DEFAULT.app("HelloWorld").service("greet")); // Fetch program logs in the WordCount example programClient.getProgramLogs(NamespaceId.DEFAULT.app("WordCount").service("RetrieveCounts"), 0, Long.MAX_VALUE); // Scale a service in the HelloWorld example programClient.setServiceInstances(NamespaceId.DEFAULT.app("HelloWorld").service("greet"), 3); // Stop a service in the HelloWorld example programClient.stop(NamespaceId.DEFAULT.app("HelloWorld").service("greet")); }