10
10
11
11
public class VirtualScan {
12
12
13
- final private int theSID ;
13
+ public static class TableResumeInfo {
14
+
15
+ final private int theCurrentIndexRange ;
16
+ final private byte [] thePrimResumeKey ;
17
+ final private byte [] theSecResumeKey ;
18
+ final private boolean theMoveAfterResumeKey ;
19
+
20
+ final private byte [] theDescResumeKey ;
21
+ final private int [] theJoinPathTables ;
22
+ final private byte [] theJoinPathKey ;
23
+ final private byte [] theJoinPathSecKey ;
24
+ final private boolean theJoinPathMatched ;
25
+
26
+ public TableResumeInfo (
27
+ int currentIndexRange ,
28
+ byte [] primKey ,
29
+ byte [] secKey ,
30
+ boolean moveAfterResumeKey ,
31
+ byte [] descResumeKey ,
32
+ int [] joinPathTables ,
33
+ byte [] joinPathKey ,
34
+ byte [] joinPathSecKey ,
35
+ boolean joinPathMatched ) {
36
+
37
+ theCurrentIndexRange = currentIndexRange ;
38
+ thePrimResumeKey = primKey ;
39
+ theSecResumeKey = secKey ;
40
+ theMoveAfterResumeKey = moveAfterResumeKey ;
41
+ theDescResumeKey = descResumeKey ;
42
+ theJoinPathTables = joinPathTables ;
43
+ theJoinPathKey = joinPathKey ;
44
+ theJoinPathSecKey = joinPathSecKey ;
45
+ theJoinPathMatched = joinPathMatched ;
46
+ }
47
+
48
+ @ Override
49
+ public String toString () {
50
+
51
+ StringBuilder sb = new StringBuilder ();
52
+
53
+ sb .append ("theCurrentIndexRange = " ).append (theCurrentIndexRange );
54
+ sb .append ("\n " );
55
+
56
+ if (thePrimResumeKey != null ) {
57
+ sb .append ("thePrimResumeKey = " );
58
+ sb .append (PlanIter .printByteArray (thePrimResumeKey ));
59
+ sb .append ("\n " );
60
+ }
61
+
62
+ if (theSecResumeKey != null ) {
63
+ sb .append ("theSecResumeKey = " );
64
+ sb .append (PlanIter .printByteArray (theSecResumeKey ));
65
+ sb .append ("\n " );
66
+ }
67
+
68
+ sb .append ("theMoveAfterResumeKey = " ).append (theMoveAfterResumeKey );
69
+ sb .append ("\n " );
70
+
71
+ if (theDescResumeKey != null ) {
72
+ sb .append ("theDescResumeKey = " );
73
+ sb .append (PlanIter .printByteArray (theDescResumeKey ));
74
+ sb .append ("\n " );
75
+ }
76
+
77
+ if (theJoinPathTables != null ) {
78
+ sb .append ("theJoinPathTables = " );
79
+ sb .append (PlanIter .printIntArray (theJoinPathTables ));
80
+ sb .append ("\n " );
81
+ }
82
+
83
+ if (theJoinPathKey != null ) {
84
+ sb .append ("theJoinPathKey = " );
85
+ sb .append (PlanIter .printByteArray (theJoinPathKey ));
86
+ sb .append ("\n " );
87
+ }
88
+
89
+ if (theJoinPathSecKey != null ) {
90
+ sb .append ("theJoinPathSecKey = " );
91
+ sb .append (PlanIter .printByteArray (theJoinPathSecKey ));
92
+ sb .append ("\n " );
93
+ }
94
+
95
+ sb .append ("theJoinPathMatched = " ).append (theJoinPathMatched );
96
+ sb .append ("\n " );
97
+
98
+ return sb .toString ();
99
+ }
100
+ }
14
101
102
+ final private int theSID ;
15
103
final private int thePID ;
104
+ final private TableResumeInfo [] theTableRIs ;
16
105
17
- final private byte [] thePrimResumeKey ;
18
- final private byte [] theSecResumeKey ;
19
- final private boolean theMoveAfterResumeKey ;
20
-
21
- final private byte [] theDescResumeKey ;
22
- final private int [] theJoinPathTables ;
23
- final private byte [] theJoinPathKey ;
24
- final private byte [] theJoinPathSecKey ;
25
- final private boolean theJoinPathMatched ;
26
106
27
107
boolean theFirstBatch = true ;
28
108
29
109
public VirtualScan (
30
110
int pid ,
31
111
int sid ,
32
- byte [] primKey ,
33
- byte [] secKey ,
34
- boolean moveAfterResumeKey ,
35
- byte [] descResumeKey ,
36
- int [] joinPathTables ,
37
- byte [] joinPathKey ,
38
- byte [] joinPathSecKey ,
39
- boolean joinPathMatched ) {
112
+ TableResumeInfo [] tableRIs ) {
113
+
40
114
theSID = sid ;
41
115
thePID = pid ;
42
- thePrimResumeKey = primKey ;
43
- theSecResumeKey = secKey ;
44
- theMoveAfterResumeKey = moveAfterResumeKey ;
45
- theDescResumeKey = descResumeKey ;
46
- theJoinPathTables = joinPathTables ;
47
- theJoinPathKey = joinPathKey ;
48
- theJoinPathSecKey = joinPathSecKey ;
49
- theJoinPathMatched = joinPathMatched ;
116
+ theTableRIs = tableRIs ;
50
117
}
51
118
52
119
public int sid () {
@@ -57,36 +124,44 @@ public int pid() {
57
124
return thePID ;
58
125
}
59
126
60
- public byte [] secKey () {
61
- return theSecResumeKey ;
127
+ public int numTables () {
128
+ return theTableRIs . length ;
62
129
}
63
130
64
- public byte [] primKey ( ) {
65
- return thePrimResumeKey ;
131
+ public int currentIndexRange ( int i ) {
132
+ return theTableRIs [ i ]. theCurrentIndexRange ;
66
133
}
67
134
68
- public boolean moveAfterResumeKey ( ) {
69
- return theMoveAfterResumeKey ;
135
+ public byte [] secKey ( int i ) {
136
+ return theTableRIs [ i ]. theSecResumeKey ;
70
137
}
71
138
72
- public byte [] descResumeKey () {
73
- return theDescResumeKey ;
139
+ public byte [] primKey (int i ) {
140
+ return theTableRIs [i ].thePrimResumeKey ;
141
+ }
142
+
143
+ public boolean moveAfterResumeKey (int i ) {
144
+ return theTableRIs [i ].theMoveAfterResumeKey ;
145
+ }
146
+
147
+ public byte [] descResumeKey (int i ) {
148
+ return theTableRIs [i ].theDescResumeKey ;
74
149
}
75
150
76
- public int [] joinPathTables () {
77
- return theJoinPathTables ;
151
+ public int [] joinPathTables (int i ) {
152
+ return theTableRIs [ i ]. theJoinPathTables ;
78
153
}
79
154
80
- public byte [] joinPathKey () {
81
- return theJoinPathKey ;
155
+ public byte [] joinPathKey (int i ) {
156
+ return theTableRIs [ i ]. theJoinPathKey ;
82
157
}
83
158
84
- public byte [] joinPathSecKey () {
85
- return theJoinPathSecKey ;
159
+ public byte [] joinPathSecKey (int i ) {
160
+ return theTableRIs [ i ]. theJoinPathSecKey ;
86
161
}
87
162
88
- public boolean joinPathMatched () {
89
- return theJoinPathMatched ;
163
+ public boolean joinPathMatched (int i ) {
164
+ return theTableRIs [ i ]. theJoinPathMatched ;
90
165
}
91
166
92
167
public boolean isFirstBatch () {
@@ -103,6 +178,12 @@ public String toString() {
103
178
104
179
sb .append ("theFirstBatch = " ).append (theFirstBatch );
105
180
sb .append ("\n " );
181
+
182
+ for (int i = 0 ; i < theTableRIs .length ; ++i ) {
183
+ sb .append ("Table RI " ).append (i ).append (":\n " );
184
+ sb .append (theTableRIs [i ]);
185
+ }
186
+
106
187
return sb .toString ();
107
188
}
108
189
}
0 commit comments