com.groupbyinc.flux.cluster.routing.allocation.AllocationService.class Maven / Gradle / Ivy
???? 4? @com/groupbyinc/flux/cluster/routing/allocation/AllocationService 6com/groupbyinc/flux/common/component/AbstractComponent AllocationService.java Bcom/groupbyinc/flux/cluster/routing/allocation/AllocationService$1 Ocom/groupbyinc/flux/cluster/routing/allocation/AllocationService$CommandsResult CommandsResult ;com/groupbyinc/flux/common/collect/ImmutableOpenMap$Builder 3com/groupbyinc/flux/common/collect/ImmutableOpenMap
Builder 0com/groupbyinc/flux/cluster/ClusterState$Builder (com/groupbyinc/flux/cluster/ClusterState /com/groupbyinc/flux/cluster/ClusterState$Custom Custom Acom/groupbyinc/flux/cluster/routing/RoutingNodes$UnassignedShards 0com/groupbyinc/flux/cluster/routing/RoutingNodes UnassignedShards Tcom/groupbyinc/flux/cluster/routing/RoutingNodes$UnassignedShards$UnassignedIterator UnassignedIterator 8com/groupbyinc/flux/cluster/routing/RoutingTable$Builder 0com/groupbyinc/flux/cluster/routing/RoutingTable ! 9com/groupbyinc/flux/cluster/routing/UnassignedInfo$Reason # 2com/groupbyinc/flux/cluster/routing/UnassignedInfo % Reason Ccom/groupbyinc/flux/cluster/routing/UnassignedInfo$AllocationStatus ( AllocationStatus %java/lang/invoke/MethodHandles$Lookup + java/lang/invoke/MethodHandles - Lookup allocationDeciders KLcom/groupbyinc/flux/cluster/routing/allocation/decider/AllocationDeciders; gatewayAllocator .Lcom/groupbyinc/flux/gateway/GatewayAllocator; shardsAllocator JLcom/groupbyinc/flux/cluster/routing/allocation/allocator/ShardsAllocator; clusterInfoService 0Lcom/groupbyinc/flux/cluster/ClusterInfoService; $assertionsDisabled Z $(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/cluster/routing/allocation/decider/AllocationDeciders;Lcom/groupbyinc/flux/gateway/GatewayAllocator;Lcom/groupbyinc/flux/cluster/routing/allocation/allocator/ShardsAllocator;Lcom/groupbyinc/flux/cluster/ClusterInfoService;)V ?(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/cluster/routing/allocation/decider/AllocationDeciders;Lcom/groupbyinc/flux/cluster/routing/allocation/allocator/ShardsAllocator;Lcom/groupbyinc/flux/cluster/ClusterInfoService;)V : <
= setGatewayAllocator 1(Lcom/groupbyinc/flux/gateway/GatewayAllocator;)V ? @
A this BLcom/groupbyinc/flux/cluster/routing/allocation/AllocationService; settings .Lcom/groupbyinc/flux/common/settings/Settings; 1(Lcom/groupbyinc/flux/common/settings/Settings;)V : G
H 0 1 J 4 5 L 6 7 N 2 3 P applyStartedShards f(Lcom/groupbyinc/flux/cluster/ClusterState;Ljava/util/List;)Lcom/groupbyinc/flux/cluster/ClusterState; java/util/List T isEmpty ()Z V W U X getMutableRoutingNodes ^(Lcom/groupbyinc/flux/cluster/ClusterState;)Lcom/groupbyinc/flux/cluster/routing/RoutingNodes; Z [
\
unassigned E()Lcom/groupbyinc/flux/cluster/routing/RoutingNodes$UnassignedShards; ^ _
` shuffle ()V b c
d @com/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation f .com/groupbyinc/flux/cluster/ClusterInfoService h getClusterInfo +()Lcom/groupbyinc/flux/cluster/ClusterInfo; j k i l currentNanoTime ()J n o
p ?(Lcom/groupbyinc/flux/cluster/routing/allocation/decider/AllocationDeciders;Lcom/groupbyinc/flux/cluster/routing/RoutingNodes;Lcom/groupbyinc/flux/cluster/ClusterState;Lcom/groupbyinc/flux/cluster/ClusterInfo;JZ)V : r
g s java/util/ArrayList u (Ljava/util/Collection;)V : w
v x "java/lang/invoke/LambdaMetafactory z 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;)Ljava/lang/Object; ? 0com/groupbyinc/flux/cluster/routing/ShardRouting ? primary ? W
? ? ? G(Lcom/groupbyinc/flux/cluster/routing/ShardRouting;)Ljava/lang/Boolean; ? apply ()Ljava/util/function/Function; ? ? ? java/util/Comparator ? comparing 5(Ljava/util/function/Function;)Ljava/util/Comparator; ? ? ? ? java/util/Collections ? sort )(Ljava/util/List;Ljava/util/Comparator;)V ? ?
? ? U(Lcom/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation;Ljava/util/List;)V R ?
? ,com/groupbyinc/flux/gateway/GatewayAllocator ?
? ? reroute E(Lcom/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation;)V ? ?
? lambda$applyStartedShards$0 F(Lcom/groupbyinc/flux/cluster/routing/ShardRouting;)Ljava/lang/String; ? ?
? ? ? ? 'firstListElementsToCommaDelimitedString A(Ljava/util/List;Ljava/util/function/Function;)Ljava/lang/String; ? ?
? java/lang/StringBuilder ? : c
? ? shards started [ ? append -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? ?
? ? ] ... ? toString ()Ljava/lang/String; ? ?
? ? buildResultAndLogHealthChange ?(Lcom/groupbyinc/flux/cluster/ClusterState;Lcom/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation;Ljava/lang/String;)Lcom/groupbyinc/flux/cluster/ClusterState; ? ?
? clusterState *Lcom/groupbyinc/flux/cluster/ClusterState;
startedShards DLjava/util/List; Ljava/util/List; routingNodes 2Lcom/groupbyinc/flux/cluster/routing/RoutingNodes;
allocation BLcom/groupbyinc/flux/cluster/routing/allocation/RoutingAllocation; startedShardsAsString Ljava/lang/String; routingTable 4()Lcom/groupbyinc/flux/cluster/routing/RoutingTable; ? ?
? 4()Lcom/groupbyinc/flux/cluster/routing/RoutingNodes; ? ?
g ?
? version ? o
" ? updateNodes o(JLcom/groupbyinc/flux/cluster/routing/RoutingNodes;)Lcom/groupbyinc/flux/cluster/routing/RoutingTable$Builder; ? ?
? build ? ?
? updateMetaDataWithRoutingChanges c(Lcom/groupbyinc/flux/cluster/routing/RoutingTable;)Lcom/groupbyinc/flux/cluster/metadata/MetaData; ? ?
g ? 8 9 ? validate 2(Lcom/groupbyinc/flux/cluster/metadata/MetaData;)Z ? ?
" ? java/lang/AssertionError ?
? ? java/lang/String ? -com/groupbyinc/flux/cluster/metadata/MetaData ? builder ^(Lcom/groupbyinc/flux/cluster/ClusterState;)Lcom/groupbyinc/flux/cluster/ClusterState$Builder; ? ?
? f(Lcom/groupbyinc/flux/cluster/routing/RoutingTable;)Lcom/groupbyinc/flux/cluster/ClusterState$Builder; ? ?
? metaData c(Lcom/groupbyinc/flux/cluster/metadata/MetaData;)Lcom/groupbyinc/flux/cluster/ClusterState$Builder; ? ?
? restore ? custom E(Ljava/lang/String;)Lcom/groupbyinc/flux/cluster/ClusterState$Custom; ?
g -com/groupbyinc/flux/cluster/RestoreInProgress #updateRestoreInfoWithRoutingChanges `(Lcom/groupbyinc/flux/cluster/RestoreInProgress;)Lcom/groupbyinc/flux/cluster/RestoreInProgress;
g
getCustoms 7()Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap;
g t(Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap;)Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap$Builder; ?
put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
?
customs i(Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap;)Lcom/groupbyinc/flux/cluster/ClusterState$Builder;
,()Lcom/groupbyinc/flux/cluster/ClusterState; ?
5com/groupbyinc/flux/cluster/health/ClusterStateHealth -(Lcom/groupbyinc/flux/cluster/ClusterState;)V :
logClusterHealthStateChange ?(Lcom/groupbyinc/flux/cluster/health/ClusterStateHealth;Lcom/groupbyinc/flux/cluster/health/ClusterStateHealth;Ljava/lang/String;)V"#
$ customsBuilder ?Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap$Builder; =Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap$Builder; updatedRestoreInProgress /Lcom/groupbyinc/flux/cluster/RestoreInProgress; oldState reason oldRoutingTable 2Lcom/groupbyinc/flux/cluster/routing/RoutingTable; newRoutingNodes newRoutingTable newMetaData /Lcom/groupbyinc/flux/cluster/metadata/MetaData; newStateBuilder 2Lcom/groupbyinc/flux/cluster/ClusterState$Builder; restoreInProgress newState applyFailedShard ?(Lcom/groupbyinc/flux/cluster/ClusterState;Lcom/groupbyinc/flux/cluster/routing/ShardRouting;)Lcom/groupbyinc/flux/cluster/ClusterState; :com/groupbyinc/flux/cluster/routing/allocation/FailedShard9 \(Lcom/groupbyinc/flux/cluster/routing/ShardRouting;Ljava/lang/String;Ljava/lang/Exception;)V :;
:<
singletonList $(Ljava/lang/Object;)Ljava/util/List;>?
?@ emptyList ()Ljava/util/List;BC
?D applyFailedShards v(Lcom/groupbyinc/flux/cluster/ClusterState;Ljava/util/List;Ljava/util/List;)Lcom/groupbyinc/flux/cluster/ClusterState;FG
H failedShard 2Lcom/groupbyinc/flux/cluster/routing/ShardRouting; failedShards NLjava/util/List; Ccom/groupbyinc/flux/cluster/routing/allocation/IndexMetaDataUpdaterN removeStaleIdsWithoutRoutingsP S
OQ iterator ()Ljava/util/Iterator;ST UU java/util/IteratorW hasNextY WXZ next ()Ljava/lang/Object;\]X^ getRoutingEntry 4()Lcom/groupbyinc/flux/cluster/routing/ShardRouting;`a
:b 1()Lcom/groupbyinc/flux/cluster/metadata/MetaData; ?d
ge shardId +()Lcom/groupbyinc/flux/index/shard/ShardId;gh
?i 'com/groupbyinc/flux/index/shard/ShardIdk getIndex #()Lcom/groupbyinc/flux/index/Index;mn
lo getIndexSafe W(Lcom/groupbyinc/flux/index/Index;)Lcom/groupbyinc/flux/cluster/metadata/IndexMetaData;qr
?s
currentNodeIdu ?
?v addIgnoreShardForNode >(Lcom/groupbyinc/flux/index/shard/ShardId;Ljava/lang/String;)Vxy
gz allocationId 4()Lcom/groupbyinc/flux/cluster/routing/AllocationId;|}
?~ 0com/groupbyinc/flux/cluster/routing/AllocationId? getId? ?
?? getByAllocationId o(Lcom/groupbyinc/flux/index/shard/ShardId;Ljava/lang/String;)Lcom/groupbyinc/flux/cluster/routing/ShardRouting;??
? logger 8Lcom/groupbyinc/flux/common/apache/logging/log4j/Logger;?? ? M{} shard routing modified in an earlier iteration (previous: {}, current: {})? 6com/groupbyinc/flux/common/apache/logging/log4j/Logger? trace K(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V???? 2com/groupbyinc/flux/cluster/metadata/IndexMetaData? unassignedInfo 6()Lcom/groupbyinc/flux/cluster/routing/UnassignedInfo;??
?? getNumFailedAllocations ()I??
&? ALLOCATION_FAILED ;Lcom/groupbyinc/flux/cluster/routing/UnassignedInfo$Reason;?? $?
getMessage? ?
:?
getFailure ()Ljava/lang/Exception;??
:? java/lang/System? currentTimeMillis? o
??
NO_ATTEMPT ELcom/groupbyinc/flux/cluster/routing/UnassignedInfo$AllocationStatus;?? )? ?(Lcom/groupbyinc/flux/cluster/routing/UnassignedInfo$Reason;Ljava/lang/String;Ljava/lang/Exception;IJJZLcom/groupbyinc/flux/cluster/routing/UnassignedInfo$AllocationStatus;)V :?
&? changes >()Lcom/groupbyinc/flux/cluster/routing/RoutingChangesObserver;??
g? failShard(Lcom/groupbyinc/flux/common/apache/logging/log4j/Logger;Lcom/groupbyinc/flux/cluster/routing/ShardRouting;Lcom/groupbyinc/flux/cluster/routing/UnassignedInfo;Lcom/groupbyinc/flux/cluster/metadata/IndexMetaData;Lcom/groupbyinc/flux/cluster/routing/RoutingChangesObserver;)V??
? ={} shard routing failed in an earlier iteration (routing: {})? 9(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V????F ?
?? lambda$applyFailedShards$1 P(Lcom/groupbyinc/flux/cluster/routing/allocation/FailedShard;)Ljava/lang/String;??
??? ? shards failed [? failedAllocations I 4Lcom/groupbyinc/flux/cluster/routing/UnassignedInfo; shardToFail
indexMetaData 4Lcom/groupbyinc/flux/cluster/metadata/IndexMetaData; failedShardEntry