Tabnine Logo
DynomiteClientDelegate
Code IndexAdd Tabnine to your IDE (free)

How to use
DynomiteClientDelegate
in
com.netflix.spinnaker.kork.dynomite

Best Java code snippets using com.netflix.spinnaker.kork.dynomite.DynomiteClientDelegate (Showing top 3 results out of 315)

origin: com.netflix.spinnaker.clouddriver/cats-dynomite

private void releaseRunKey(String agentType, long when) {
 final long newTtl = when - System.currentTimeMillis();
 final boolean delete = newTtl < 2500L;
 redisClientDelegate.withCommandsClient(client -> {
  if (delete) {
   deleteLock(client, agentType);
  } else {
   ttlLock(client, agentType, newTtl);
  }
 });
}
origin: com.netflix.spinnaker.kork/kork-dynomite

@Override
public DynomiteClientDelegate build(String name, Map<String, Object> properties) {
 DynomiteDriverProperties props = convertSpringProperties(properties);
 return new DynomiteClientDelegate(
  name,
  new DynomiteClientFactory()
   .properties(props)
   .discoveryClient(discoveryClient)
   .build()
 );
}
origin: com.netflix.spinnaker.clouddriver/cats-dynomite

private boolean acquireRunKey(String agentType, long timeout) {
 // This isn't as safe as the vanilla Redis impl because the call isn't atomic, but it's the best we can do until
 // dynomite adds support for `String set(String key, String value, String nxxx, String expx, long time)` (which
 // they are working on).
 String identity = nodeIdentity.getNodeIdentity();
 return redisClientDelegate.withCommandsClient(client -> {
  return Failsafe
   .with(ACQUIRE_LOCK_RETRY_POLICY)
   .get(() -> {
    String response = client.get(agentType);
    if (response == null && client.setnx(agentType, identity) == 1) {
     client.pexpireAt(agentType, System.currentTimeMillis() + timeout);
     return true;
    }
    if (client.ttl(agentType) == -1) {
     log.warn("Detected potential deadlocked agent, removing lock key: " + agentType);
     client.del(agentType);
    }
    return false;
   });
 });
}
com.netflix.spinnaker.kork.dynomiteDynomiteClientDelegate

Most used methods

  • <init>
  • withCommandsClient

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Top 12 Jupyter Notebook extensions
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