test_class.declarator: onMissingError = new Action1<CollapsedRequest<String, String>>() {
          @Override
          public void call(CollapsedRequest<String, String> collapsedReq) {
              collapsedReq.setException(new IllegalStateException("must have a value"));
          }
      }
test_class.modifier: private static
test_class.original_string: private static Action1<CollapsedRequest<String, String>> onMissingError = new Action1<CollapsedRequest<String, String>>() {
          @Override
          public void call(CollapsedRequest<String, String> collapsedReq) {
              collapsedReq.setException(new IllegalStateException("must have a value"));
          }
      };
test_class.type: Action1<CollapsedRequest<String, String>>
test_class.var_name: onMissingError
test_class.declarator: onMissingThrow = new Action1<CollapsedRequest<String, String>>() {
           @Override
           public void call(CollapsedRequest<String, String> collapsedReq) {
              throw new RuntimeException("synchronous error in onMissingResponse handler");
           }
       }
test_class.modifier: private static
test_class.original_string: private static Action1<CollapsedRequest<String, String>> onMissingThrow = new Action1<CollapsedRequest<String, String>>() {
           @Override
           public void call(CollapsedRequest<String, String> collapsedReq) {
              throw new RuntimeException("synchronous error in onMissingResponse handler");
           }
       };
test_class.type: Action1<CollapsedRequest<String, String>>
test_class.var_name: onMissingThrow
test_class.declarator: onMissingComplete = new Action1<CollapsedRequest<String, String>>() {
          @Override
          public void call(CollapsedRequest<String, String> collapsedReq) {
              collapsedReq.setComplete();
          }
      }
test_class.modifier: private static
test_class.original_string: private static Action1<CollapsedRequest<String, String>> onMissingComplete = new Action1<CollapsedRequest<String, String>>() {
          @Override
          public void call(CollapsedRequest<String, String> collapsedReq) {
              collapsedReq.setComplete();
          }
      };
test_class.type: Action1<CollapsedRequest<String, String>>
test_class.var_name: onMissingComplete
test_class.declarator: onMissingIgnore = new Action1<CollapsedRequest<String, String>>() {
          @Override
          public void call(CollapsedRequest<String, String> collapsedReq) {
              //do nothing
          }
      }
test_class.modifier: private static
test_class.original_string: private static Action1<CollapsedRequest<String, String>> onMissingIgnore = new Action1<CollapsedRequest<String, String>>() {
          @Override
          public void call(CollapsedRequest<String, String> collapsedReq) {
              //do nothing
          }
      };
test_class.type: Action1<CollapsedRequest<String, String>>
test_class.var_name: onMissingIgnore
test_class.declarator: onMissingFillIn = new Action1<CollapsedRequest<String, String>>() {
          @Override
          public void call(CollapsedRequest<String, String> collapsedReq) {
              collapsedReq.setResponse("fillin");
          }
      }
test_class.modifier: private static
test_class.original_string: private static Action1<CollapsedRequest<String, String>> onMissingFillIn = new Action1<CollapsedRequest<String, String>>() {
          @Override
          public void call(CollapsedRequest<String, String> collapsedReq) {
              collapsedReq.setResponse("fillin");
          }
      };
test_class.type: Action1<CollapsedRequest<String, String>>
test_class.var_name: onMissingFillIn
test_class.declarator: prefixMapper = new Func1<String, String>() {
  
          @Override
          public String call(String s) {
              return s.substring(0, s.indexOf(":"));
          }
  
      }
test_class.modifier: private static
test_class.original_string: private static Func1<String, String> prefixMapper = new Func1<String, String>() {
  
          @Override
          public String call(String s) {
              return s.substring(0, s.indexOf(":"));
          }
  
      };
test_class.type: Func1<String, String>
test_class.var_name: prefixMapper
test_class.declarator: map1To3And2To2 = new Func1<String, String>() {
          @Override
          public String call(String s) {
              String prefix = s.substring(0, s.indexOf(":"));
              if (prefix.equals("2")) {
                  return "2";
              } else {
                  return "3";
              }
          }
      }
