Skip to content

Commit 73ff1c8

Browse files
author
lucaijun
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents 5fcc64b + 9d81e0e commit 73ff1c8

19 files changed

+200
-237
lines changed

src/com/xxdb/DBConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ private Entity run(String script, String scriptType, ProgressListener listener,
508508
return new EntityBlockReader(in_);
509509
}
510510
EntityFactory factory = BasicEntityFactory.instance();
511-
return factory.createEntity(df, dt, in_, extended, -1);
511+
return factory.createEntity(df, dt, in_, extended);
512512
}catch (IOException ex){
513513
isConnected_ = false;
514514
socket_ = null;

src/com/xxdb/compression/VectorDecompressor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public Vector decompress(EntityFactory factory, ExtendedDataInput in, boolean ex
3535
else if (dt == DATA_TYPE.DT_DECIMAL64)
3636
return new BasicDecimal64Vector(DATA_FORM.DF_VECTOR, decompressedIn, tmp);
3737
else
38-
return (Vector)factory.createEntity(DATA_FORM.DF_VECTOR, dt, decompressedIn, extended, -1); // Haotian - TODO: this function `decompress` may need to be updated
38+
return (Vector)factory.createEntity(DATA_FORM.DF_VECTOR, dt, decompressedIn, extended);
3939
}
4040

4141
}

src/com/xxdb/data/AbstractMatrix.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected AbstractMatrix(ExtendedDataInput in) throws IOException{
3535
type -= 128;
3636
if(form != DATA_FORM.DF_VECTOR.ordinal())
3737
throw new IOException("The form of matrix row labels must be vector");
38-
rowLabels = (Vector)BasicEntityFactory.instance().createEntity(DATA_FORM.DF_VECTOR, DATA_TYPE.valueOf(type), in, extended, -1);
38+
rowLabels = (Vector)BasicEntityFactory.instance().createEntity(DATA_FORM.DF_VECTOR, DATA_TYPE.valueOf(type), in, extended);
3939
}
4040

4141
if((hasLabels & 2) == 2){
@@ -50,7 +50,7 @@ protected AbstractMatrix(ExtendedDataInput in) throws IOException{
5050
throw new IOException("The form of matrix columns labels must be vector");
5151
if(type <0 || type >= DATA_TYPE.DT_OBJECT.getValue())
5252
throw new IOException("Invalid data type for matrix column labels: " + type);
53-
columnLabels = (Vector)BasicEntityFactory.instance().createEntity(DATA_FORM.DF_VECTOR, DATA_TYPE.valueOf(type), in, extended, -1);
53+
columnLabels = (Vector)BasicEntityFactory.instance().createEntity(DATA_FORM.DF_VECTOR, DATA_TYPE.valueOf(type), in, extended);
5454
}
5555

5656
short flag = in.readShort();

src/com/xxdb/data/AbstractVector.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@ public String getJsonString(int rowIndex){
7272
}
7373

7474
public String getString(){
75-
StringBuilder sb = new StringBuilder();
76-
if (get(0).isScalar())
77-
sb.append("[");
78-
75+
StringBuilder sb = new StringBuilder("[");
7976
int size = Math.min(DISPLAY_ROWS, rows());
8077
if(size > 0)
8178
sb.append(getString(0));
@@ -85,10 +82,7 @@ public String getString(){
8582
}
8683
if(size < rows())
8784
sb.append(",...");
88-
89-
if (get(0).isScalar())
90-
sb.append("]");
91-
85+
sb.append("]");
9286
return sb.toString();
9387
}
9488

src/com/xxdb/data/BasicAnyVector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected BasicAnyVector(ExtendedDataInput in) throws IOException{
4242
boolean extended = type >= 128;
4343
if(type >= 128)
4444
type -= 128;
45-
Entity obj = BasicEntityFactory.instance().createEntity(DATA_FORM.values()[form], DATA_TYPE.valueOf(type), in, extended, -1);
45+
Entity obj = BasicEntityFactory.instance().createEntity(DATA_FORM.values()[form], DATA_TYPE.valueOf(type), in, extended);
4646
values[i] = obj;
4747
}
4848
}

