Skip to content

Commit 515db1a

Browse files
author
chengyitian
committed
AJ-627: fix issue about cep vector deserialize;
1 parent 1c5e25f commit 515db1a

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ private Entity deserializeScalar(Entity.DATA_TYPE type, int extraParam, Extended
393393

394394
private Entity deserializeFastArray(Entity.DATA_TYPE type, int extraParam, ExtendedDataInput input) throws IOException {
395395
BasicEntityFactory factory = new BasicEntityFactory();
396+
input.readShort();
396397
return factory.createEntity(Entity.DATA_FORM.DF_VECTOR, type, input, false);
397398
}
398399

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,6 @@ public FastArrayAttributeSerializer(int unitLen) {
1212

1313
@Override
1414
public void serialize(Entity attribute, ExtendedDataOutput out) throws IOException {
15-
int curCount = attribute.rows();
16-
short arrayRows = 1;
17-
byte curCountBytes = 1;
18-
byte reserved = 0;
19-
int maxCount = 255;
20-
while (curCount > maxCount) {
21-
curCountBytes *= 2;
22-
maxCount = (1 << (8 * curCountBytes)) - 1;
23-
}
24-
out.writeShort(arrayRows);
25-
out.writeByte(curCountBytes);
26-
out.writeByte(reserved);
27-
switch (curCountBytes) {
28-
case 1:
29-
out.writeByte(curCount);
30-
break;
31-
case 2:
32-
out.writeShort(curCount);
33-
break;
34-
default:
35-
out.writeInt(curCount);
36-
break;
37-
}
38-
3915
attribute.write(out);
4016
}
4117

0 commit comments

Comments
 (0)