
com.groupbyinc.flux.cluster.routing.allocation.decider.DiskThresholdDecider.class Maven / Gradle / Ivy
???? 3h Kcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider Hcom/groupbyinc/flux/cluster/routing/allocation/decider/AllocationDecider DiskThresholdDecider.java Xcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider$DiskListener DiskListener Ycom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider$ApplySettings
ApplySettings >com/groupbyinc/flux/node/settings/NodeSettingsService$Listener 5com/groupbyinc/flux/node/settings/NodeSettingsService Listener 7com/groupbyinc/flux/cluster/ClusterInfoService$Listener .com/groupbyinc/flux/cluster/ClusterInfoService NAME Ljava/lang/String; disk_threshold freeDiskThresholdLow Ljava/lang/Double; freeDiskThresholdHigh freeBytesThresholdLow /Lcom/groupbyinc/flux/common/unit/ByteSizeValue; freeBytesThresholdHigh includeRelocations Z enabled rerouteInterval +Lcom/groupbyinc/flux/common/unit/TimeValue; 1CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED 1cluster.routing.allocation.disk.threshold_enabled % -CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK -cluster.routing.allocation.disk.watermark.low ( .CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK .cluster.routing.allocation.disk.watermark.high + .CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS 3cluster.routing.allocation.disk.include_relocations . +CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL 0cluster.routing.allocation.disk.reroute_interval 1 1(Lcom/groupbyinc/flux/common/settings/Settings;)V 3 4
5 3com/groupbyinc/flux/cluster/EmptyClusterInfoService 7 INSTANCE 5Lcom/groupbyinc/flux/cluster/EmptyClusterInfoService; 9 : 8 ; ?(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/node/settings/NodeSettingsService;Lcom/groupbyinc/flux/cluster/ClusterInfoService;Lcom/groupbyinc/flux/client/Client;)V 3 =
> this MLcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider; settings .Lcom/groupbyinc/flux/common/settings/Settings; *Lcom/groupbyinc/flux/common/inject/Inject;
5 85% F ,com/groupbyinc/flux/common/settings/Settings H get 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; J K
I L 90% N validWatermarkSetting '(Ljava/lang/String;Ljava/lang/String;)Z P Q
R /com/groupbyinc/flux/ElasticsearchParseException T "unable to parse low watermark [{}] V java/lang/Object X ((Ljava/lang/String;[Ljava/lang/Object;)V 3 Z
U [ !com/groupbyinc/flux/client/Client ] java/lang/String _ #unable to parse high watermark [{}] a@Y thresholdPercentageFromWatermark (Ljava/lang/String;)D e f
g java/lang/Double i valueOf (D)Ljava/lang/Double; k l
j m o q thresholdBytesFromWatermark U(Ljava/lang/String;Ljava/lang/String;)Lcom/groupbyinc/flux/common/unit/ByteSizeValue; s t
u w y java/lang/Boolean { (Z)Ljava/lang/Boolean; k }
| ~ getAsBoolean :(Ljava/lang/String;Ljava/lang/Boolean;)Ljava/lang/Boolean; ? ?
I ? booleanValue ()Z ? ?
| ? ? < )com/groupbyinc/flux/common/unit/TimeValue ? timeValueSeconds .(J)Lcom/groupbyinc/flux/common/unit/TimeValue; ? ?
? ? getAsTime j(Ljava/lang/String;Lcom/groupbyinc/flux/common/unit/TimeValue;)Lcom/groupbyinc/flux/common/unit/TimeValue; ? ?
I ? " # ? ! ? P(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;)V 3 ?
? addListener C(Lcom/groupbyinc/flux/node/settings/NodeSettingsService$Listener;)V ? ?
? s(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;Lcom/groupbyinc/flux/client/Client;)V 3 ?
? <(Lcom/groupbyinc/flux/cluster/ClusterInfoService$Listener;)V ? ? ? nodeSettingsService 7Lcom/groupbyinc/flux/node/settings/NodeSettingsService; infoService 0Lcom/groupbyinc/flux/cluster/ClusterInfoService; client #Lcom/groupbyinc/flux/client/Client; lowWatermark
highWatermark newApplySettings ]()Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider$ApplySettings; getFreeDiskThresholdLow ()Ljava/lang/Double; getFreeDiskThresholdHigh getUsedDiskThresholdLow doubleValue ()D ? ?
j ? getUsedDiskThresholdHigh getFreeBytesThresholdLow 1()Lcom/groupbyinc/flux/common/unit/ByteSizeValue; getFreeBytesThresholdHigh isIncludeRelocations isEnabled getRerouteInterval -()Lcom/groupbyinc/flux/common/unit/TimeValue; sizeOfRelocatingShards p(Lcom/groupbyinc/flux/cluster/routing/RoutingNode;Lcom/groupbyinc/flux/cluster/ClusterInfo;ZLjava/lang/String;)J 5com/groupbyinc/flux/cluster/routing/ShardRoutingState ?
RELOCATING 7Lcom/groupbyinc/flux/cluster/routing/ShardRoutingState; ? ? ? ? INITIALIZING ? ? ? ? /com/groupbyinc/flux/cluster/routing/RoutingNode ? shardsWithState J([Lcom/groupbyinc/flux/cluster/routing/ShardRoutingState;)Ljava/util/List; ? ?
? ? java/util/List ? iterator ()Ljava/util/Iterator; ? ? ? ? java/util/Iterator ? hasNext ? ? ? ? next ()Ljava/lang/Object; ? ? ? ? 0com/groupbyinc/flux/cluster/routing/ShardRouting ? 'com/groupbyinc/flux/cluster/ClusterInfo ? getDataPath F(Lcom/groupbyinc/flux/cluster/routing/ShardRouting;)Ljava/lang/String; ? ?
? ? equals (Ljava/lang/Object;)Z ? ?
` ? initializing ? ?
? ? relocatingNodeId ()Ljava/lang/String; ? ?
? ? getShardSize ^(Lcom/groupbyinc/flux/cluster/routing/ShardRouting;Lcom/groupbyinc/flux/cluster/ClusterInfo;)J ? ?
?
relocating ? ?
? ?
actualPath routing 2Lcom/groupbyinc/flux/cluster/routing/ShardRouting; node 1Lcom/groupbyinc/flux/cluster/routing/RoutingNode; clusterInfo )Lcom/groupbyinc/flux/cluster/ClusterInfo; subtractShardsMovingAway dataPath totalSize J D(Lcom/groupbyinc/flux/cluster/routing/ShardRouting;)Ljava/lang/Long; ?
? java/lang/Long longValue ()J
shardSize Ljava/lang/Long; canAllocate ?(Lcom/groupbyinc/flux/cluster/routing/ShardRouting;Lcom/groupbyinc/flux/cluster/routing/RoutingNode;Lcom/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation;)Lcom/groupbyinc/flux/cluster/routing/allocation/decider/Decision; @com/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation +()Lcom/groupbyinc/flux/cluster/ClusterInfo;
getNodeMostAvailableDiskUsages ()Ljava/util/Map;
? earlyTerminate ?(Lcom/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation;Ljava/util/Map;)Lcom/groupbyinc/flux/cluster/routing/allocation/decider/Decision;
java/util/Map ?com/groupbyinc/flux/cluster/routing/allocation/decider/Decision" getDiskUsage ?(Lcom/groupbyinc/flux/cluster/routing/RoutingNode;Lcom/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation;Ljava/util/Map;)Lcom/groupbyinc/flux/cluster/DiskUsage;$%
& %com/groupbyinc/flux/cluster/DiskUsage( getFreeDiskAsPercentage* ?
)+ getUsedDiskAsPercentage- ?
). getFreeBytes0
)1 logger -Lcom/groupbyinc/flux/common/logging/ESLogger;34 5 +com/groupbyinc/flux/common/logging/ESLogger7 isTraceEnabled9 ?8: node [{}] has {}% used disk< nodeId> ?
?? traceA Z8B primaryD ?
?E allocatedPostIndexCreateG ?
?H -com/groupbyinc/flux/common/unit/ByteSizeValueJ bytesL
KM isDebugEnabledO ?8P `less than the required {} free bytes threshold ({} bytes free) on node {}, preventing allocationR (J)Ljava/lang/Long; kT
U debugW Z8X NO ALcom/groupbyinc/flux/cluster/routing/allocation/decider/Decision;Z[ #\ 0less than required [%s] free on node, free: [%s]^ (J)V 3`
Ka decision ?(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/Decision;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Lcom/groupbyinc/flux/cluster/routing/allocation/decider/Decision;cd
e ?less than the required {} free bytes threshold ({} bytes free) on node {}, but allowing allocation because primary has never been allocatedg YESi[ #j 'primary has never been allocated beforel ?less than the required {} free bytes threshold ({} bytes free) on node {}, preventing allocation even though primary has never been allocatedn Zmore than the allowed {} used disk threshold ({} used) on node [{}], preventing allocationp %r "com/groupbyinc/flux/common/Stringst format1Decimals '(DLjava/lang/String;)Ljava/lang/String;vw
ux 8more than allowed [%s%%] used disk on node, free: [%s%%]z ?more than the allowed {} used disk threshold ({} used) on node [{}], but allowing allocation because primary has never been allocated| $freeDiskPercentageAfterShardAssigned :(Lcom/groupbyinc/flux/cluster/DiskUsage;Ljava/lang/Long;)D~
? |after allocating, node [{}] would have less than the required {} free bytes threshold ({} bytes free), preventing allocation? warn? Z8? Aafter allocation less than required [%s] free on node, free: [%s]? tafter allocating, node [{}] would have more than the allowed {} free disk threshold ({} free), preventing allocation? Iafter allocation more than allowed [%s%%] used disk on node, free: [%s%%]? )enough disk for shard on node, free: [%s]? shardRouting
allocation BLcom/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation; usages JLjava/util/Map; Ljava/util/Map; usedDiskThresholdLow D usedDiskThresholdHigh usage 'Lcom/groupbyinc/flux/cluster/DiskUsage; freeDiskPercentage usedDiskPercentage freeBytes primaryHasBeenAllocated freeSpaceAfterShard freeBytesAfterShard canRemain
currentNodeId? ?
?? "java/lang/IllegalArgumentException? java/lang/StringBuilder? ()V 3?
?? Shard [? append -(Ljava/lang/String;)Ljava/lang/StringBuilder;??
?? -(Ljava/lang/Object;)Ljava/lang/StringBuilder;??
?? ] is not allocated on node: [? ]? toString? ?
?? (Ljava/lang/String;)V 3?
?? getNodeLeastAvailableDiskUsages?
?? &node [{}] has {}% free disk ({} bytes)? getPath? ?
)? 0shard is not allocated on the most utilized disk? ^less than the required {} free bytes threshold ({} bytes free) on node {}, shard cannot remain? Yless than the required {}% free disk threshold ({}% free) on node {}, shard cannot remain? Jafter allocation less than required [%s%%] free disk on node, free: [%s%%]? 3enough disk for shard to remain on node, free: [%s]? &(Ljava/lang/Object;)Ljava/lang/Object; J?!? averageUsage i(Lcom/groupbyinc/flux/cluster/routing/RoutingNode;Ljava/util/Map;)Lcom/groupbyinc/flux/cluster/DiskUsage;??
? iunable to determine disk usage for {}, defaulting to average across nodes [{} total] [{} free] [{}% free]?
getTotalBytes?
)? ? ?
? 2()Lcom/groupbyinc/flux/cluster/node/DiscoveryNode; ??
?? .com/groupbyinc/flux/cluster/node/DiscoveryNode? name? ?
?? ;(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JJ)V 3?
)? usage without relocations: {}? %usage with relocations: [{} bytes] {}? relocatingShardsSize usageIncludingRelocations size ()I??!? _na_? values ()Ljava/util/Collection;??!? java/util/Collection?? ? du
totalBytes getNodeId? ?
)? getNodeName ?
) newUsage *com/groupbyinc/flux/common/unit/RatioValue parseRatioValue @(Ljava/lang/String;)Lcom/groupbyinc/flux/common/unit/RatioValue;
getAsPercent ?
ex 1Lcom/groupbyinc/flux/ElasticsearchParseException; watermark parseBytesSizeValue t
K 0b settingName e disk threshold decider disabled nodes 3()Lcom/groupbyinc/flux/cluster/node/DiscoveryNodes;
/com/groupbyinc/flux/cluster/node/DiscoveryNodes dataNodes 7()Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap; !
" 3com/groupbyinc/flux/common/collect/ImmutableOpenMap$
%? 7only a single data node is present, allowing allocation' "only a single data node is present) Icluster info unavailable for disk threshold decider, allowing allocation.+ cluster info unavailable- isEmpty/ ?!0 Nunable to determine disk usages for disk-aware allocation, allowing allocation2 disk usages unavailable4
access$000 P(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;)Z x0
access$100 |(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;)Lcom/groupbyinc/flux/common/logging/ESLogger;
access$002 Q(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;Z)Z x1
access$200
access$300
access$202
access$400
access$502 s(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;Ljava/lang/Double;)Ljava/lang/Double;
access$602 ?(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;Lcom/groupbyinc/flux/common/unit/ByteSizeValue;)Lcom/groupbyinc/flux/common/unit/ByteSizeValue;
access$700
access$802
access$902 access$1000 access$1102 ?(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;Lcom/groupbyinc/flux/common/unit/TimeValue;)Lcom/groupbyinc/flux/common/unit/TimeValue;
access$900 ~(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;)Lcom/groupbyinc/flux/common/unit/ByteSizeValue; access$1200
access$600 access$1300
access$800 a(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;)Ljava/lang/Double; access$1400
access$500 access$1500 access$1100 z(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/DiskThresholdDecider;)Lcom/groupbyinc/flux/common/unit/TimeValue; access$1600 access$1700 access$1800
ConstantValue Code LocalVariableTable LineNumberTable
StackMapTable RuntimeVisibleAnnotations LocalVariableTypeTable Signature ?(Lcom/groupbyinc/flux/cluster/routing/RoutingNode;Lcom/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation;Ljava/util/Map;)Lcom/groupbyinc/flux/cluster/DiskUsage; ?(Lcom/groupbyinc/flux/cluster/routing/RoutingNode;Ljava/util/Map;)Lcom/groupbyinc/flux/cluster/DiskUsage; ?(Lcom/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation;Ljava/util/Map;)Lcom/groupbyinc/flux/cluster/routing/allocation/decider/Decision;
SourceFile InnerClasses !
[ B B B B B B ! B " # $ [ &