src/com/xxdb/data/BasicArrayVector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public BasicArrayVector(DATA_TYPE type, ExtendedDataInput in) throws IOException
147147
}
148148

149149
public void deserialize(DATA_TYPE valueType, ExtendedDataInput in, int rows, int cols, int scale) throws IOException {
150-
valueVec = BasicEntityFactory.instance().createVectorWithDefaultValue(valueType, cols, scale);
150+
valueVec = BasicEntityFactory.instance().createVectorWithDefaultValue(valueType, 0, scale);
151151

152152
ByteOrder bo = in.isLittleEndian() ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN;
153153
this.baseUnitLength_ = valueVec.getUnitLength();

src/com/xxdb/data/BasicDecimal128.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,8 @@ public BasicDecimal128(BigInteger unscaledVal, int scale) {
4444
this.scale = scale;
4545
}
4646

47-
public BasicDecimal128(ExtendedDataInput in, int extra) throws IOException {
48-
if (extra != -1)
49-
scale = extra;
50-
else
51-
scale = in.readInt();
52-
47+
public BasicDecimal128(ExtendedDataInput in) throws IOException {
48+
scale = in.readInt();
5349
unscaledValue = handleLittleEndianBigEndian(in);
5450
}
5551

src/com/xxdb/data/BasicDecimal32.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ public class BasicDecimal32 extends AbstractScalar implements Comparable<BasicDe
1111
private int scale_=0;
1212
private int value_;
1313

14-
public BasicDecimal32(ExtendedDataInput in, int extra) throws IOException{
15-
if (extra != -1)
16-
scale_ = extra;
17-
else
18-
scale_ = in.readInt();
19-
14+
public BasicDecimal32(ExtendedDataInput in) throws IOException{
15+
scale_ = in.readInt();
2016
value_ = in.readInt();
2117
}
2218

src/com/xxdb/data/BasicDecimal64.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ public class BasicDecimal64 extends AbstractScalar implements Comparable<BasicDe
1717
private static final BigDecimal DECIMAL64_MIN_VALUE = new BigDecimal("-9223372036854775808");
1818
private static final BigDecimal DECIMAL64_MAX_VALUE = new BigDecimal("9223372036854775807");
1919

20-
public BasicDecimal64(ExtendedDataInput in, int extra) throws IOException{
21-
if (extra != -1)
22-
scale_ = extra;
23-
else
24-
scale_ = in.readInt();
25-
26-
value_ = in.readInt();
20+
public BasicDecimal64(ExtendedDataInput in) throws IOException{
21+
scale_ = in.readInt();
22+
value_ = in.readLong();
2723
}
2824

2925
public BasicDecimal64(long value, int scale){

src/com/xxdb/data/BasicDictionary.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public BasicDictionary(DATA_TYPE valueType, ExtendedDataInput in) throws IOExcep
3434
if(form != DATA_FORM.DF_VECTOR.ordinal())
3535
throw new IOException("The form of dictionary keys must be vector");
3636
keyType = DATA_TYPE.valueOf(type);
37-
Vector keys = (Vector)BasicEntityFactory.instance().createEntity(DATA_FORM.DF_VECTOR, keyType, in, extended, -1);
37+
Vector keys = (Vector)BasicEntityFactory.instance().createEntity(DATA_FORM.DF_VECTOR, keyType, in, extended);
3838

3939
//read value vector
4040
flag = in.readShort();
@@ -46,7 +46,7 @@ public BasicDictionary(DATA_TYPE valueType, ExtendedDataInput in) throws IOExcep
4646
if(form != DATA_FORM.DF_VECTOR.ordinal())
4747
throw new IOException("The form of dictionary values must be vector");
4848
valueType = DATA_TYPE.valueOf(type);
49-
Vector values = (Vector)BasicEntityFactory.instance().createEntity(DATA_FORM.DF_VECTOR, valueType, in, extended, -1);
49+
Vector values = (Vector)BasicEntityFactory.instance().createEntity(DATA_FORM.DF_VECTOR, valueType, in, extended);
5050

5151
if(keys.rows() != values.rows()){
5252
throw new IOException("The key size doesn't equate to value size.");

0 commit comments

Comments
 (0)