Skip to content

Commit 3433aad

Browse files
committed
simplified VirtualScan
1 parent b3f5759 commit 3433aad

File tree

3 files changed

+3
-158
lines changed

3 files changed

+3
-158
lines changed

driver/src/main/java/oracle/nosql/driver/ops/serde/nson/NsonProtocol.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,6 @@ public class NsonProtocol {
108108
public static String VIRTUAL_SCANS = "vssa";
109109
public static String VIRTUAL_SCAN_SID = "vssid";
110110
public static String VIRTUAL_SCAN_PID = "vspid";
111-
public static String VIRTUAL_SCAN_PRIM_KEY = "vspk";
112-
public static String VIRTUAL_SCAN_SEC_KEY = "vssk";
113-
public static String VIRTUAL_SCAN_MOVE_AFTER = "vsma";
114-
public static String VIRTUAL_SCAN_JOIN_DESC_RESUME_KEY = "vsjdrk";
115-
public static String VIRTUAL_SCAN_JOIN_PATH_TABLES = "vsjpt";
116-
public static String VIRTUAL_SCAN_JOIN_PATH_KEY = "vsjpk";
117-
public static String VIRTUAL_SCAN_JOIN_PATH_SEC_KEY = "vsjpsk";
118-
public static String VIRTUAL_SCAN_JOIN_PATH_MATCHED = "vsjpm";
119111
public static String WRITE_MULTIPLE = "wm";
120112
public static String WRITE_THROTTLE_COUNT = "wt";
121113
public static String WRITE_UNITS = "wu";
@@ -276,14 +268,6 @@ public class NsonProtocol {
276268
{VIRTUAL_SCANS,"VIRTUAL_SCANS"},
277269
{VIRTUAL_SCAN_SID,"VIRTUAL_SCAN_SID"},
278270
{VIRTUAL_SCAN_PID,"VIRTUAL_SCAN_PID"},
279-
{VIRTUAL_SCAN_PRIM_KEY,"VIRTUAL_SCAN_PRIM_KEY"},
280-
{VIRTUAL_SCAN_SEC_KEY,"VIRTUAL_SCAN_SEC_KEY"},
281-
{VIRTUAL_SCAN_MOVE_AFTER,"VIRTUAL_SCAN_MOVE_AFTER"},
282-
{VIRTUAL_SCAN_JOIN_DESC_RESUME_KEY,"VIRTUAL_SCAN_JOIN_DESC_RESUME_KEY"},
283-
{VIRTUAL_SCAN_JOIN_PATH_TABLES,"VIRTUAL_SCAN_JOIN_PATH_TABLES"},
284-
{VIRTUAL_SCAN_JOIN_PATH_KEY,"VIRTUAL_SCAN_JOIN_PATH_KEY"},
285-
{VIRTUAL_SCAN_JOIN_PATH_SEC_KEY,"VIRTUAL_SCAN_JOIN_PATH_SEC_KEY"},
286-
{VIRTUAL_SCAN_JOIN_PATH_MATCHED,"VIRTUAL_SCAN_JOIN_PATH_MATCHED"},
287271
{WRITE_MULTIPLE,"WRITE_MULTIPLE"},
288272
{WRITE_THROTTLE_COUNT,"WRITE_THROTTLE_COUNT"},
289273
{WRITE_UNITS,"WRITE_UNITS"},

driver/src/main/java/oracle/nosql/driver/ops/serde/nson/NsonSerializerFactory.java

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -903,18 +903,6 @@ private static void writeVirtualScan(NsonSerializer ns,
903903
startMap(ns, VIRTUAL_SCAN);
904904
writeMapField(ns, VIRTUAL_SCAN_SID, vs.sid());
905905
writeMapField(ns, VIRTUAL_SCAN_PID, vs.pid());
906-
907-
if (vs.isFirstBatch()) {
908-
writeMapField(ns, VIRTUAL_SCAN_PRIM_KEY, vs.primKey());
909-
writeMapField(ns, VIRTUAL_SCAN_SEC_KEY, vs.secKey());
910-
writeMapField(ns, VIRTUAL_SCAN_MOVE_AFTER, vs.moveAfterResumeKey());
911-
912-
writeMapField(ns, VIRTUAL_SCAN_JOIN_DESC_RESUME_KEY, vs.descResumeKey());
913-
writeMapField(ns, VIRTUAL_SCAN_JOIN_PATH_TABLES, vs.joinPathTables());
914-
writeMapField(ns, VIRTUAL_SCAN_JOIN_PATH_KEY, vs.joinPathKey());
915-
writeMapField(ns, VIRTUAL_SCAN_JOIN_PATH_SEC_KEY, vs.joinPathSecKey());
916-
writeMapField(ns, VIRTUAL_SCAN_JOIN_PATH_MATCHED, vs.joinPathMatched());
917-
}
918906
endMap(ns, VIRTUAL_SCAN);
919907
}
920908

@@ -1117,14 +1105,6 @@ private static VirtualScan readVirtualScan(ByteInputStream in)
11171105

11181106
int sid = -1;
11191107
int pid = -1;
1120-
byte[] primKey = null;
1121-
byte[] secKey = null;
1122-
boolean moveAfter = true;
1123-
byte[] descResumeKey = null;
1124-
int[] joinPathTables = null;
1125-
byte[] joinPathKey = null;
1126-
byte[] joinPathSecKey = null;
1127-
boolean joinPathMatched = false;
11281108

11291109
MapWalker walker = getMapWalker(in);
11301110

@@ -1135,30 +1115,12 @@ private static VirtualScan readVirtualScan(ByteInputStream in)
11351115
sid = Nson.readNsonInt(in);
11361116
} else if (name.equals(VIRTUAL_SCAN_PID)) {
11371117
pid = Nson.readNsonInt(in);
1138-
} else if (name.equals(VIRTUAL_SCAN_PRIM_KEY)) {
1139-
primKey = Nson.readNsonBinary(in);
1140-
} else if (name.equals(VIRTUAL_SCAN_SEC_KEY)) {
1141-
secKey = Nson.readNsonBinary(in);
1142-
} else if (name.equals(VIRTUAL_SCAN_MOVE_AFTER)) {
1143-
moveAfter = Nson.readNsonBoolean(in);
1144-
} else if (name.equals(VIRTUAL_SCAN_JOIN_DESC_RESUME_KEY)) {
1145-
descResumeKey = Nson.readNsonBinary(in);
1146-
} else if (name.equals(VIRTUAL_SCAN_JOIN_PATH_TABLES)) {
1147-
joinPathTables = Nson.readIntArray(in);
1148-
} else if (name.equals(VIRTUAL_SCAN_JOIN_PATH_KEY)) {
1149-
joinPathKey = Nson.readNsonBinary(in);
1150-
} else if (name.equals(VIRTUAL_SCAN_JOIN_PATH_SEC_KEY)) {
1151-
joinPathSecKey = Nson.readNsonBinary(in);
1152-
} else if (name.equals(VIRTUAL_SCAN_JOIN_PATH_MATCHED)) {
1153-
joinPathMatched = Nson.readNsonBoolean(in);
11541118
} else {
11551119
skipUnknownField(walker, name);
11561120
}
11571121
}
11581122

