Skip to content

Commit 1e67d8b

Browse files
author
chengyitian
committed
AJ-439: rename 'getUserID' to 'getUserId'; JAVAOS-147: optimize some code; AJ-442: AbstractClient support server to 300.
1 parent ba5583f commit 1e67d8b

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

src/com/xxdb/BasicDBTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void waitFor(int timeOut) {
9292
synchronized (this) {
9393
if (status == TaskStatus.PENDING) {
9494
DBConnection connection = new DBConnection();
95-
connection.connect(conn.getHostName(), conn.getPort(), conn.getUserID(), conn.getPwd());
95+
connection.connect(conn.getHostName(), conn.getPort(), conn.getUserId(), conn.getPwd());
9696
String sessionId = connection.getSessionID();
9797
BasicStringVector bs = (BasicStringVector) connection.run("exec rootJobId from getConsoleJobs() where sessionId = " + sessionId);
9898
List<Entity> arguments = new ArrayList<>();

src/com/xxdb/DBConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ public int getPort() {
12691269
return this.conn_.port_;
12701270
}
12711271

1272-
public String getUserID(){
1272+
public String getUserId(){
12731273
return this.conn_.userId_;
12741274
}
12751275

src/com/xxdb/data/BasicDecimal128Vector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,9 @@ public void addRange(BigDecimal[] valueList) {
450450
public void Append(Scalar value) throws Exception{
451451
if (scale_ < 0)
452452
throw new RuntimeException("Please set scale first.");
453-
if(value.getDataType() == DT_DECIMAL128) {
453+
454+
if(value.getDataType() == DT_DECIMAL128)
454455
add(value.getString());
455-
}
456456
else
457457
add(value.getNumber().toString());
458458
}

src/com/xxdb/data/BasicDecimal32Vector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@ public void Append(Scalar value) throws Exception{
333333
if (scale_ < 0){
334334
throw new RuntimeException("Please set scale first.");
335335
}
336-
if(value.getDataType() == DT_DECIMAL32) {
336+
337+
if(value.getDataType() == DT_DECIMAL32)
337338
add(value.getString());
338-
}
339339
else
340340
add(value.getNumber().doubleValue());
341341
}

src/com/xxdb/data/BasicDecimal64Vector.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import java.nio.ByteBuffer;
1010
import java.nio.ByteOrder;
1111
import java.util.Arrays;
12-
13-
import static com.xxdb.data.Entity.DATA_TYPE.DT_DECIMAL32;
1412
import static com.xxdb.data.Entity.DATA_TYPE.DT_DECIMAL64;
1513

1614
public class BasicDecimal64Vector extends AbstractVector{
@@ -340,9 +338,9 @@ public void addRange(double[] valueList) {
340338
public void Append(Scalar value) throws Exception{
341339
if (scale_ < 0)
342340
throw new RuntimeException("Please set scale first.");
343-
if(value.getDataType() == DT_DECIMAL64) {
341+
342+
if(value.getDataType() == DT_DECIMAL64)
344343
add(value.getString());
345-
}
346344
else
347345
add(value.getNumber().doubleValue());
348346
}

src/com/xxdb/streaming/client/AbstractClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ void checkServerVersion(String host, int port) throws IOException {
608608
int v1 = Integer.parseInt(_[1]);
609609
int v2 = Integer.parseInt(_[2]);
610610

611-
if((v0 == 2 && v1 == 0 && v2 >= 9) || (v0 == 2 && v1 == 10)){
611+
if((v0 == 2 && v1 == 0 && v2 >= 9) || (v0 == 2 && v1 == 10) || (v0 == 3 && v1 == 0 && v2 >= 0)){
612612
//server only support reverse connection
613613
listeningPort = 0;
614614
}else{

0 commit comments

Comments
 (0)