com.groupbyinc.flux.transport.RemoteClusterService.class Maven / Gradle / Ivy
???? 4> 2com/groupbyinc/flux/transport/RemoteClusterService 0com/groupbyinc/flux/transport/RemoteClusterAware java/io/Closeable RemoteClusterService.java 4com/groupbyinc/flux/transport/RemoteClusterService$2 4com/groupbyinc/flux/transport/RemoteClusterService$1
8com/groupbyinc/flux/common/settings/Setting$AffixSetting +com/groupbyinc/flux/common/settings/Setting AffixSetting java/util/Map$Entry
java/util/Map Entry 2com/groupbyinc/flux/transport/Transport$Connection 'com/groupbyinc/flux/transport/Transport
Connection 4com/groupbyinc/flux/common/settings/Setting$Property Property %java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup REMOTE_CONNECTIONS_PER_CLUSTER -Lcom/groupbyinc/flux/common/settings/Setting; BLcom/groupbyinc/flux/common/settings/Setting; )REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING ZLcom/groupbyinc/flux/common/settings/Setting; REMOTE_NODE_ATTRIBUTE ALcom/groupbyinc/flux/common/settings/Setting; ENABLE_REMOTE_CLUSTERS BLcom/groupbyinc/flux/common/settings/Setting; REMOTE_CLUSTER_SKIP_UNAVAILABLE :Lcom/groupbyinc/flux/common/settings/Setting$AffixSetting; OLcom/groupbyinc/flux/common/settings/Setting$AffixSetting; DEFAULT_NODE_PREDICATE Ljava/util/function/Predicate; PLjava/util/function/Predicate; transportService 0Lcom/groupbyinc/flux/transport/TransportService; numRemoteConnections I remoteClusters Ljava/util/Map; ZLjava/util/Map; a(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/transport/TransportService;)V 1(Lcom/groupbyinc/flux/common/settings/Settings;)V 9 ;
< java/util/Collections > emptyMap ()Ljava/util/Map; @ A
? B 6 7 D 2 3 F # $ H get B(Lcom/groupbyinc/flux/common/settings/Settings;)Ljava/lang/Object; J K
L java/lang/Integer N intValue ()I P Q
O R 4 5 T this 4Lcom/groupbyinc/flux/transport/RemoteClusterService; settings .Lcom/groupbyinc/flux/common/settings/Settings; updateRemoteClusters =(Ljava/util/Map;Lcom/groupbyinc/flux/action/ActionListener;)V java/io/IOException \ ^ containsKey (Ljava/lang/Object;)Z ` a b "java/lang/IllegalArgumentException d 9remote clusters must not have the empty string as its key f (Ljava/lang/String;)V 9 h
e i java/util/HashMap k ()V 9 m
l n isEmpty ()Z p q r )com/groupbyinc/flux/action/ActionListener t
onResponse (Ljava/lang/Object;)V v w u x 4com/groupbyinc/flux/common/util/concurrent/CountDown z size | Q } (I)V 9
{ ? putAll (Ljava/util/Map;)V ? ? ? entrySet ()Ljava/util/Set; ? ? ?
java/util/Set ? iterator ()Ljava/util/Iterator; ? ? ? ? java/util/Iterator ? hasNext ? q ? ? next ()Ljava/lang/Object; ? ? ? ? getKey ? ? ? &(Ljava/lang/Object;)Ljava/lang/Object; J ? ? 5com/groupbyinc/flux/transport/RemoteClusterConnection ? getValue ? ? ? java/util/List ? ? r ,com/groupbyinc/flux/core/internal/io/IOUtils ? close ([Ljava/io/Closeable;)V ? ?
? ? logger !Lorg/apache/logging/log4j/Logger; ? ? ? java/lang/StringBuilder ?
? n 8failed to close remote cluster connections for cluster: ? append -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? ?
? ? java/lang/String ? toString ()Ljava/lang/String; ? ?
? ? org/apache/logging/log4j/Logger ? warn *(Ljava/lang/String;Ljava/lang/Throwable;)V ? ? ? ? remove ? ? ? X Y ? getNodePredicate N(Lcom/groupbyinc/flux/common/settings/Settings;)Ljava/util/function/Predicate; ? ?
? ?(Lcom/groupbyinc/flux/common/settings/Settings;Ljava/lang/String;Ljava/util/List;Lcom/groupbyinc/flux/transport/TransportService;ILjava/util/function/Predicate;)V 9 ?
? ? put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; ? ? ? "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; ? ?
? ? ? w lambda$updateRemoteClusters$2 t(Lcom/groupbyinc/flux/common/util/concurrent/CountDown;Lcom/groupbyinc/flux/action/ActionListener;Ljava/lang/Void;)V ? ?
? ? (Ljava/lang/Void;)V ? accept ?(Lcom/groupbyinc/flux/common/util/concurrent/CountDown;Lcom/groupbyinc/flux/action/ActionListener;)Lcom/groupbyinc/flux/common/CheckedConsumer; ? ? ? lambda$updateRemoteClusters$3 ?(Lcom/groupbyinc/flux/common/util/concurrent/CountDown;Lcom/groupbyinc/flux/action/ActionListener;Lcom/groupbyinc/flux/transport/RemoteClusterConnection;Ljava/util/Map$Entry;Ljava/lang/Exception;)V ? ?
? ? (Ljava/lang/Exception;)V ? (Lcom/groupbyinc/flux/transport/RemoteClusterService;Lcom/groupbyinc/flux/common/util/concurrent/CountDown;Lcom/groupbyinc/flux/action/ActionListener;Lcom/groupbyinc/flux/transport/RemoteClusterConnection;Ljava/util/Map$Entry;)Ljava/util/function/Consumer; ? ? ? wrap v(Lcom/groupbyinc/flux/common/CheckedConsumer;Ljava/util/function/Consumer;)Lcom/groupbyinc/flux/action/ActionListener; ? ? u ? updateSeedNodes >(Ljava/util/List;Lcom/groupbyinc/flux/action/ActionListener;)V ? ?
? ? unmodifiableMap (Ljava/util/Map;)Ljava/util/Map; ? ?
? ? e Ljava/io/IOException; remote 7Lcom/groupbyinc/flux/transport/RemoteClusterConnection; finalRemote entry kLjava/util/Map$Entry;>; Ljava/util/Map$Entry; countDown 6Lcom/groupbyinc/flux/common/util/concurrent/CountDown; seeds eLjava/util/Map;>; connectionListener =Lcom/groupbyinc/flux/action/ActionListener; +Lcom/groupbyinc/flux/action/ActionListener; ( $ exists 1(Lcom/groupbyinc/flux/common/settings/Settings;)Z
/ 0 a lambda$getNodePredicate$4 E(Ljava/lang/String;Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;)Z
3(Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;)Z test 2(Ljava/lang/String;)Ljava/util/function/Predicate; java/util/function/Predicate" and >(Ljava/util/function/Predicate;)Ljava/util/function/Predicate;$%#& attribute Ljava/lang/String; isCrossClusterSearchEnabled isRemoteNodeConnected isNodeConnected,
?-
remoteCluster node 0Lcom/groupbyinc/flux/cluster/node/DiscoveryNode; groupIndices u(Lcom/groupbyinc/flux/action/support/IndicesOptions;[Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Map;* q
4 groupClusterIndices B([Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Map;67
8 *com/groupbyinc/flux/action/OriginalIndices: ? } toArray (([Ljava/lang/Object;)[Ljava/lang/Object;=> ?? [Ljava/lang/String;A I([Ljava/lang/String;Lcom/groupbyinc/flux/action/support/IndicesOptions;)V 9C
;D "com/groupbyinc/flux/common/StringsF EMPTY_ARRAYHA GI clusterAlias originalIndices $Ljava/util/List; Ljava/util/List; MLjava/util/Map$Entry;>; groupedIndices GLjava/util/Map;>; indicesOptions 3Lcom/groupbyinc/flux/action/support/IndicesOptions; indices indexExists 2Ljava/util/function/Predicate; originalIndicesMap OLjava/util/Map; isRemoteClusterRegistered (Ljava/lang/String;)Z clusterName collectSearchShards ?(Lcom/groupbyinc/flux/action/support/IndicesOptions;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/groupbyinc/flux/action/ActionListener;)V &java/util/concurrent/ConcurrentHashMap^
_ n +java/util/concurrent/atomic/AtomicReferencea
b n 1com/groupbyinc/flux/action/support/IndicesOptionsd no such remote cluster: f ()[Ljava/lang/String;Th
;i Jcom/groupbyinc/flux/action/admin/cluster/shards/ClusterSearchShardsRequestk ([Ljava/lang/String;)V 9m
ln ?(Lcom/groupbyinc/flux/action/support/IndicesOptions;)Lcom/groupbyinc/flux/action/admin/cluster/shards/ClusterSearchShardsRequest;Rp
lq local D(Z)Lcom/groupbyinc/flux/action/support/master/MasterNodeReadRequest;st
lu
preference `(Ljava/lang/String;)Lcom/groupbyinc/flux/action/admin/cluster/shards/ClusterSearchShardsRequest;wx
ly routing{x
l| ?(Lcom/groupbyinc/flux/transport/RemoteClusterService;Ljava/util/Map;Ljava/lang/String;Lcom/groupbyinc/flux/common/util/concurrent/CountDown;Ljava/util/concurrent/atomic/AtomicReference;Lcom/groupbyinc/flux/action/ActionListener;)V 9~
fetchSearchShards z(Lcom/groupbyinc/flux/action/admin/cluster/shards/ClusterSearchShardsRequest;Lcom/groupbyinc/flux/action/ActionListener;)V??
?? remoteClusterConnection searchShardsRequest LLcom/groupbyinc/flux/action/admin/cluster/shards/ClusterSearchShardsRequest; ULjava/util/Map$Entry; remoteIndicesByCluster listener ?Lcom/groupbyinc/flux/action/ActionListener;>; responsesCountDown searchShardsResponses pLjava/util/Map; transportException gLjava/util/concurrent/atomic/AtomicReference; -Ljava/util/concurrent/atomic/AtomicReference;
getConnection x(Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;Ljava/lang/String;)Lcom/groupbyinc/flux/transport/Transport$Connection; f(Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;)Lcom/groupbyinc/flux/transport/Transport$Connection;??
?? cluster
connection ensureConnected @(Ljava/lang/String;Lcom/groupbyinc/flux/action/ActionListener;)V .(Lcom/groupbyinc/flux/action/ActionListener;)V??
?? H(Ljava/lang/String;)Lcom/groupbyinc/flux/transport/Transport$Connection; 6()Lcom/groupbyinc/flux/transport/Transport$Connection;??
?? getRemoteClusterNames keySet? ? ? listenForUpdates 8(Lcom/groupbyinc/flux/common/settings/ClusterSettings;)V??
? , - ? '(Ljava/lang/Object;Ljava/lang/Object;)V? updateSkipUnavailable ((Ljava/lang/String;Ljava/lang/Boolean;)V??
??? U(Lcom/groupbyinc/flux/transport/RemoteClusterService;)Ljava/util/function/BiConsumer; ?? ? lambda$listenForUpdates$5??
?? !()Ljava/util/function/BiConsumer; ?? ? 3com/groupbyinc/flux/common/settings/ClusterSettings? addAffixUpdateConsumer {(Lcom/groupbyinc/flux/common/settings/Setting$AffixSetting;Ljava/util/function/BiConsumer;Ljava/util/function/BiConsumer;)V??
?? clusterSettings 5Lcom/groupbyinc/flux/common/settings/ClusterSettings; java/lang/Boolean? booleanValue? q
?? (Z)V??
?? skipUnavailable Ljava/lang/Boolean; updateRemoteCluster %(Ljava/lang/String;Ljava/util/List;)V lambda$updateRemoteCluster$6? ?
?? .()Lcom/groupbyinc/flux/common/CheckedConsumer; ?? ? lambda$updateRemoteCluster$7? ?
?? ()Ljava/util/function/Consumer; ?? ? P(Ljava/lang/String;Ljava/util/List;Lcom/groupbyinc/flux/action/ActionListener;)V??
? addresses .Ljava/util/List; stream ()Ljava/util/stream/Stream;?? ?? ? lambda$updateRemoteCluster$8 `(Ljava/lang/String;Ljava/net/InetSocketAddress;)Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;??
?? N(Ljava/net/InetSocketAddress;)Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;? apply 1(Ljava/lang/String;)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;? singletonMap 5(Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Map;
? Z [
nodes BLjava/util/List; initializeRemoteClusters java/lang/InterruptedException %java/util/concurrent/TimeoutException java/lang/Exception &