1010
1111public class VirtualScan {
1212
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+ }
14101
102+ final private int theSID ;
15103 final private int thePID ;
104+ final private TableResumeInfo [] theTableRIs ;
16105
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 ;
26106
27107 boolean theFirstBatch = true ;
28108
29109 public VirtualScan (
30110 int pid ,
31111 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+
40114 theSID = sid ;
41115 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 ;
50117 }
51118
52119 public int sid () {
@@ -57,36 +124,44 @@ public int pid() {
57124 return thePID ;
58125 }
59126
60- public byte [] secKey () {
61- return theSecResumeKey ;
127+ public int numTables () {
128+ return theTableRIs . length ;
62129 }
63130
64- public byte [] primKey ( ) {
65- return thePrimResumeKey ;
131+ public int currentIndexRange ( int i ) {
132+ return theTableRIs [ i ]. theCurrentIndexRange ;
66133 }
67134
68- public boolean moveAfterResumeKey ( ) {
69- return theMoveAfterResumeKey ;
135+ public byte [] secKey ( int i ) {
136+ return theTableRIs [ i ]. theSecResumeKey ;
70137 }
71138
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 ;
74149 }
75150
76- public int [] joinPathTables () {
77- return theJoinPathTables ;
151+ public int [] joinPathTables (int i ) {
152+ return theTableRIs [ i ]. theJoinPathTables ;
78153 }
79154
80- public byte [] joinPathKey () {
81- return theJoinPathKey ;
155+ public byte [] joinPathKey (int i ) {
156+ return theTableRIs [ i ]. theJoinPathKey ;
82157 }
83158
84- public byte [] joinPathSecKey () {
85- return theJoinPathSecKey ;
159+ public byte [] joinPathSecKey (int i ) {
160+ return theTableRIs [ i ]. theJoinPathSecKey ;
86161 }
87162
88- public boolean joinPathMatched () {
89- return theJoinPathMatched ;
163+ public boolean joinPathMatched (int i ) {
164+ return theTableRIs [ i ]. theJoinPathMatched ;
90165 }
91166
92167 public boolean isFirstBatch () {
@@ -103,6 +178,12 @@ public String toString() {
103178
104179 sb .append ("theFirstBatch = " ).append (theFirstBatch );
105180 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+
106187 return sb .toString ();
107188 }
108189}
0 commit comments