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
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 +com/groupbyinc/flux/common/settings/Setting 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; 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 0 2
3 java/util/Collections 5 emptyMap ()Ljava/util/Map; 7 8
6 9 - . ; ) * = ! ? get B(Lcom/groupbyinc/flux/common/settings/Settings;)Ljava/lang/Object; A B
C java/lang/Integer E intValue ()I G H
F I + , K 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 S U containsKey (Ljava/lang/Object;)Z W X Y "java/lang/IllegalArgumentException [ 9remote clusters must not have the empty string as its key ] (Ljava/lang/String;)V 0 _
\ ` java/util/HashMap b ()V 0 d
c e isEmpty ()Z g h i )com/groupbyinc/flux/action/ActionListener k
onResponse (Ljava/lang/Object;)V m n l o 4com/groupbyinc/flux/common/util/concurrent/CountDown q size s H t (I)V 0 v
r w "java/lang/invoke/LambdaMetafactory y 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; { |
z } ~ X lambda$updateRemoteClusters$0 3(Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;)Z ? ?
? ? ? test ()Ljava/util/function/Predicate; ? ? ? % ! ? O P ? exists 1(Lcom/groupbyinc/flux/common/settings/Settings;)Z ? ?
? java/lang/String ? lambda$updateRemoteClusters$1 E(Ljava/lang/String;Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;)Z ? ?
? ? 2(Ljava/lang/String;)Ljava/util/function/Predicate; ? ? ? java/util/function/Predicate ? and >(Ljava/util/function/Predicate;)Ljava/util/function/Predicate; ? ? ? ? putAll (Ljava/util/Map;)V ? ? ? entrySet ()Ljava/util/Set; ? ? ?
java/util/Set ? iterator ()Ljava/util/Iterator; ? ? ? ? java/util/Iterator ? hasNext ? h ? ? next ()Ljava/lang/Object; ? ? ? ? getKey ? ?
? &(Ljava/lang/Object;)Ljava/lang/Object; A ? ? 5com/groupbyinc/flux/transport/RemoteClusterConnection ? getValue ? ?
? java/util/List ? ? i 5com/groupbyinc/flux/common/apache/lucene/util/IOUtils ? close ([Ljava/io/Closeable;)V ? ?
? ? logger !Lorg/apache/logging/log4j/Logger; ? ? ? java/lang/StringBuilder ?
? e 8failed to close remote cluster connections for cluster: ? append -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? ?
? ? toString ()Ljava/lang/String; ? ?
? ? org/apache/logging/log4j/Logger ? warn *(Ljava/lang/String;Ljava/lang/Throwable;)V ? ? ? ? remove ? ? ? ?(Lcom/groupbyinc/flux/common/settings/Settings;Ljava/lang/String;Ljava/util/List;Lcom/groupbyinc/flux/transport/TransportService;ILjava/util/function/Predicate;)V 0 ?
? ? put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; ? ? ? n 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; l updateSeedNodes >(Ljava/util/List;Lcom/groupbyinc/flux/action/ActionListener;)V
? unmodifiableMap (Ljava/util/Map;)Ljava/util/Map;
6 attribute Ljava/lang/String; 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;
nodePredicate PLjava/util/function/Predicate; Ljava/util/function/Predicate; seeds eLjava/util/Map;>; connectionListener =Lcom/groupbyinc/flux/action/ActionListener; +Lcom/groupbyinc/flux/action/ActionListener; 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;% h
/ groupClusterIndices B([Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Map;12
3 *com/groupbyinc/flux/action/OriginalIndices5 ? t toArray (([Ljava/lang/Object;)[Ljava/lang/Object;89 ?: [Ljava/lang/String;< I([Ljava/lang/String;Lcom/groupbyinc/flux/action/support/IndicesOptions;)V 0>
6? "com/groupbyinc/flux/common/StringsA EMPTY_ARRAYC< BD 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/ConcurrentHashMapY
Z e +java/util/concurrent/atomic/AtomicReference\
] e 1com/groupbyinc/flux/action/support/IndicesOptions_ no such remote cluster: a ()[Ljava/lang/String;Oc
6d Jcom/groupbyinc/flux/action/admin/cluster/shards/ClusterSearchShardsRequestf ([Ljava/lang/String;)V 0h
gi ?(Lcom/groupbyinc/flux/action/support/IndicesOptions;)Lcom/groupbyinc/flux/action/admin/cluster/shards/ClusterSearchShardsRequest;Mk
gl local D(Z)Lcom/groupbyinc/flux/action/support/master/MasterNodeReadRequest;no
gp
preference `(Ljava/lang/String;)Lcom/groupbyinc/flux/action/admin/cluster/shards/ClusterSearchShardsRequest;rs
gt routingvs
gw ?(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 0y
z 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 aLjava/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? ? ? updateRemoteCluster %(Ljava/lang/String;Ljava/util/List;)V lambda$updateRemoteCluster$4? ?
?? .()Lcom/groupbyinc/flux/common/CheckedConsumer; ?? ? lambda$updateRemoteCluster$5?
?? ()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$6 `(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;??
6? Q R
? nodes BLjava/util/List; initializeRemoteClusters java/lang/InterruptedException? %java/util/concurrent/TimeoutException? java/lang/Exception? # ! ? )com/groupbyinc/flux/common/unit/TimeValue? 4com/groupbyinc/flux/action/support/PlainActionFuture?
? e buildRemoteClustersSeeds ?(Lcom/groupbyinc/flux/common/settings/Settings;)Ljava/util/Map;??
? millis ()J??
?? java/util/concurrent/TimeUnit? MILLISECONDS Ljava/util/concurrent/TimeUnit;?? ?? 4(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object; A?
?? java/lang/Thread?
currentThread ()Ljava/lang/Thread;?
? interrupt d
? .failed to connect to remote clusters within {}
? ? '(Ljava/lang/String;Ljava/lang/Object;)V ? ?
java/lang/IllegalStateException $failed to connect to remote clusters 0 ?
Ljava/lang/InterruptedException; ex 'Ljava/util/concurrent/TimeoutException; Ljava/lang/Exception; timeValue +Lcom/groupbyinc/flux/common/unit/TimeValue; future HLcom/groupbyinc/flux/action/support/PlainActionFuture; 6Lcom/groupbyinc/flux/action/support/PlainActionFuture; values ()Ljava/util/Collection; (Ljava/lang/Iterable;)V ?
? getRemoteConnectionInfos emptyList ()Ljava/util/List;#$
6% 8com/groupbyinc/flux/action/support/GroupedActionListener' E(Lcom/groupbyinc/flux/action/ActionListener;ILjava/util/Collection;)V 0)
(* java/util/Collection,- ? getConnectionInfo/?
?0 actionListener pLcom/groupbyinc/flux/action/support/GroupedActionListener; :Lcom/groupbyinc/flux/action/support/GroupedActionListener; yLcom/groupbyinc/flux/action/ActionListener;>; collectNodes =(Ljava/util/Set;Lcom/groupbyinc/flux/action/ActionListener;)V no such remote cluster: [8 ]: onFailure< l= ? t lambda$collectNodes$7 D(Ljava/lang/String;)Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;@A
BCA ()Ljava/util/function/Function;?F G java/util/function/FunctionI ?(Lcom/groupbyinc/flux/transport/RemoteClusterService;Ljava/util/Map;Ljava/lang/String;Lcom/groupbyinc/flux/common/util/concurrent/CountDown;Lcom/groupbyinc/flux/action/ActionListener;Ljava/util/function/Function;)V 0K
L6?
?N clusters #Ljava/util/Set; Ljava/util/Set; ?Lcom/groupbyinc/flux/action/ActionListener;>;
clusterMap ?Ljava/util/Map;>; nullFunction aLjava/util/function/Function; Ljava/util/function/Function; s 5com/groupbyinc/flux/common/transport/TransportAddressZ (Ljava/net/InetSocketAddress;)V 0\
[] #_
[ ? com/groupbyinc/flux/Versionb CURRENT Lcom/groupbyinc/flux/Version;de cf minimumCompatibilityVersion ()Lcom/groupbyinc/flux/Version;hi
cj .com/groupbyinc/flux/cluster/node/DiscoveryNodel i(Ljava/lang/String;Lcom/groupbyinc/flux/common/transport/TransportAddress;Lcom/groupbyinc/flux/Version;)V 0n
mo address Ljava/net/InetSocketAddress; transportAddress 7Lcom/groupbyinc/flux/common/transport/TransportAddress; id version x Ljava/lang/Void; fastForwardy h
rz isClosed| h
?} (failed to update seed list for cluster: exception h
r? response
getAttributes? 8
m? false? getOrDefault? ? ? #com/groupbyinc/flux/common/Booleans? parseBoolean?U
??
getVersion?i
m? isCompatible (Lcom/groupbyinc/flux/Version;)Z??
c? %search.remote.connections_per_cluster? NodeScope 6Lcom/groupbyinc/flux/common/settings/Setting$Property;?? ?
intSetting z(Ljava/lang/String;II[Lcom/groupbyinc/flux/common/settings/Setting$Property;)Lcom/groupbyinc/flux/common/settings/Setting;??
? %search.remote.initial_connect_timeout? timeValueSeconds .(J)Lcom/groupbyinc/flux/common/unit/TimeValue;??
?? positiveTimeSetting ?(Ljava/lang/String;Lcom/groupbyinc/flux/common/unit/TimeValue;[Lcom/groupbyinc/flux/common/settings/Setting$Property;)Lcom/groupbyinc/flux/common/settings/Setting;??
? search.remote.node.attr? simpleString x(Ljava/lang/String;[Lcom/groupbyinc/flux/common/settings/Setting$Property;)Lcom/groupbyinc/flux/common/settings/Setting;??
? search.remote.connect? boolSetting y(Ljava/lang/String;Z[Lcom/groupbyinc/flux/common/settings/Setting$Property;)Lcom/groupbyinc/flux/common/settings/Setting;??
? ' ! ? Signature Code LocalVariableTable LineNumberTable LocalVariableTypeTable
StackMapTable ?(Ljava/util/Map;>;Lcom/groupbyinc/flux/action/ActionListener;)V ?(Lcom/groupbyinc/flux/action/support/IndicesOptions;[Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Map;F(Lcom/groupbyinc/flux/action/support/IndicesOptions;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/groupbyinc/flux/action/ActionListener;>;)V R(Ljava/lang/String;Lcom/groupbyinc/flux/action/ActionListener;)V %()Ljava/util/Set; C(Ljava/lang/String;Ljava/util/List;)V ?(Ljava/lang/String;Ljava/util/List;Lcom/groupbyinc/flux/action/ActionListener;)V
Exceptions |(Lcom/groupbyinc/flux/action/ActionListener;>;)V ?(Ljava/util/Set;Lcom/groupbyinc/flux/action/ActionListener;>;)V BootstrapMethods
SourceFile InnerClasses 1 ! ? " # ! ? $ % ! ? &