Codota Logo
co.cask.cdap.common.discovery
Code IndexAdd Codota to your IDE (free)

How to use co.cask.cdap.common.discovery

Best Java code snippets using co.cask.cdap.common.discovery (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: caskdata/cdap

@Override
protected Discoverable pick(ServiceDiscovered serviceDiscovered) {
 Discoverable lastPick = this.lastPick;
 if (lastPick == null || !isValid(lastPick, serviceDiscovered)) {
  this.lastPick = lastPick = picker.pick();
 }
 return lastPick;
}
origin: caskdata/cdap

public void addPayload(String key, String value) {
 payload.add(key, value);
}
origin: caskdata/cdap

@Override
protected Discoverable pick(ServiceDiscovered serviceDiscovered) {
 return pickRandom(serviceDiscovered);
}
origin: cdapio/cdap

private static void waitForService(DiscoveryServiceClient discoveryService, String discoverableName)
 throws InterruptedException {
 EndpointStrategy endpointStrategy = new RandomEndpointStrategy(() -> discoveryService.discover(discoverableName));
 Preconditions.checkNotNull(endpointStrategy.pick(5, TimeUnit.SECONDS),
               "%s service is not up after 5 seconds", discoverableName);
}
origin: caskdata/cdap

public StickyEndpointStrategy(Supplier<ServiceDiscovered> serviceDiscoveredSupplier) {
 super(serviceDiscoveredSupplier);
 this.picker = new RandomEndpointStrategy(serviceDiscoveredSupplier);
}
origin: cdapio/cdap

 @Override
 public Boolean call() throws Exception {
  return endpointStrategy.pick() == null;
 }
}, 5, TimeUnit.SECONDS, 100, TimeUnit.MILLISECONDS);
origin: caskdata/cdap

public static ResolvingDiscoverable of(Discoverable discoverable) {
 return new ResolvingDiscoverable(discoverable);
}
origin: co.cask.cdap/cdap-common

 @Override
 public void onChange(ServiceDiscovered serviceDiscovered) {
  // The serviceDiscovered provided is the same as the one in the field, hence ok to just call pick().
  Discoverable discoverable = pick();
  if (discoverable != null) {
   future.set(discoverable);
  }
 }
}, Threads.SAME_THREAD_EXECUTOR);
origin: cdapio/cdap

private static void waitForService(String service) {
 EndpointStrategy endpointStrategy = new RandomEndpointStrategy(() -> discoveryServiceClient.discover(service));
 Preconditions.checkNotNull(endpointStrategy.pick(5, TimeUnit.SECONDS),
               "%s service is not up after 5 seconds", service);
}
origin: co.cask.cdap/cdap-common

public StickyEndpointStrategy(ServiceDiscovered serviceDiscovered) {
 super(serviceDiscovered);
 this.picker = new RandomEndpointStrategy(serviceDiscovered);
}
origin: co.cask.cdap/cdap-common

@Override
public Discoverable pick() {
 Discoverable lastPick = this.lastPick;
 if (lastPick == null || !isValid(lastPick)) {
  this.lastPick = lastPick = picker.pick();
 }
 return lastPick;
}
origin: co.cask.cdap/cdap-common

public void addPayload(String key, String value) {
 payload.add(key, value);
}
origin: co.cask.cdap/cdap-common

public static ResolvingDiscoverable of(Discoverable discoverable) {
 return new ResolvingDiscoverable(discoverable);
}
origin: cdapio/cdap

private static void waitForService(String name) {
 EndpointStrategy endpointStrategy = new RandomEndpointStrategy(() -> discoveryService.discover(name));
 Preconditions.checkNotNull(endpointStrategy.pick(5, TimeUnit.SECONDS),
               "%s service is not up after 5 seconds", name);
}
origin: cdapio/cdap

 @Override
 public EndpointStrategy get() {
  return new RandomEndpointStrategy(() -> discoveryClient.discover(Service.EXPLORE_HTTP_USER_SERVICE));
 }
});
origin: caskdata/cdap

private static void waitForService(String service) {
 EndpointStrategy endpointStrategy = new RandomEndpointStrategy(() -> discoveryServiceClient.discover(service));
 Preconditions.checkNotNull(endpointStrategy.pick(5, TimeUnit.SECONDS),
               "%s service is not up after 5 seconds", service);
}
origin: co.cask.cdap/cdap-explore-client

 @Override
 public EndpointStrategy get() {
  return new RandomEndpointStrategy(discoveryClient.discover(Service.EXPLORE_HTTP_USER_SERVICE));
 }
});
origin: caskdata/cdap

 @Override
 public EndpointStrategy get() {
  return new RandomEndpointStrategy(() -> discoveryClient.discover(discoverableServiceName));
 }
});
origin: co.cask.cdap/cdap-common

 @Override
 public EndpointStrategy get() {
  return new RandomEndpointStrategy(discoveryClient.discover(discoverableServiceName));
 }
});
origin: cdapio/cdap

 @Override
 public EndpointStrategy get() {
  return new RandomEndpointStrategy(() -> discoveryServiceClient.discover(Constants.Service.APP_FABRIC_HTTP));
 }
});
co.cask.cdap.common.discovery

Most used classes

  • RandomEndpointStrategy
    Randomly picks endpoint from the list of available endpoints.
  • ResolvingDiscoverable
    Discoverable that resolves 0.0.0.0 to a routable interface.
  • EndpointStrategy
    This class helps picking up an endpoint from a list of Discoverable.
  • StickyEndpointStrategy
    An EndpointStrategy that will always return the same endpoint once it's picked until the endpoint is
  • AbstractEndpointStrategy
    An abstract EndpointStrategy that helps implementation of any strategy. It provides a default implem
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now