test_class.modifier: private static
test_class.original_string: private static Func1<String, String> map1To3And2To2 = new Func1<String, String>() {
          @Override
          public String call(String s) {
              String prefix = s.substring(0, s.indexOf(":"));
              if (prefix.equals("2")) {
                  return "2";
              } else {
                  return "3";
              }
          }
      };
test_class.type: Func1<String, String>
test_class.var_name: map1To3And2To2
test_class.declarator: mapWithErrorOn1 = new Func1<String, String>() {
          @Override
          public String call(String s) {
              String prefix = s.substring(0, s.indexOf(":"));
              if (prefix.equals("1")) {
                  throw new RuntimeException("poorly implemented demultiplexer");
              } else {
                  return "2";
              }
          }
      }
test_class.modifier: private static
test_class.original_string: private static Func1<String, String> mapWithErrorOn1 = new Func1<String, String>() {
          @Override
          public String call(String s) {
              String prefix = s.substring(0, s.indexOf(":"));
              if (prefix.equals("1")) {
                  throw new RuntimeException("poorly implemented demultiplexer");
              } else {
                  return "2";
              }
          }
      };
test_class.type: Func1<String, String>
test_class.var_name: mapWithErrorOn1
test_class.declarator: ctx = new HystrixRequestContextRule()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public HystrixRequestContextRule ctx = new HystrixRequestContextRule();
test_class.type: HystrixRequestContextRule
test_class.var_name: ctx
test_class.declarator: threadPool = new ThreadPoolExecutor(100, 100, 10, TimeUnit.MINUTES, new SynchronousQueue<Runnable>())
test_class.modifier: private static
test_class.original_string: private static ExecutorService threadPool = new ThreadPoolExecutor(100, 100, 10, TimeUnit.MINUTES, new SynchronousQueue<Runnable>());
test_class.type: ExecutorService
test_class.var_name: threadPool
test_class.file: hystrix-core/src/test/java/com/netflix/hystrix/HystrixObservableCollapserTest.java
test_class.identifier: HystrixObservableCollapserTest
test_case.body: @Test
      public void testRequestThenTwoCacheHitsAllUnsubscribed() throws Exception {
          TestCollapserTimer timer = new TestCollapserTimer();
          HystrixObservableCollapser<String, String, String, String> collapser1 = new SuccessfulCacheableCollapsedCommand(timer, "foo", true);
          Observable<String> response1 = collapser1.observe();
          HystrixObservableCollapser<String, String, String, String> collapser2 = new SuccessfulCacheableCollapsedCommand(timer, "foo", true);
          Observable<String> response2 = collapser2.observe();
          HystrixObservableCollapser<String, String, String, String> collapser3 = new SuccessfulCacheableCollapsedCommand(timer, "foo", true);
          Observable<String> response3 = collapser3.observe();
  
          final CountDownLatch latch1 = new CountDownLatch(1);
          final CountDownLatch latch2 = new CountDownLatch(1);
          final CountDownLatch latch3 = new CountDownLatch(1);
  
  
          final AtomicReference<String> value1 = new AtomicReference<String>(null);
          final AtomicReference<String> value2 = new AtomicReference<String>(null);
          final AtomicReference<String> value3 = new AtomicReference<String>(null);
  
  
          Subscription s1 = response1
                  .doOnUnsubscribe(new Action0() {
                      @Override
                      public void call() {
                          System.out.println(System.currentTimeMillis() + " : s1 Unsubscribed!");
                          latch1.countDown();
                      }
                  })
                  .subscribe(new Subscriber<String>() {
                      @Override
                      public void onCompleted() {
                          System.out.println(System.currentTimeMillis() + " : s1 OnCompleted");
                          latch1.countDown();
                      }
  
                      @Override
                      public void onError(Throwable e) {
                          System.out.println(System.currentTimeMillis() + " : s1 OnError : " + e);
                          latch1.countDown();
                      }
  
                      @Override
                      public void onNext(String s) {
                          System.out.println(System.currentTimeMillis() + " : s1 OnNext : " + s);
                          value1.set(s);
                      }
                  });
  
          Subscription s2 = response2
                  .doOnUnsubscribe(new Action0() {
                      @Override
                      public void call() {
                          System.out.println(System.currentTimeMillis() + " : s2 Unsubscribed!");
                          latch2.countDown();
                      }
                  })
                  .subscribe(new Subscriber<String>() {
                      @Override
                      public void onCompleted() {
                          System.out.println(System.currentTimeMillis() + " : s2 OnCompleted");
                          latch2.countDown();
                      }
  
                      @Override
                      public void onError(Throwable e) {
                          System.out.println(System.currentTimeMillis() + " : s2 OnError : " + e);
                          latch2.countDown();
                      }
  
                      @Override
                      public void onNext(String s) {
                          System.out.println(System.currentTimeMillis() + " : s2 OnNext : " + s);
                          value2.set(s);
                      }
                  });
  
          Subscription s3 = response3
                  .doOnUnsubscribe(new Action0() {
                      @Override
                      public void call() {
                          System.out.println(System.currentTimeMillis() + " : s3 Unsubscribed!");
                          latch3.countDown();
                      }
                  })
                  .subscribe(new Subscriber<String>() {
                      @Override
                      public void onCompleted() {
                          System.out.println(System.currentTimeMillis() + " : s3 OnCompleted");
                          latch3.countDown();
                      }
  
                      @Override
                      public void onError(Throwable e) {
                          System.out.println(System.currentTimeMillis() + " : s3 OnError : " + e);
                          latch3.countDown();
                      }
  
                      @Override
                      public void onNext(String s) {
                          System.out.println(System.currentTimeMillis() + " : s3 OnNext : " + s);
                          value3.set(s);
                      }
                  });
  
          s1.unsubscribe();
          s2.unsubscribe();
          s3.unsubscribe();
  
          timer.incrementTime(10); // let time pass that equals the default delay/period
  
          assertTrue(latch1.await(1000, TimeUnit.MILLISECONDS));
          assertTrue(latch2.await(1000, TimeUnit.MILLISECONDS));
  
          assertNull(value1.get());
          assertNull(value2.get());
          assertNull(value3.get());
  
  
          System.out.println("ReqLog : " + HystrixRequestLog.getCurrentRequest().getExecutedCommandsAsString());
          assertEquals(0, HystrixRequestLog.getCurrentRequest().getAllExecutedCommands().size());
      }
