Skip to content

Commit 52ae9cf

Browse files
author
chengyitian
committed
AJ-886: fix issue about deserialize fast array in cep;
1 parent 182ea49 commit 52ae9cf

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/com/xxdb/streaming/client/cep/EventHandler.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,26 @@ else if (type == Entity.DATA_TYPE.DT_DECIMAL128)
398398
}
399399

400400
private Entity deserializeFastArray(Entity.DATA_TYPE type, int extraParam, ExtendedDataInput input) throws IOException {
401-
BasicEntityFactory factory = new BasicEntityFactory();
402-
input.readShort();
403-
return factory.createEntity(Entity.DATA_FORM.DF_VECTOR, type, input, false);
401+
int totalCount = input.readShort();
402+
if (totalCount == 0) {
403+
return BasicEntityFactory.instance().createVectorWithDefaultValue(type, 0, extraParam);
404+
}
405+
406+
byte countByte = input.readByte();
407+
input.readByte();
408+
409+
int count;
410+
if (countByte == 1) {
411+
count = input.readByte() & 0xFF;
412+
} else if (countByte == 2) {
413+
count = input.readUnsignedShort();
414+
} else {
415+
count = input.readInt();
416+
}
417+
418+
AbstractVector vector = (AbstractVector) BasicEntityFactory.instance().createVectorWithDefaultValue(type, count, extraParam);
419+
vector.deserialize(0, count, input);
420+
return vector;
404421
}
405422

406423
private Entity deserializeAny(Entity.DATA_TYPE type, Entity.DATA_FORM form, ExtendedDataInput input) throws IOException {

0 commit comments

Comments
 (0)