Tabnine Logo
HystrixCircuitBreaker$Factory.reset
Code IndexAdd Tabnine to your IDE (free)

How to use
reset
method
in
com.netflix.hystrix.HystrixCircuitBreaker$Factory

Best Java code snippets using com.netflix.hystrix.HystrixCircuitBreaker$Factory.reset (Showing top 11 results out of 315)

origin: PipelineAI/pipeline

/**
 * Synchronous Observable and semaphore isolation. Only [Main] thread is involved in this.
 */
@Test
public void testTimeoutRequestContextWithSemaphoreIsolatedSynchronousObservable() {
  RequestContextTestResults results = testRequestContextOnTimeout(ExecutionIsolationStrategy.SEMAPHORE, Schedulers.immediate());
  assertTrue(results.isContextInitialized.get());
  assertTrue(results.originThread.get().equals(Thread.currentThread())); // all synchronous
  assertTrue(results.isContextInitializedObserveOn.get());
  assertTrue(results.observeOnThread.get().getName().startsWith("HystrixTimer")); // timeout schedules on HystrixTimer since the original thread was timed out
  // semaphore isolated
  assertFalse(results.command.isExecutedInThread());
  HystrixCircuitBreaker.Factory.reset();
}
origin: PipelineAI/pipeline

/**
 * Synchronous Observable and thread isolation. Work done on [hystrix-OWNER_ONE] thread and then observed on [HystrixTimer]
 */
@Test
public void testTimeoutWithFallbackRequestContextWithThreadIsolatedSynchronousObservable() {
  RequestContextTestResults results = testRequestContextOnTimeoutWithFallback(ExecutionIsolationStrategy.THREAD, Schedulers.immediate());
  assertTrue(results.isContextInitialized.get());
  assertTrue(results.originThread.get().getName().startsWith("HystrixTimer")); // timeout uses HystrixTimer thread for fallback
  assertTrue(results.isContextInitializedObserveOn.get());
  assertTrue(results.observeOnThread.get().getName().startsWith("HystrixTimer")); // fallback uses the timeout thread
  // thread isolated
  assertTrue(results.command.isExecutedInThread());
  HystrixCircuitBreaker.Factory.reset();
}
origin: PipelineAI/pipeline

/**
 * Synchronous Observable and semaphore isolation.
 */
@Test
public void testTimeoutWithFallbackRequestContextWithSemaphoreIsolatedSynchronousObservable() {
  RequestContextTestResults results = testRequestContextOnTimeoutWithFallback(ExecutionIsolationStrategy.SEMAPHORE, Schedulers.immediate());
  assertTrue(results.isContextInitialized.get());
  assertTrue(results.originThread.get().getName().startsWith("HystrixTimer")); // timeout uses HystrixTimer thread
  //(this use case is a little odd as it should generally not be the case that we are "timing out" a synchronous observable on semaphore isolation)
  assertTrue(results.isContextInitializedObserveOn.get());
  assertTrue(results.observeOnThread.get().getName().startsWith("HystrixTimer")); // timeout uses HystrixTimer thread
  // semaphore isolated
  assertFalse(results.command.isExecutedInThread());
  HystrixCircuitBreaker.Factory.reset();
}
origin: com.netflix.hystrix/hystrix-core

/**
 * Reset logic that doesn't have time/TimeUnit arguments.
 */
private static void _reset() {
  // clear metrics
  HystrixCommandMetrics.reset();
  HystrixThreadPoolMetrics.reset();
  HystrixCollapserMetrics.reset();
  // clear collapsers
  HystrixCollapser.reset();
  // clear circuit breakers
  HystrixCircuitBreaker.Factory.reset();
  HystrixPlugins.reset();
  HystrixPropertiesFactory.reset();
  currentCommand.set(new ConcurrentStack<HystrixCommandKey>());
}
origin: PipelineAI/pipeline

/**
 * Async Observable and thread isolation. User provided thread [RxNetThread] executes Observable and then [RxComputation] observes the onNext calls.
 *
 * NOTE: RequestContext will NOT exist on that thread.
 *
 * An async Observable running on its own thread will not have access to the request context unless the user manages the context.
 */
@Test
public void testTimeoutWithFallbackRequestContextWithThreadIsolatedAsynchronousObservable() {
  RequestContextTestResults results = testRequestContextOnTimeoutWithFallback(ExecutionIsolationStrategy.THREAD, Schedulers.newThread());
  assertFalse(results.isContextInitialized.get()); // it won't have request context as it's on a user provided thread/scheduler
  assertTrue(results.originThread.get().getName().startsWith("RxNewThread")); // the user provided thread/scheduler
  assertTrue(results.isContextInitializedObserveOn.get()); // the timeout captures the context so it exists
  assertTrue(results.observeOnThread.get().getName().startsWith("RxNewThread")); // the user provided thread/scheduler
  // thread isolated
  assertTrue(results.command.isExecutedInThread());
  HystrixCircuitBreaker.Factory.reset();
}
origin: PipelineAI/pipeline

/**
 * Async Observable and semaphore isolation. User provided thread [RxNewThread] does everything.
 *
 * NOTE: RequestContext will NOT exist on that thread.
 *
 * An async Observable running on its own thread will not have access to the request context unless the user manages the context.
 */