test_case.class_method_signature: HystrixObservableCollapserTest.testRequestThenTwoCacheHitsAllUnsubscribed()
test_case.full_signature: @Test public void testRequestThenTwoCacheHitsAllUnsubscribed()
test_case.identifier: testRequestThenTwoCacheHitsAllUnsubscribed
test_case.invocations: observe observe observe subscribe doOnUnsubscribe println currentTimeMillis countDown println currentTimeMillis countDown println currentTimeMillis countDown println currentTimeMillis set subscribe doOnUnsubscribe println currentTimeMillis countDown println currentTimeMillis countDown println currentTimeMillis countDown println currentTimeMillis set subscribe doOnUnsubscribe println currentTimeMillis countDown println currentTimeMillis countDown println currentTimeMillis countDown println currentTimeMillis set unsubscribe unsubscribe unsubscribe incrementTime assertTrue await assertTrue await assertNull get assertNull get assertNull get println getExecutedCommandsAsString getCurrentRequest assertEquals size getAllExecutedCommands getCurrentRequest
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRequestThenTwoCacheHitsAllUnsubscribed()
focal_class.declarator: logger = LoggerFactory.getLogger(HystrixObservableCollapser.class)
focal_class.modifier: static final
focal_class.original_string: static final Logger logger = LoggerFactory.getLogger(HystrixObservableCollapser.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: collapserFactory
focal_class.modifier: private final
focal_class.original_string: private final RequestCollapserFactory<BatchReturnType, ResponseType, RequestArgumentType> collapserFactory;
focal_class.type: RequestCollapserFactory<BatchReturnType, ResponseType, RequestArgumentType>
focal_class.var_name: collapserFactory
focal_class.declarator: requestCache
focal_class.modifier: private final
focal_class.original_string: private final HystrixRequestCache requestCache;
focal_class.type: HystrixRequestCache
focal_class.var_name: requestCache
focal_class.declarator: collapserInstanceWrapper
focal_class.modifier: private final
focal_class.original_string: private final HystrixCollapserBridge<BatchReturnType, ResponseType, RequestArgumentType> collapserInstanceWrapper;
focal_class.type: HystrixCollapserBridge<BatchReturnType, ResponseType, RequestArgumentType>
focal_class.var_name: collapserInstanceWrapper
focal_class.declarator: metrics
focal_class.modifier: private final
focal_class.original_string: private final HystrixCollapserMetrics metrics;
focal_class.type: HystrixCollapserMetrics
focal_class.var_name: metrics
focal_class.declarator: defaultNameCache = new ConcurrentHashMap<Class<? extends HystrixObservableCollapser>, String>()
focal_class.modifier: @SuppressWarnings("rawtypes")
      private static
focal_class.original_string: @SuppressWarnings("rawtypes")
      private static ConcurrentHashMap<Class<? extends HystrixObservableCollapser>, String> defaultNameCache = new ConcurrentHashMap<Class<? extends HystrixObservableCollapser>, String>();
focal_class.type: ConcurrentHashMap<Class<? extends HystrixObservableCollapser>, String>
focal_class.var_name: defaultNameCache
focal_class.file: hystrix-core/src/main/java/com/netflix/hystrix/HystrixObservableCollapser.java
focal_class.identifier: HystrixObservableCollapser
focal_class.interfaces: implements HystrixObservable<ResponseType>
focal_class.class_method_signature: HystrixObservableCollapser.HystrixObservableCollapser()
focal_class.full_signature: protected  HystrixObservableCollapser()
focal_class.identifier: HystrixObservableCollapser
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.signature:  HystrixObservableCollapser()
focal_class.class_method_signature: HystrixObservableCollapser.HystrixObservableCollapser(HystrixCollapserKey collapserKey)
focal_class.full_signature: protected  HystrixObservableCollapser(HystrixCollapserKey collapserKey)
focal_class.identifier: HystrixObservableCollapser
focal_class.modifiers: protected
focal_class.parameters: (HystrixCollapserKey collapserKey)
focal_class.signature:  HystrixObservableCollapser(HystrixCollapserKey collapserKey)
focal_class.class_method_signature: HystrixObservableCollapser.HystrixObservableCollapser(Setter setter)
focal_class.full_signature: protected  HystrixObservableCollapser(Setter setter)
focal_class.identifier: HystrixObservableCollapser
focal_class.modifiers: protected
focal_class.parameters: (Setter setter)
focal_class.signature:  HystrixObservableCollapser(Setter setter)
focal_class.class_method_signature: HystrixObservableCollapser.HystrixObservableCollapser(HystrixCollapserKey collapserKey, Scope scope, CollapserTimer timer, HystrixCollapserProperties.Setter propertiesBuilder, HystrixCollapserMetrics metrics)
focal_class.full_signature:   HystrixObservableCollapser(HystrixCollapserKey collapserKey, Scope scope, CollapserTimer timer, HystrixCollapserProperties.Setter propertiesBuilder, HystrixCollapserMetrics metrics)
focal_class.identifier: HystrixObservableCollapser
focal_class.parameters: (HystrixCollapserKey collapserKey, Scope scope, CollapserTimer timer, HystrixCollapserProperties.Setter propertiesBuilder, HystrixCollapserMetrics metrics)
focal_class.signature:  HystrixObservableCollapser(HystrixCollapserKey collapserKey, Scope scope, CollapserTimer timer, HystrixCollapserProperties.Setter propertiesBuilder, HystrixCollapserMetrics metrics)
focal_class.class_method_signature: HystrixObservableCollapser.getExceptionFromThrowable(Throwable t)
focal_class.full_signature: protected Exception getExceptionFromThrowable(Throwable t)
focal_class.identifier: getExceptionFromThrowable
focal_class.modifiers: protected
focal_class.parameters: (Throwable t)
focal_class.return: Exception
focal_class.signature: Exception getExceptionFromThrowable(Throwable t)
focal_class.class_method_signature: HystrixObservableCollapser.getProperties()
focal_class.full_signature: private HystrixCollapserProperties getProperties()
focal_class.identifier: getProperties
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: HystrixCollapserProperties
focal_class.signature: HystrixCollapserProperties getProperties()
focal_class.class_method_signature: HystrixObservableCollapser.getCollapserKey()
focal_class.full_signature: public HystrixCollapserKey getCollapserKey()
focal_class.identifier: getCollapserKey
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: HystrixCollapserKey
focal_class.signature: HystrixCollapserKey getCollapserKey()
focal_class.class_method_signature: HystrixObservableCollapser.getScope()
focal_class.full_signature: public Scope getScope()
focal_class.identifier: getScope
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Scope
focal_class.signature: Scope getScope()
focal_class.class_method_signature: HystrixObservableCollapser.getMetrics()
focal_class.full_signature: public HystrixCollapserMetrics getMetrics()
focal_class.identifier: getMetrics
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: HystrixCollapserMetrics
focal_class.signature: HystrixCollapserMetrics getMetrics()
focal_class.class_method_signature: HystrixObservableCollapser.getRequestArgument()
focal_class.full_signature: public abstract RequestArgumentType getRequestArgument()
focal_class.identifier: getRequestArgument
focal_class.modifiers: public abstract
focal_class.parameters: ()
focal_class.return: RequestArgumentType
focal_class.signature: RequestArgumentType getRequestArgument()
focal_class.class_method_signature: HystrixObservableCollapser.createCommand(Collection<CollapsedRequest<ResponseType, RequestArgumentType>> requests)
focal_class.full_signature: protected abstract HystrixObservableCommand<BatchReturnType> createCommand(Collection<CollapsedRequest<ResponseType, RequestArgumentType>> requests)
focal_class.identifier: createCommand
focal_class.modifiers: protected abstract
focal_class.parameters: (Collection<CollapsedRequest<ResponseType, RequestArgumentType>> requests)
focal_class.return: HystrixObservableCommand<BatchReturnType>
focal_class.signature: HystrixObservableCommand<BatchReturnType> createCommand(Collection<CollapsedRequest<ResponseType, RequestArgumentType>> requests)
focal_class.class_method_signature: HystrixObservableCollapser.shardRequests(Collection<CollapsedRequest<ResponseType, RequestArgumentType>> requests)
focal_class.full_signature: protected Collection<Collection<CollapsedRequest<ResponseType, RequestArgumentType>>> shardRequests(Collection<CollapsedRequest<ResponseType, RequestArgumentType>> requests)
focal_class.identifier: shardRequests
focal_class.modifiers: protected
focal_class.parameters: (Collection<CollapsedRequest<ResponseType, RequestArgumentType>> requests)
focal_class.return: Collection<Collection<CollapsedRequest<ResponseType, RequestArgumentType>>>
focal_class.signature: Collection<Collection<CollapsedRequest<ResponseType, RequestArgumentType>>> shardRequests(Collection<CollapsedRequest<ResponseType, RequestArgumentType>> requests)
focal_class.class_method_signature: HystrixObservableCollapser.getBatchReturnTypeKeySelector()
focal_class.full_signature: protected abstract Func1<BatchReturnType, K> getBatchReturnTypeKeySelector()
focal_class.identifier: getBatchReturnTypeKeySelector
focal_class.modifiers: protected abstract
focal_class.parameters: ()
focal_class.return: Func1<BatchReturnType, K>
focal_class.signature: Func1<BatchReturnType, K> getBatchReturnTypeKeySelector()
focal_class.class_method_signature: HystrixObservableCollapser.getRequestArgumentKeySelector()
focal_class.full_signature: protected abstract Func1<RequestArgumentType, K> getRequestArgumentKeySelector()
focal_class.identifier: getRequestArgumentKeySelector
focal_class.modifiers: protected abstract
focal_class.parameters: ()
focal_class.return: Func1<RequestArgumentType, K>
focal_class.signature: Func1<RequestArgumentType, K> getRequestArgumentKeySelector()
focal_class.class_method_signature: HystrixObservableCollapser.onMissingResponse(CollapsedRequest<ResponseType, RequestArgumentType> r)
focal_class.full_signature: protected abstract void onMissingResponse(CollapsedRequest<ResponseType, RequestArgumentType> r)
focal_class.identifier: onMissingResponse
focal_class.modifiers: protected abstract
focal_class.parameters: (CollapsedRequest<ResponseType, RequestArgumentType> r)
focal_class.return: void
focal_class.signature: void onMissingResponse(CollapsedRequest<ResponseType, RequestArgumentType> r)
focal_class.class_method_signature: HystrixObservableCollapser.getBatchReturnTypeToResponseTypeMapper()
focal_class.full_signature: protected abstract Func1<BatchReturnType, ResponseType> getBatchReturnTypeToResponseTypeMapper()
focal_class.identifier: getBatchReturnTypeToResponseTypeMapper
focal_class.modifiers: protected abstract
focal_class.parameters: ()
focal_class.return: Func1<BatchReturnType, ResponseType>
focal_class.signature: Func1<BatchReturnType, ResponseType> getBatchReturnTypeToResponseTypeMapper()
focal_class.class_method_signature: HystrixObservableCollapser.observe()
focal_class.full_signature: public Observable<ResponseType> observe()
focal_class.identifier: observe
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Observable<ResponseType>
focal_class.signature: Observable<ResponseType> observe()
focal_class.class_method_signature: HystrixObservableCollapser.toObservable()
focal_class.full_signature: public Observable<ResponseType> toObservable()
focal_class.identifier: toObservable
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Observable<ResponseType>
focal_class.signature: Observable<ResponseType> toObservable()
focal_class.class_method_signature: HystrixObservableCollapser.toObservable(Scheduler observeOn)
focal_class.full_signature: public Observable<ResponseType> toObservable(Scheduler observeOn)
focal_class.identifier: toObservable
focal_class.modifiers: public
focal_class.parameters: (Scheduler observeOn)
focal_class.return: Observable<ResponseType>
focal_class.signature: Observable<ResponseType> toObservable(Scheduler observeOn)
focal_class.class_method_signature: HystrixObservableCollapser.getCacheKey()
focal_class.full_signature: protected String getCacheKey()
focal_class.identifier: getCacheKey
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getCacheKey()
focal_class.class_method_signature: HystrixObservableCollapser.reset()
focal_class.full_signature: static void reset()
focal_class.identifier: reset
focal_class.modifiers: static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void reset()
focal_class.class_method_signature: HystrixObservableCollapser.getDefaultNameFromClass(@SuppressWarnings("rawtypes") Class<? extends HystrixObservableCollapser> cls)
focal_class.full_signature: private static String getDefaultNameFromClass(@SuppressWarnings("rawtypes") Class<? extends HystrixObservableCollapser> cls)
focal_class.identifier: getDefaultNameFromClass
focal_class.modifiers: private static
focal_class.parameters: (@SuppressWarnings("rawtypes") Class<? extends HystrixObservableCollapser> cls)
focal_class.return: String
focal_class.signature: String getDefaultNameFromClass(@SuppressWarnings("rawtypes") Class<? extends HystrixObservableCollapser> cls)
focal_method.body: public Observable<ResponseType> observe() {
          // use a ReplaySubject to buffer the eagerly subscribed-to Observable
          ReplaySubject<ResponseType> subject = ReplaySubject.create();
          // eagerly kick off subscription
          final Subscription underlyingSubscription = toObservable().subscribe(subject);
          // return the subject that can be subscribed to later while the execution has already started
          return subject.doOnUnsubscribe(new Action0() {
              @Override
              public void call() {
                  underlyingSubscription.unsubscribe();
              }
          });
      }
focal_method.class_method_signature: HystrixObservableCollapser.observe()
focal_method.full_signature: public Observable<ResponseType> observe()
focal_method.identifier: observe
focal_method.invocations: create subscribe toObservable doOnUnsubscribe unsubscribe
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Observable<ResponseType>
focal_method.signature: Observable<ResponseType> observe()