1159-
return new VirtualScan(pid, sid, primKey, secKey, moveAfter,
1160-
descResumeKey, joinPathTables, joinPathKey,
1161-
joinPathSecKey, joinPathMatched);
1123+
return new VirtualScan(pid, sid);
11621124
}
11631125

11641126
private static void readPhase1Results(byte[] arr, QueryResult result)

driver/src/main/java/oracle/nosql/driver/query/VirtualScan.java

Lines changed: 2 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,14 @@
1111
public class VirtualScan {
1212

1313
final private int theSID;
14-
final private int thePID;
15-
final private byte[] thePrimResumeKey;
16-
final private byte[] theSecResumeKey;
17-
final private boolean theMoveAfterResumeKey;
1814

19-
final private byte[] theDescResumeKey;
20-
final private int[] theJoinPathTables;
21-
final private byte[] theJoinPathKey;
22-
final private byte[] theJoinPathSecKey;
23-
final private boolean theJoinPathMatched;
15+
final private int thePID;
2416

2517
boolean theFirstBatch = true;
2618

27-
public VirtualScan(
28-
int pid,
29-
int sid,
30-
byte[] primKey,
31-
byte[] secKey,
32-
boolean moveAfterResumeKey,
33-
byte[] descResumeKey,
34-
int[] joinPathTables,
35-
byte[] joinPathKey,
36-
byte[] joinPathSecKey,
37-
boolean joinPathMatched) {
19+
public VirtualScan(int pid, int sid) {
3820
theSID = sid;
3921
thePID = pid;
40-
thePrimResumeKey = primKey;
41-
theSecResumeKey = secKey;
42-
theMoveAfterResumeKey = moveAfterResumeKey;
43-
theDescResumeKey = descResumeKey;
44-
theJoinPathTables = joinPathTables;
45-
theJoinPathKey = joinPathKey;
46-
theJoinPathSecKey = joinPathSecKey;
47-
theJoinPathMatched = joinPathMatched;
4822
}
4923

5024
public int sid() {
@@ -55,38 +29,6 @@ public int pid() {
5529
return thePID;
5630
}
5731

58-
public byte[] secKey() {
59-
return theSecResumeKey;
60-
}
61-
62-
public byte[] primKey() {
63-
return thePrimResumeKey;
64-
}
65-
66-
public boolean moveAfterResumeKey() {
67-
return theMoveAfterResumeKey;
68-
}
69-
70-
public byte[] descResumeKey() {
71-
return theDescResumeKey;
72-
}
73-
74-
public int[] joinPathTables() {
75-
return theJoinPathTables;
76-
}
77-
78-
public byte[] joinPathKey() {
79-
return theJoinPathKey;
80-
}
81-
82-
public byte[] joinPathSecKey() {
83-
return theJoinPathSecKey;
84-
}
85-
86-
public boolean joinPathMatched() {
87-
return theJoinPathMatched;
88-
}
89-
9032
public boolean isFirstBatch() {
9133
return theFirstBatch;
9234
}
@@ -99,51 +41,8 @@ public String toString() {
9941
sb.append("sid/pid = ").append(theSID).append("/").append(thePID);
10042
sb.append("\n");
10143

102-
if (thePrimResumeKey != null) {
103-
sb.append("thePrimResumeKey = ");
104-
sb.append(PlanIter.printByteArray(thePrimResumeKey));
105-
sb.append("\n");
106-
}
107-
108-
if (theSecResumeKey != null) {
109-
sb.append("theSecResumeKey = ");
110-
sb.append(PlanIter.printByteArray(theSecResumeKey));
111-
sb.append("\n");
112-
}
113-
114-
sb.append("theMoveAfterResumeKey = ").append(theMoveAfterResumeKey);
115-
sb.append("\n");
116-
117-
if (theDescResumeKey != null) {
118-
sb.append("theDescResumeKey = ");
119-
sb.append(PlanIter.printByteArray(theDescResumeKey));
120-
sb.append("\n");
121-
}
122-
123-
if (theJoinPathTables != null) {
124-
sb.append("theJoinPathTables = ");
125-
sb.append(PlanIter.printIntArray(theJoinPathTables));
126-
sb.append("\n");
127-
}
128-
129-
if (theJoinPathKey != null) {
130-
sb.append("theJoinPathKey = ");
131-
sb.append(PlanIter.printByteArray(theJoinPathKey));
132-
sb.append("\n");
133-
}
134-
135-
if (theJoinPathSecKey != null) {
136-
sb.append("theJoinPathSecKey = ");
137-
sb.append(PlanIter.printByteArray(theJoinPathSecKey));
138-
sb.append("\n");
139-
}
140-
141-
sb.append("theJoinPathMatched = ").append(theJoinPathMatched);
142-
sb.append("\n");
143-
14444
sb.append("theFirstBatch = ").append(theFirstBatch);
14545
sb.append("\n");
146-
14746
return sb.toString();
14847
}
14948
}

0 commit comments

Comments
 (0)