@Test
public void testTimeoutWithFallbackRequestContextWithSemaphoreIsolatedAsynchronousObservable() {
  RequestContextTestResults results = testRequestContextOnTimeoutWithFallback(ExecutionIsolationStrategy.SEMAPHORE, Schedulers.newThread());
  assertFalse(results.isContextInitialized.get()); // it won't have request context as it's on a user provided thread/scheduler
  assertTrue(results.originThread.get().getName().startsWith("RxNewThread")); // the user provided thread/scheduler
  assertTrue(results.isContextInitializedObserveOn.get()); // the timeout captures the context so it exists
  assertTrue(results.observeOnThread.get().getName().startsWith("RxNewThread")); // the user provided thread/scheduler
  // semaphore isolated
  assertFalse(results.command.isExecutedInThread());
  HystrixCircuitBreaker.Factory.reset();
}
origin: PipelineAI/pipeline

/**
 * Async Observable and semaphore isolation. User provided thread [RxNewThread] does everything.
 *
 * NOTE: RequestContext will NOT exist on that thread.
 *
 * An async Observable running on its own thread will not have access to the request context unless the user manages the context.
 */
@Test
public void testTimeoutRequestContextWithSemaphoreIsolatedAsynchronousObservable() {
  RequestContextTestResults results = testRequestContextOnTimeout(ExecutionIsolationStrategy.SEMAPHORE, Schedulers.newThread());
  assertFalse(results.isContextInitialized.get()); // it won't have request context as it's on a user provided thread/scheduler
  assertTrue(results.originThread.get().getName().startsWith("RxNewThread")); // the user provided thread/scheduler
  assertTrue(results.isContextInitializedObserveOn.get()); // the timeout captures the context so it exists
  assertTrue(results.observeOnThread.get().getName().startsWith("HystrixTimer")); // timeout schedules on HystrixTimer since the original thread was timed out
  // semaphore isolated
  assertFalse(results.command.isExecutedInThread());
  HystrixCircuitBreaker.Factory.reset();
}
origin: PipelineAI/pipeline

/**
 * Async Observable and semaphore isolation WITH functioning RequestContext
 *
 * Use HystrixContextScheduler to make the user provided scheduler capture context.
 */
@Test
public void testTimeoutWithFallbackRequestContextWithSemaphoreIsolatedAsynchronousObservableAndCapturedContextScheduler() {
  RequestContextTestResults results = testRequestContextOnTimeoutWithFallback(ExecutionIsolationStrategy.SEMAPHORE, new HystrixContextScheduler(Schedulers.newThread()));
  assertTrue(results.isContextInitialized.get()); // the user scheduler captures context
  assertTrue(results.originThread.get().getName().startsWith("RxNewThread")); // the user provided thread/scheduler
  assertTrue(results.isContextInitializedObserveOn.get()); // the user scheduler captures context
  assertTrue(results.observeOnThread.get().getName().startsWith("RxNewThread")); // the user provided thread/scheduler
  // semaphore isolated
  assertFalse(results.command.isExecutedInThread());
  HystrixCircuitBreaker.Factory.reset();
}
origin: PipelineAI/pipeline

/**
 * Reset logic that doesn't have time/TimeUnit arguments.
 */
private static void _reset() {
  // clear metrics
  HystrixCommandMetrics.reset();
  HystrixThreadPoolMetrics.reset();
  HystrixCollapserMetrics.reset();
  // clear collapsers
  HystrixCollapser.reset();
  // clear circuit breakers
  HystrixCircuitBreaker.Factory.reset();
  HystrixPlugins.reset();
  HystrixPropertiesFactory.reset();
  currentCommand.set(new ConcurrentStack<HystrixCommandKey>());
}
origin: PipelineAI/pipeline

/**
 * Async Observable and semaphore isolation WITH functioning RequestContext
 *
 * Use HystrixContextScheduler to make the user provided scheduler capture context.
 */
@Test
public void testTimeoutRequestContextWithSemaphoreIsolatedAsynchronousObservableAndCapturedContextScheduler() {
  RequestContextTestResults results = testRequestContextOnTimeout(ExecutionIsolationStrategy.SEMAPHORE, new HystrixContextScheduler(Schedulers.newThread()));
  assertTrue(results.isContextInitialized.get()); // the user scheduler captures context
  assertTrue(results.originThread.get().getName().startsWith("RxNewThread")); // the user provided thread/scheduler
  assertTrue(results.isContextInitializedObserveOn.get()); // the user scheduler captures context
  assertTrue(results.observeOnThread.get().getName().startsWith("HystrixTimer")); // timeout schedules on HystrixTimer since the original thread was timed out
  // semaphore isolated
  assertFalse(results.command.isExecutedInThread());
  HystrixCircuitBreaker.Factory.reset();
}
origin: PipelineAI/pipeline

@Before
public void init() {
  for (HystrixCommandMetrics metricsInstance: HystrixCommandMetrics.getInstances()) {
    metricsInstance.resetStream();
  }
  HystrixCommandMetrics.reset();
  HystrixCircuitBreaker.Factory.reset();
  Hystrix.reset();
}
com.netflix.hystrixHystrixCircuitBreaker$Factoryreset

Javadoc

Clears all circuit breakers. If new requests come in instances will be recreated.

Popular methods of HystrixCircuitBreaker$Factory

  • getInstance
    Get the HystrixCircuitBreaker instance for a given HystrixCommandKey. This is thread-safe and ensure

Popular in Java

  • Making http post requests using okhttp
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • BoxLayout (javax.swing)
  • JComboBox (javax.swing)
  • CodeWhisperer alternatives
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