com.huawei.opengauss.jdbc.QueryCNListUtils.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opengaussjdbc Show documentation
Show all versions of opengaussjdbc Show documentation
HuaweiCloud JDBC for GaussDB
The newest version!
???? 4? *com/huawei/opengauss/jdbc/QueryCNListUtils java/lang/Object QueryCNListUtils.java 1com/huawei/opengauss/jdbc/QueryCNListUtils$CNList CNList
clusterCNList Ljava/util/Map; VLjava/util/Map; firstConnectMap 6Ljava/util/Map; LOGGER #Lcom/huawei/opengauss/jdbc/log/Log; ()V
this ,Lcom/huawei/opengauss/jdbc/QueryCNListUtils; setLOGGER $com/huawei/opengauss/jdbc/log/Logger isUsingJDKLogger ()Z
java/lang/Class getName ()Ljava/lang/String;
! getLogger 7(Ljava/lang/String;)Lcom/huawei/opengauss/jdbc/log/Log; # $
% ' getCNList U(Ljava/lang/String;Ljava/util/Properties;Z)[Lcom/huawei/opengauss/jdbc/util/HostSpec; java/lang/InterruptedException + java/lang/String - java/util/Properties /
1
java/util/Map 3 get &(Ljava/lang/Object;)Ljava/lang/Object; 5 6 4 7 list *[Lcom/huawei/opengauss/jdbc/util/HostSpec; 9 : ; java/lang/Throwable = java/lang/Thread ? sleep (J)V A B
@ C eInterruptedException. This caused by: "Thread.sleep", waiting for refreshing CN List from connection. E !com/huawei/opengauss/jdbc/log/Log G info (Ljava/lang/Object;)V I J H K 6Blocking time exceeds 2 seconds need to pay attention. M com/huawei/opengauss/jdbc/Driver O GetHostSpecs B(Ljava/util/Properties;)[Lcom/huawei/opengauss/jdbc/util/HostSpec; Q R
P S coordinationNodeList 3Lcom/huawei/opengauss/jdbc/QueryCNListUtils$CNList; e Ljava/lang/InterruptedException; i I key Ljava/lang/String;
properties Ljava/util/Properties; block Z intervalWaitHasRefreshedCNList timesWaitHasRefreshedCNList
keyFromURL *(Ljava/util/Properties;)Ljava/lang/String; getURLHostSpecs e R
P f java/util/Arrays h sort ([Ljava/lang/Object;)V j k
i l toString '([Ljava/lang/Object;)Ljava/lang/String; n o
i p props hostSpecs refreshProperties (Ljava/util/Properties;)V
v c d
x
z java/lang/Boolean | valueOf (Z)Ljava/lang/Boolean; ~
} ? getOrDefault 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; ? ? 4 ? booleanValue ?
} ? put ? ? 4 ? ) *
? : java/lang/StringBuilder ?
? J[AUTOBALANCE] The cluster obtains CNList from the user thread. | Cluster: ? append -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? ?
? ? | CNList: ? n
? ? 'com/huawei/opengauss/jdbc/util/HostSpec ? getHost ?
? ? (C)Ljava/lang/StringBuilder; ? ?
? ? getPort ()I ? ?
? ? (I)Ljava/lang/String; ~ ?
. ? PGHOST ? length ? ?
? ? substring (II)Ljava/lang/String; ? ?
? ? setProperty 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object; ? ?
0 ? PGPORT ? coordinatorNode )Lcom/huawei/opengauss/jdbc/util/HostSpec; coordinatorNodeList hosts Ljava/lang/StringBuilder; ports getTimeToRefrshCNList (Ljava/util/Properties;)J refreshCNIpListTime ? 10 ? getProperty 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; ? ?
0 ? [0-9]+ ? java/util/regex/Pattern ? compile -(Ljava/lang/String;)Ljava/util/regex/Pattern; ? ?
? ? matcher 3(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher; ? ?
? ? java/util/regex/Matcher ? matches ?
? ? 0 ?
startsWith (Ljava/lang/String;)Z ? ?
. ?
. ? java/lang/Integer ? parseInt (Ljava/lang/String;)I ? ?
? ? ? ' pattern Ljava/util/regex/Pattern;
isConnectToDN (Ljava/util/Properties;)Z $com/huawei/opengauss/jdbc/PGProperty ?
CONNECT_TO_DN &Lcom/huawei/opengauss/jdbc/PGProperty; ? ? ? ?
getBoolean ? ?
? ? runRereshCNListQueryies G(Lcom/huawei/opengauss/jdbc/core/QueryExecutor;Ljava/util/Properties;)V java/sql/SQLException ? java/io/IOException ? java/lang/System ? currentTimeMillis ()J
? ?
-([Lcom/huawei/opengauss/jdbc/util/HostSpec;)V
,com/huawei/opengauss/jdbc/core/QueryExecutor
lastUpdated J
java/util/ArrayList
USING_EIP ? ? ? ?
?select node_host1,node_port1 from pgxc_node where (node_type='D' or node_type='S') and node_name='dn_6001_6002_6003' and nodeis_active = true order by node_host1; mselect node_host1,node_port1 from pgxc_node where node_type='C' and nodeis_active = true order by node_host1; ?select node_host,node_port from pgxc_node where (node_type='D' or node_type='S') and node_name='dn_6001_6002_6003' and nodeis_active = true order by node_host; jselect node_host,node_port from pgxc_node where node_type='C' and nodeis_active = true order by node_host; isTraceEnabled H! connectToDN = # (Z)Ljava/lang/StringBuilder; ?%
?&
; query = ( trace* J H+ /com/huawei/opengauss/jdbc/core/SetupQueryRunner-
runForList S(Lcom/huawei/opengauss/jdbc/core/QueryExecutor;Ljava/lang/String;Z)Ljava/util/List;/0
.1 java/util/List3 iterator ()Ljava/util/Iterator;5647 java/util/Iterator9 hasNext; :< next ()Ljava/lang/Object;>?:@ [[BB getEncoding +()Lcom/huawei/opengauss/jdbc/core/Encoding;DEF 'com/huawei/opengauss/jdbc/core/EncodingH decode ([B)Ljava/lang/String;JK
IL (Ljava/lang/String;I)V N
?O add (Ljava/lang/Object;)ZQR
S 6[AUTOBALANCE] Try to refreshing CN list, the cluster: U -(Ljava/lang/Object;)Ljava/lang/StringBuilder; ?W
?X
connect To: Z getHostSpec +()Lcom/huawei/opengauss/jdbc/util/HostSpec;\]^ toArray (([Ljava/lang/Object;)[Ljava/lang/Object;`a
b 3[AUTOBALANCE] For refreshing CN list, the cluster: d??????? cnList checkLatestUpdate query host port result
queryExecutor .Lcom/huawei/opengauss/jdbc/core/QueryExecutor; cluster latestAllowedUpdate cnListRefreshed @Ljava/util/ArrayList; Ljava/util/ArrayList; usingEip Ljava/lang/Boolean; results Ljava/util/List<[[B>; Ljava/util/List; java/util/HashMap{
| &java/util/concurrent/ConcurrentHashMap~
Signature Code LocalVariableTable LineNumberTable
StackMapTable LocalVariableTypeTable
Exceptions
SourceFile InnerClasses !
?
?
? / *? ? ? ?
? ; ? ? ? "? &? (? ? # $ &?
) * ? ?
> ?66? ]? 2Y:² 2*? 8 ? :? ?