@@ -233,7 +233,7 @@ public static List<ObServerLdcItem> getServerLdc(ServerRoster serverRoster,
233233 private static String formatObServerUrl (ObServerAddr obServerAddr , long connectTimeout ,
234234 long socketTimeout ) {
235235 return format (
236- "jdbc:mysql ://%s/oceanbase?useUnicode=true&characterEncoding=utf-8&connectTimeout=%d&socketTimeout=%d" ,
236+ "jdbc:oceanbase ://%s/oceanbase?useUnicode=true&characterEncoding=utf-8&connectTimeout=%d&socketTimeout=%d" ,
237237 obServerAddr .getIp () + ":" + obServerAddr .getSqlPort (), connectTimeout , socketTimeout );
238238 }
239239
@@ -247,11 +247,11 @@ private static String formatObServerUrl(ObServerAddr obServerAddr, long connectT
247247 private static Connection getMetaRefreshConnection (String url , ObUserAuth sysUA )
248248 throws ObTableEntryRefreshException {
249249 try {
250- Class .forName ("com.mysql .jdbc.Driver" );
250+ Class .forName ("com.alipay.oceanbase .jdbc.Driver" );
251251 } catch (ClassNotFoundException e ) {
252252 RUNTIME .error (LCD .convert ("01-00006" ), e .getMessage (), e );
253253 throw new ObTableEntryRefreshException (format (
254- "fail to find com.mysql .jdbc.Driver, errMsg=%s" , e .getMessage ()), e );
254+ "fail to find com.alipay.oceanbase .jdbc.Driver, errMsg=%s" , e .getMessage ()), e );
255255 } catch (Exception e ) {
256256 RUNTIME .error (LCD .convert ("01-00005" ), e .getMessage (), e );
257257 throw new ObTableEntryRefreshException ("fail to decode proxyro password" , e );
@@ -617,7 +617,8 @@ public static TableEntry getTableEntryLocationFromRemote(Connection connection,
617617 }
618618 sql = MessageFormat .format (PROXY_LOCATION_SQL_PARTITION_V4 , sb .toString ());
619619 } else {
620- if (tableEntry .isPartitionTable () && null != tableEntry .getPartitionInfo ().getSubPartDesc ()) {
620+ if (tableEntry .isPartitionTable ()
621+ && null != tableEntry .getPartitionInfo ().getSubPartDesc ()) {
621622 long firstPartNum = tableEntry .getPartitionInfo ().getFirstPartDesc ().getPartNum ();
622623 long subPartNum = tableEntry .getPartitionInfo ().getSubPartDesc ().getPartNum ();
623624 for (long i = 0 ; i < firstPartNum ; ++i ) {
@@ -713,7 +714,8 @@ private static void fetchFirstPart(Connection connection, TableEntry tableEntry,
713714 }
714715 } else if (ObGlobal .OB_VERSION >= 4
715716 && (obPartFuncType .isKeyPart () || obPartFuncType .isHashPart ())) {
716- tableEntry .getPartitionInfo ().setPartTabletIdMap (parseFirstPartKeyHash (rs , tableEntry ));
717+ tableEntry .getPartitionInfo ().setPartTabletIdMap (
718+ parseFirstPartKeyHash (rs , tableEntry ));
717719 }
718720 } catch (Exception e ) {
719721 RUNTIME .error (LCD .convert ("01-00011" ), tableEntry , obPartFuncType , e );
@@ -778,7 +780,8 @@ private static void fetchSubPart(Connection connection, TableEntry tableEntry,
778780 }
779781 } else if (ObGlobal .OB_VERSION >= 4
780782 && (subPartFuncType .isKeyPart () || subPartFuncType .isHashPart ())) {
781- tableEntry .getPartitionInfo ().setPartTabletIdMap (parseSubPartKeyHash (rs , tableEntry ));
783+ tableEntry .getPartitionInfo ().setPartTabletIdMap (
784+ parseSubPartKeyHash (rs , tableEntry ));
782785 }
783786 } catch (Exception e ) {
784787 RUNTIME .error (LCD .convert ("01-00012" ), tableEntry , subPartFuncType , e );
@@ -851,8 +854,10 @@ private static ObPartitionEntry getPartitionLocationFromResultSet(TableEntry tab
851854 partitionId = rs .getLong ("tablet_id" );
852855 } else {
853856 partitionId = rs .getLong ("partition_id" );
854- if (tableEntry .isPartitionTable () && null != tableEntry .getPartitionInfo ().getSubPartDesc ()) {
855- partitionId = ObPartIdCalculator .getPartIdx (partitionId , tableEntry .getPartitionInfo ().getSubPartDesc ().getPartNum ());
857+ if (tableEntry .isPartitionTable ()
858+ && null != tableEntry .getPartitionInfo ().getSubPartDesc ()) {
859+ partitionId = ObPartIdCalculator .getPartIdx (partitionId , tableEntry
860+ .getPartitionInfo ().getSubPartDesc ().getPartNum ());
856861 }
857862 }
858863 if (!replica .isValid ()) {
@@ -1183,9 +1188,10 @@ private static Map<String, Long> buildPartNameIdMap(ObPartitionInfo partitionInf
11831188 return partNameIdMap ;
11841189 }
11851190
1186- private static Map <Long , Long > parseFirstPartKeyHash (ResultSet rs , TableEntry tableEntry ) throws SQLException ,
1187- IllegalArgumentException ,
1188- FeatureNotSupportedException {
1191+ private static Map <Long , Long > parseFirstPartKeyHash (ResultSet rs , TableEntry tableEntry )
1192+ throws SQLException ,
1193+ IllegalArgumentException ,
1194+ FeatureNotSupportedException {
11891195 return parseKeyHashPart (rs , tableEntry , false );
11901196 }
11911197
@@ -1219,15 +1225,17 @@ private static Map<ObPartitionKey, Long> parseSubPartSets(ResultSet rs, TableEnt
12191225 return parseListPartSets (rs , tableEntry , true );
12201226 }
12211227
1222- private static Map <Long , Long > parseSubPartKeyHash (ResultSet rs , TableEntry tableEntry ) throws SQLException ,
1223- IllegalArgumentException ,
1224- FeatureNotSupportedException {
1228+ private static Map <Long , Long > parseSubPartKeyHash (ResultSet rs , TableEntry tableEntry )
1229+ throws SQLException ,
1230+ IllegalArgumentException ,
1231+ FeatureNotSupportedException {
12251232 return parseKeyHashPart (rs , tableEntry , true );
12261233 }
12271234
1228- private static Map <Long , Long > parseKeyHashPart (ResultSet rs , TableEntry tableEntry , boolean isSubPart ) throws SQLException ,
1229- IllegalArgumentException ,
1230- FeatureNotSupportedException {
1235+ private static Map <Long , Long > parseKeyHashPart (ResultSet rs , TableEntry tableEntry ,
1236+ boolean isSubPart ) throws SQLException ,
1237+ IllegalArgumentException ,
1238+ FeatureNotSupportedException {
12311239 long idx = 0L ;
12321240 Map <Long , Long > partTabletIdMap = new HashMap <Long , Long >();
12331241 while (rs .next ()) {
@@ -1274,14 +1282,15 @@ private static List<ObComparableKV<ObPartitionKey, Long>> parseRangePart(ResultS
12741282 List <ObComparableKV <ObPartitionKey , Long >> bounds = new ArrayList <ObComparableKV <ObPartitionKey , Long >>();
12751283 Map <String , Long > partNameIdMap = new HashMap <String , Long >();
12761284 Map <Long , Long > partTabletIdMap = new HashMap <Long , Long >();
1277- ObRangePartDesc subRangePartDesc = (ObRangePartDesc ) tableEntry .getPartitionInfo ().getSubPartDesc ();
1285+ ObRangePartDesc subRangePartDesc = (ObRangePartDesc ) tableEntry .getPartitionInfo ()
1286+ .getSubPartDesc ();
12781287 long idx = 0L ;
12791288 while (rs .next ()) {
12801289 if (null != subRangePartDesc && !isSubPart && subRangePartDesc .getPartNum () == 0 ) {
12811290 // client only support template partition table
12821291 // so the sub_part_num is a constant and will store in subPartDesc which is different from proxy
12831292 long subPartNum = rs .getLong ("sub_part_num" );
1284- subRangePartDesc .setPartNum ((int )subPartNum );
1293+ subRangePartDesc .setPartNum ((int ) subPartNum );
12851294 }
12861295
12871296 String highBoundVal = rs .getString ("high_bound_val" );
0 commit comments