com.groupbyinc.flux.indices.breaker.HierarchyCircuitBreakerService.class Maven / Gradle / Ivy
???? 4E Bcom/groupbyinc/flux/indices/breaker/HierarchyCircuitBreakerService 9com/groupbyinc/flux/indices/breaker/CircuitBreakerService #HierarchyCircuitBreakerService.java 6com/groupbyinc/flux/common/breaker/CircuitBreaker$Type 1com/groupbyinc/flux/common/breaker/CircuitBreaker Type java/util/Map$Entry
java/util/Map
Entry 4com/groupbyinc/flux/common/settings/Setting$Property +com/groupbyinc/flux/common/settings/Setting Property %java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup CHILD_LOGGER_PREFIX Ljava/lang/String; $com.groupbyinc.flux.indices.breaker. breakers $Ljava/util/concurrent/ConcurrentMap; kLjava/util/concurrent/ConcurrentMap; #TOTAL_CIRCUIT_BREAKER_LIMIT_SETTING -Lcom/groupbyinc/flux/common/settings/Setting; ^Lcom/groupbyinc/flux/common/settings/Setting; 'FIELDDATA_CIRCUIT_BREAKER_LIMIT_SETTING *FIELDDATA_CIRCUIT_BREAKER_OVERHEAD_SETTING ALcom/groupbyinc/flux/common/settings/Setting; &FIELDDATA_CIRCUIT_BREAKER_TYPE_SETTING gLcom/groupbyinc/flux/common/settings/Setting; %REQUEST_CIRCUIT_BREAKER_LIMIT_SETTING (REQUEST_CIRCUIT_BREAKER_OVERHEAD_SETTING $REQUEST_CIRCUIT_BREAKER_TYPE_SETTING (ACCOUNTING_CIRCUIT_BREAKER_LIMIT_SETTING +ACCOUNTING_CIRCUIT_BREAKER_OVERHEAD_SETTING 'ACCOUNTING_CIRCUIT_BREAKER_TYPE_SETTING 0IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_LIMIT_SETTING 3IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_OVERHEAD_SETTING /IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_TYPE_SETTING parentSettings 5Lcom/groupbyinc/flux/indices/breaker/BreakerSettings; fielddataSettings inFlightRequestsSettings requestSettings accountingSettings parentTripCount (Ljava/util/concurrent/atomic/AtomicLong; f(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/common/settings/ClusterSettings;)V 1(Lcom/groupbyinc/flux/common/settings/Settings;)V : <
= &java/util/concurrent/ConcurrentHashMap ? ()V : A
@ B D &java/util/concurrent/atomic/AtomicLong F (J)V : H
G I 8 9 K 3com/groupbyinc/flux/indices/breaker/BreakerSettings M fielddata O $ " Q get B(Lcom/groupbyinc/flux/common/settings/Settings;)Ljava/lang/Object; S T
U -com/groupbyinc/flux/common/unit/ByteSizeValue W getBytes ()J Y Z
X [ % " ] java/lang/Double _ doubleValue ()D a b
` c ' " e O(Ljava/lang/String;JDLcom/groupbyinc/flux/common/breaker/CircuitBreaker$Type;)V : g
N h 4 3 j in_flight_requests l / " n 0 " p 1 " r 5 3 t request v ) " x * " z + " | 6 3 ~
accounting ? , " ? - " ? . " ? 7 3 ? parent ? ! " ? PARENT 8Lcom/groupbyinc/flux/common/breaker/CircuitBreaker$Type; ? ? ? 2 3 ? logger !Lorg/apache/logging/log4j/Logger; ? ? ? org/apache/logging/log4j/Logger ? isTraceEnabled ()Z ? ? ? ? 'parent circuit breaker with settings {} ? trace '(Ljava/lang/String;Ljava/lang/Object;)V ? ? ? ? ,com/groupbyinc/flux/common/settings/Settings ? 3com/groupbyinc/flux/common/settings/ClusterSettings ? registerBreaker 8(Lcom/groupbyinc/flux/indices/breaker/BreakerSettings;)V ? ?
? "java/lang/invoke/LambdaMetafactory ? metafactory ?(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; ? ?
? ? ? (Ljava/lang/Object;)V ? setTotalCircuitBreakerLimit 2(Lcom/groupbyinc/flux/common/unit/ByteSizeValue;)V ? ?
? ? ? accept c(Lcom/groupbyinc/flux/indices/breaker/HierarchyCircuitBreakerService;)Ljava/util/function/Consumer; ? ? ? validateTotalCircuitBreakerLimit 2(Lcom/groupbyinc/flux/common/unit/ByteSizeValue;)Z ? ?
? ? ? addSettingsUpdateConsumer j(Lcom/groupbyinc/flux/common/settings/Setting;Ljava/util/function/Consumer;Ljava/util/function/Consumer;)V ? ?
? ? '(Ljava/lang/Object;Ljava/lang/Object;)V ? setFieldDataBreakerLimit D(Lcom/groupbyinc/flux/common/unit/ByteSizeValue;Ljava/lang/Double;)V ? ?
? ? ? e(Lcom/groupbyinc/flux/indices/breaker/HierarchyCircuitBreakerService;)Ljava/util/function/BiConsumer; ? ? ? |(Lcom/groupbyinc/flux/common/settings/Setting;Lcom/groupbyinc/flux/common/settings/Setting;Ljava/util/function/BiConsumer;)V ? ?
? ? setInFlightRequestsBreakerLimit ? ?
? ? ? setRequestBreakerLimit ? ?
? ? ? this DLcom/groupbyinc/flux/indices/breaker/HierarchyCircuitBreakerService; settings .Lcom/groupbyinc/flux/common/settings/Settings; clusterSettings 5Lcom/groupbyinc/flux/common/settings/ClusterSettings; getType :()Lcom/groupbyinc/flux/common/breaker/CircuitBreaker$Type; ? ?
N ? $Updated breaker settings request: {} ? info ? ? ? ?
newRequestMax /Lcom/groupbyinc/flux/common/unit/ByteSizeValue; newRequestOverhead Ljava/lang/Double; newRequestSettings 3Updated breaker settings for in-flight requests: {} ? newInFlightRequestsMax newInFlightRequestsOverhead newInFlightRequestsSettings getLimit ? Z
N ? getOverhead ? b
N ? valueOf (D)Ljava/lang/Double;
` 'Updated breaker settings field data: {} newFielddataMax newFielddataOverhead newFielddataLimitBytes J newFielddataSettings validateSettings 9([Lcom/groupbyinc/flux/indices/breaker/BreakerSettings;)V
byteSizeValue newParentSettings java/lang/IllegalStateException 6[Lcom/groupbyinc/flux/indices/breaker/BreakerSettings;???????? java/lang/StringBuilder
B Child breaker overhead append -(Ljava/lang/String;)Ljava/lang/StringBuilder;
-(Ljava/lang/Object;)Ljava/lang/StringBuilder;
! must be non-negative# toString ()Ljava/lang/String;%&
' (Ljava/lang/String;)V :)
*
childSettings childrenSettings
getBreaker G(Ljava/lang/String;)Lcom/groupbyinc/flux/common/breaker/CircuitBreaker; "java/util/concurrent/ConcurrentMap0 &(Ljava/lang/Object;)Ljava/lang/Object; S213 name stats >()Lcom/groupbyinc/flux/indices/breaker/AllCircuitBreakerStats; java/util/ArrayList8 size ()I:;1< (I)V :>
9? values ()Ljava/util/Collection;AB1C java/util/CollectionE iterator ()Ljava/util/Iterator;GHFI java/util/ListK java/util/IteratorM hasNextO ?NP next ()Ljava/lang/Object;RSNT getNameV& W M(Ljava/lang/String;)Lcom/groupbyinc/flux/indices/breaker/CircuitBreakerStats;6Y
Z add (Ljava/lang/Object;)Z\]L^ getUsed` Z a 7com/groupbyinc/flux/indices/breaker/CircuitBreakerStatsc S Z
Ge (Ljava/lang/String;JJDJ)V :g
dh :com/groupbyinc/flux/indices/breaker/AllCircuitBreakerStatsjL< toArray (([Ljava/lang/Object;)[Ljava/lang/Object;mnLo :[Lcom/groupbyinc/flux/indices/breaker/CircuitBreakerStats;q =([Lcom/groupbyinc/flux/indices/breaker/CircuitBreakerStats;)V :s
kt breaker 3Lcom/groupbyinc/flux/common/breaker/CircuitBreaker; parentEstimated allStats KLjava/util/List; Ljava/util/List; ? ? getTrippedCount~ Z checkParentLimit ;com/groupbyinc/flux/common/breaker/CircuitBreakingException? incrementAndGet? Z
G? #[parent] Data too large, data for [? ] would be [? (J)Ljava/lang/StringBuilder;?
? /?
X I &], which is larger than the limit of [? ]?
*
, usages [? , ? entrySet ()Ljava/util/Set;??1?
java/util/Set? stream ()Ljava/util/stream/Stream;????2 lambda$checkParentLimit$0 )(Ljava/util/Map$Entry;)Ljava/lang/String;??
??? apply ()Ljava/util/function/Function;?? ? java/util/stream/Stream? map 8(Ljava/util/function/Function;)Ljava/util/stream/Stream;???? java/util/stream/Collectors? toList ()Ljava/util/stream/Collector;??
?? collect 0(Ljava/util/stream/Collector;)Ljava/lang/Object;???? java/lang/Iterable? java/lang/String? join @(Ljava/lang/CharSequence;Ljava/lang/Iterable;)Ljava/lang/String;??
?? (Ljava/lang/String;JJ)V :?
?? message Ljava/lang/StringBuilder; label totalUsed parentLimit NOOP? ? ? 5com/groupbyinc/flux/common/breaker/NoopCircuitBreaker?
NW
?* put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;??1?