Skip to content

Commit 585bd1d

Browse files
author
chengyitian
committed
AJ-843: support kdb parser;
1 parent ab42483 commit 585bd1d

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/com/xxdb/DBConnection.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,17 @@ private class DBConnectionImpl{
158158
private ReentrantLock lock_;
159159
private boolean isReverseStreaming_ = false;
160160
private boolean python_ = false;
161+
private boolean kdb_ = false;
161162
private SqlStdEnum sqlStd_;
162163

163-
private DBConnectionImpl(boolean asynTask, boolean sslEnable, boolean compress, boolean python, boolean ifUrgent, boolean isReverseStreaming, SqlStdEnum sqlStd, boolean enableSCRAM){
164+
private DBConnectionImpl(boolean asynTask, boolean sslEnable, boolean compress, boolean python, boolean ifUrgent, boolean isReverseStreaming, SqlStdEnum sqlStd, boolean enableSCRAM, boolean kdb){
164165
sessionID_ = "";
165166
this.sslEnable_ = sslEnable;
166167
this.asynTask_ = asynTask;
167168
this.compress_ = compress;
168169
this.ifUrgent_ = ifUrgent;
169170
this.python_ = python;
171+
this.kdb_ = kdb;
170172
this.isReverseStreaming_ = isReverseStreaming;
171173
this.sqlStd_ = sqlStd;
172174
this.lock_ = new ReentrantLock();
@@ -278,6 +280,8 @@ private int generateRequestFlag(boolean clearSessionMemory){
278280
flag += 64;
279281
if (this.python_)
280282
flag += 2048;
283+
if (this.kdb_)
284+
flag += 4096;
281285
if (this.isReverseStreaming_)
282286
flag += 131072;
283287
if (Objects.nonNull(this.sqlStd_)) {
@@ -668,7 +672,7 @@ public ExtendedDataInput getDataInputStream() {
668672
}
669673

670674
private DBConnectionImpl createEnableReverseStreamingDBConnectionImpl(boolean asynTask, boolean sslEnable, boolean compress, boolean python, boolean ifUrgent, SqlStdEnum sqlStd) {
671-
return new DBConnectionImpl(asynTask, sslEnable, compress, python, ifUrgent, true, sqlStd, false);
675+
return new DBConnectionImpl(asynTask, sslEnable, compress, python, ifUrgent, true, sqlStd, false, false);
672676
}
673677

674678
public DBConnection() {
@@ -692,28 +696,33 @@ public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress)
692696
}
693697

694698
public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress, boolean usePython){
695-
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, false, false, SqlStdEnum.DolphinDB, false);
699+
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, false, false, SqlStdEnum.DolphinDB, false, false);
696700
this.mutex_ = new ReentrantLock();
697701
}
698702

699703

700704
public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress, boolean usePython, SqlStdEnum sqlStd){
701-
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, false, false, sqlStd, false);
705+
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, false, false, sqlStd, false, false);
702706
this.mutex_ = new ReentrantLock();
703707
}
704708

705709
public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress, boolean usePython, boolean isUrgent){
706-
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, false, SqlStdEnum.DolphinDB, false);
710+
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, false, SqlStdEnum.DolphinDB, false, false);
707711
this.mutex_ = new ReentrantLock();
708712
}
709713

710714
public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress, boolean usePython, boolean isUrgent, SqlStdEnum sqlStd){
711-
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, false, sqlStd, false);
715+
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, false, sqlStd, false, false);
712716
this.mutex_ = new ReentrantLock();
713717
}
714718

715719
public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress, boolean usePython, boolean isUrgent, SqlStdEnum sqlStd, boolean enableSCRAM){
716-
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, false, sqlStd, enableSCRAM);
720+
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, false, sqlStd, enableSCRAM, false);
721+
this.mutex_ = new ReentrantLock();
722+
}
723+
724+
public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress, boolean usePython, boolean isUrgent, SqlStdEnum sqlStd, boolean enableSCRAM, boolean useKdb){
725+
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, false, sqlStd, enableSCRAM, useKdb);
717726
this.mutex_ = new ReentrantLock();
718727
}
719728

@@ -729,7 +738,7 @@ public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress,
729738
*/
730739
@Deprecated
731740
private DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress, boolean usePython, boolean isUrgent, boolean isReverseStreaming, SqlStdEnum sqlStd){
732-
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, isReverseStreaming, sqlStd, false);
741+
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, isReverseStreaming, sqlStd, false, false);
733742
this.mutex_ = new ReentrantLock();
734743
}
735744

0 commit comments

Comments
 (0)