1 21 22 package org.apache.derby.impl.store.access.btree; 23 24 import java.io.PrintStream ; 25 26 import org.apache.derby.iapi.services.sanity.SanityManager; 27 28 import org.apache.derby.iapi.error.StandardException; 29 30 import org.apache.derby.iapi.store.access.ScanController; 31 import org.apache.derby.iapi.store.access.RowUtil; 32 33 import org.apache.derby.iapi.types.DataValueDescriptor; 34 35 36 44 45 public class SearchParameters 46 { 47 48 52 public static final int POSITION_LEFT_OF_PARTIAL_KEY_MATCH = 1; 53 54 58 public static final int POSITION_RIGHT_OF_PARTIAL_KEY_MATCH = -1; 59 60 64 public DataValueDescriptor[] searchKey; 65 66 102 int partial_key_match_op; 103 104 111 public DataValueDescriptor[] template; 112 113 117 public OpenBTree btree; 118 119 122 public int resultSlot; 123 124 128 public boolean resultExact; 129 130 133 public boolean searchForOptimizer; 134 135 141 public float left_fraction; 142 143 149 public float current_fraction; 150 151 156 public SearchParameters( 157 DataValueDescriptor[] searchKey, 158 int partial_key_match_op, 159 DataValueDescriptor[] template, 160 OpenBTree btree, 161 boolean searchForOptimizer) 162 throws StandardException 163 { 164 this.searchKey = searchKey; 165 this.partial_key_match_op = partial_key_match_op; 166 this.template = template; 167 this.btree = btree; 168 this.resultSlot = 0; 169 this.resultExact = false; 170 this.searchForOptimizer = searchForOptimizer; 171 172 if (this.searchForOptimizer) 173 { 174 this.left_fraction = 0; 175 this.current_fraction = 1; 176 } 177 178 if (SanityManager.DEBUG) 179 { 180 SanityManager.ASSERT(partial_key_match_op == -1|| 182 partial_key_match_op == 1); 183 } 184 } 185 186 public String toString() 187 { 188 if (SanityManager.DEBUG) 189 { 190 String string = 191 "key = " + RowUtil.toString(searchKey) + ";" + 192 "op = " + (partial_key_match_op == 1 ? "GE" : 193 (partial_key_match_op == -1 ? "GT" : 194 "BAD OP:" + partial_key_match_op)) + ";" + 195 "template = " + RowUtil.toString(template) + ";" + 196 "Slot = " + resultSlot + ";" + 199 "Exact = " + resultExact + ";"; 200 201 return(string); 202 } 203 else 204 { 205 return(null); 206 } 207 } 208 } 209 | Popular Tags |