Tabnine Logo
HystrixRequestVariable.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
com.netflix.hystrix.strategy.concurrency.HystrixRequestVariable

Best Java code snippets using com.netflix.hystrix.strategy.concurrency.HystrixRequestVariable.get (Showing top 2 results out of 315)

origin: PipelineAI/pipeline

@SuppressWarnings("unchecked")
public T get(HystrixConcurrencyStrategy concurrencyStrategy) {
  /*
   * 1) Fetch RequestVariable implementation from cache.
   * 2) If no implementation is found in cache then construct from factory.
   * 3) Cache implementation from factory as each object instance needs to be statically cached to be relevant across threads.
   */
  RVCacheKey key = new RVCacheKey(this, concurrencyStrategy);
  HystrixRequestVariable<?> rvInstance = requestVariableInstance.get(key);
  if (rvInstance == null) {
    requestVariableInstance.putIfAbsent(key, concurrencyStrategy.getRequestVariable(lifeCycleMethods));
    /*
     * A safety check to help debug problems if someone starts injecting dynamically created HystrixConcurrencyStrategy instances - which should not be done and has no good reason to be done.
     * 
     * The 100 value is arbitrary ... just a number far higher than we should see.
     */
    if (requestVariableInstance.size() > 100) {
      logger.warn("Over 100 instances of HystrixRequestVariable are being stored. This is likely the sign of a memory leak caused by using unique instances of HystrixConcurrencyStrategy instead of a single instance.");
    }
  }
  return (T) requestVariableInstance.get(key).get();
}
origin: com.netflix.hystrix/hystrix-core

@SuppressWarnings("unchecked")
public T get(HystrixConcurrencyStrategy concurrencyStrategy) {
  /*
   * 1) Fetch RequestVariable implementation from cache.
   * 2) If no implementation is found in cache then construct from factory.
   * 3) Cache implementation from factory as each object instance needs to be statically cached to be relevant across threads.
   */
  RVCacheKey key = new RVCacheKey(this, concurrencyStrategy);
  HystrixRequestVariable<?> rvInstance = requestVariableInstance.get(key);
  if (rvInstance == null) {
    requestVariableInstance.putIfAbsent(key, concurrencyStrategy.getRequestVariable(lifeCycleMethods));
    /*
     * A safety check to help debug problems if someone starts injecting dynamically created HystrixConcurrencyStrategy instances - which should not be done and has no good reason to be done.
     * 
     * The 100 value is arbitrary ... just a number far higher than we should see.
     */
    if (requestVariableInstance.size() > 100) {
      logger.warn("Over 100 instances of HystrixRequestVariable are being stored. This is likely the sign of a memory leak caused by using unique instances of HystrixConcurrencyStrategy instead of a single instance.");
    }
  }
  return (T) requestVariableInstance.get(key).get();
}
com.netflix.hystrix.strategy.concurrencyHystrixRequestVariableget

Javadoc

Retrieve current value or initialize and then return value for this variable for the current request scope.

Popular methods of HystrixRequestVariable

    Popular in Java

    • Parsing JSON documents to java classes using gson
    • getApplicationContext (Context)
    • setContentView (Activity)
    • getResourceAsStream (ClassLoader)
    • VirtualMachine (com.sun.tools.attach)
      A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
    • Runnable (java.lang)
      Represents a command that can be executed. Often used to run code in a different Thread.
    • Map (java.util)
      A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
    • TreeMap (java.util)
      Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
    • AtomicInteger (java.util.concurrent.atomic)
      An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
    • Project (org.apache.tools.ant)
      Central representation of an Ant project. This class defines an Ant project with all of its targets,
    • Top Sublime Text plugins
    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