Tabnine Logo
ServiceId.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
co.cask.cdap.proto.id.ServiceId
constructor

Best Java code snippets using co.cask.cdap.proto.id.ServiceId.<init> (Showing top 20 results out of 315)

origin: co.cask.cdap/cdap-proto

public ServiceId service(String program) {
 return new ServiceId(this, program);
}
origin: caskdata/cdap

public ServiceId service(String program) {
 return new ServiceId(this, program);
}
origin: cdapio/cdap

@Override
public ServiceManager getServiceManager(String serviceName) {
 ServiceId serviceId = new ServiceId(application, serviceName);
 return new RemoteServiceManager(serviceId, clientConfig, restClient, this);
}
origin: co.cask.cdap/cdap-cli

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
 Map<String, Integer> routeConfig = serviceClient.getRouteConfig(serviceId);
 output.printf(GSON.toJson(routeConfig));
}
origin: caskdata/cdap

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
 Map<String, Integer> routeConfig = serviceClient.getRouteConfig(serviceId);
 output.printf(GSON.toJson(routeConfig));
}
origin: caskdata/cdap

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
 serviceClient.checkAvailability(serviceId);
 output.println("Service is available to accept requests.");
}
origin: co.cask.cdap/cdap-cli

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
 serviceClient.checkAvailability(serviceId);
 output.println("Service is available to accept requests.");
}
origin: co.cask.cdap/cdap-test

/**
 * returns service related metrics
 * @param namespace
 * @param applicationId
 * @param serviceId
 * @return {@link co.cask.cdap.api.metrics.RuntimeMetrics}
 */
public RuntimeMetrics getServiceMetrics(String namespace, String applicationId, String serviceId) {
 ServiceId service = new ServiceId(namespace, applicationId, serviceId);
 return getMetrics(MetricsTags.service(service),
          Constants.Metrics.Name.Service.SERVICE_INPUT,
          Constants.Metrics.Name.Service.SERVICE_PROCESSED,
          Constants.Metrics.Name.Service.SERVICE_EXCEPTIONS);
}
origin: cdapio/cdap

/**
 * returns service related metrics
 * @param namespace
 * @param applicationId
 * @param serviceId
 * @return {@link co.cask.cdap.api.metrics.RuntimeMetrics}
 */
public RuntimeMetrics getServiceMetrics(String namespace, String applicationId, String serviceId) {
 ServiceId service = new ServiceId(namespace, applicationId, serviceId);
 return getMetrics(MetricsTags.service(service),
          Constants.Metrics.Name.Service.SERVICE_INPUT,
          Constants.Metrics.Name.Service.SERVICE_PROCESSED,
          Constants.Metrics.Name.Service.SERVICE_EXCEPTIONS);
}
origin: co.cask.cdap/cdap-proto

private ServiceId deserializeServiceId(JsonObject id) {
 ProgramId program = deserializeProgramId(id);
 return new ServiceId(program.getParent(), program.getProgram());
}
origin: caskdata/cdap

@Override
public ServiceId toEntityId() {
 return new ServiceId(super.getNamespaceId(), super.getApplicationId(), super.getId());
}
origin: caskdata/cdap

private ServiceId deserializeServiceId(JsonObject id) {
 ProgramId program = deserializeProgramId(id);
 return new ServiceId(program.getParent(), program.getProgram());
}
origin: co.cask.cdap/cdap-common

@Override
public ServiceId toEntityId() {
 return new ServiceId(super.getNamespaceId(), super.getApplicationId(), super.getId());
}
origin: co.cask.cdap/cdap-proto

private ServiceId deserializeServiceId(JsonObject id) {
 ProgramId program = deserializeProgramId(id);
 return new ServiceId(program.getParent(), program.getProgram());
}
origin: caskdata/cdap

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
 String appName = serviceId.getApplication();
 String serviceName = serviceId.getProgram();
 serviceClient.deleteRouteConfig(serviceId);
 output.printf("Successfully deleted route configuration of %s '%s' of application '%s'\n",
        ElementType.SERVICE.getName(), serviceName, appName);
}
origin: co.cask.cdap/cdap-cli

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
 String appName = serviceId.getApplication();
 String serviceName = serviceId.getProgram();
 serviceClient.deleteRouteConfig(serviceId);
 output.printf("Successfully deleted route configuration of %s '%s' of application '%s'\n",
        ElementType.SERVICE.getName(), serviceName, appName);
}
origin: caskdata/cdap

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
 String routeConfig = arguments.get(ArgumentName.ROUTE_CONFIG.getName());
 serviceClient.storeRouteConfig(serviceId, ArgumentParser.parseStringIntegerMap(
  routeConfig, ArgumentName.ROUTE_CONFIG.toString()));
 output.printf("Successfully set route configuration of %s '%s' of application '%s' to '%s'\n",
        ElementType.SERVICE.getName(), serviceId.getProgram(), serviceId.getApplication(), routeConfig);
}
origin: co.cask.cdap/cdap-cli

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
 String routeConfig = arguments.get(ArgumentName.ROUTE_CONFIG.getName());
 serviceClient.storeRouteConfig(serviceId, ArgumentParser.parseStringIntegerMap(
  routeConfig, ArgumentName.ROUTE_CONFIG.toString()));
 output.printf("Successfully set route configuration of %s '%s' of application '%s' to '%s'\n",
        ElementType.SERVICE.getName(), serviceId.getProgram(), serviceId.getApplication(), routeConfig);
}
origin: caskdata/cdap

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
 List<ServiceHttpEndpoint> endpoints = serviceClient.getEndpoints(serviceId);
 Table table = Table.builder()
  .setHeader("method", "path")
  .setRows(endpoints, new RowMaker<ServiceHttpEndpoint>() {
   @Override
   public List<?> makeRow(ServiceHttpEndpoint endpoint) {
    return Lists.newArrayList(endpoint.getMethod(), endpoint.getPath());
   }
  }).build();
 cliConfig.getTableRenderer().render(cliConfig, output, table);
}
origin: co.cask.cdap/cdap-cli

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
 List<ServiceHttpEndpoint> endpoints = serviceClient.getEndpoints(serviceId);
 Table table = Table.builder()
  .setHeader("method", "path")
  .setRows(endpoints, new RowMaker<ServiceHttpEndpoint>() {
   @Override
   public List<?> makeRow(ServiceHttpEndpoint endpoint) {
    return Lists.newArrayList(endpoint.getMethod(), endpoint.getPath());
   }
  }).build();
 cliConfig.getTableRenderer().render(cliConfig, output, table);
}
co.cask.cdap.proto.idServiceId<init>

Popular methods of ServiceId

  • getApplication
  • getProgram
  • getEntityName
  • getNamespace
  • getNamespaceId
  • getParent
  • getVersion
  • run
  • toMetadataEntity

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Option (scala)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now