| 1 package com.daffodilwoods.daffodildb.server.sessionsystem.sessioncondition; 2 3 import java.util.*; 4 5 import com.daffodilwoods.daffodildb.server.datasystem.interfaces.*; 6 import com.daffodilwoods.daffodildb.server.sql99.expression. 7 booleanvalueexpression.*; 8 import com.daffodilwoods.database.resource.DException; 9 import com.daffodilwoods.daffodildb.server.datasystem.interfaces. 10 _IndexIteratorInfo; 11 import com.daffodilwoods.daffodildb.server.sql99.common.TableDetails; 12 import com.daffodilwoods.daffodildb.server.sql99.common._KeyColumnInformation; 13 import java.util.Arrays ; 14 import com.daffodilwoods.daffodildb.server.datasystem.utility._Record; 15 import com.daffodilwoods.daffodildb.server.sql99.dql.execution._OrderCount; 16 import com.daffodilwoods.daffodildb.server.sql99.dql.iterator.*; 17 import com.daffodilwoods.database.sqlinitiator._Order; 18 import com.daffodilwoods.database.utility.*; 19 import com.daffodilwoods.daffodildb.server.datasystem.utility.*; 20 import com.daffodilwoods.daffodildb.server.sql99.common.*; 21 22 import com.daffodilwoods.daffodildb.server.sql99.dql.queryexpression.*; 23 import com.daffodilwoods.database.resource.*; 24 import com.daffodilwoods.database.sqlinitiator.*; 25 import com.daffodilwoods.daffodildb.client.*; 26 import com.daffodilwoods.daffodildb.server.sql99.utils.*; 27 import com.daffodilwoods.daffodildb.utils.field.FieldBase; 28 import com.daffodilwoods.daffodildb.utils.comparator.SuperComparator; 29 30 public class NonIndexSessionConditionIterator 31 implements _Iterator, _TableOperations, _UserTableOperations, 32 _IndexIteratorInfo { 33 34 _Iterator nonIndexedIterator; 35 ConditionVariableValue nonIndexConditionVariableValue; 36 _Iterator backUpIterator; 37 38 public NonIndexSessionConditionIterator(_Iterator nonIndexedIterator0) { 39 this.nonIndexedIterator = nonIndexedIterator0; 40 backUpIterator = nonIndexedIterator0; 41 } 42 43 public NonIndexSessionConditionIterator(_Iterator nonIndexedIterator0, 44 ConditionVariableValue 45 nonIndexConditionVariableValue0) { 46 if (nonIndexedIterator0 == null) 47 Thread.dumpStack(); 48 this.nonIndexedIterator = nonIndexedIterator0; 49 this.nonIndexConditionVariableValue = nonIndexConditionVariableValue0; 50 backUpIterator = nonIndexedIterator0; 51 } 52 53 public boolean first() throws DException { 54 55 try { 56 if (!nonIndexedIterator.first()) { 57 return false; 58 } 59 60 while (nonIndexConditionVariableValue.run().hashCode() != 0) { 61 if (!nonIndexedIterator.next()) { 62 return false; 63 } 64 } 65 } 66 catch (DException ex) { 67 if (ex.getDseCode().equalsIgnoreCase("DSE2004")) 68 return next(); 69 throw ex; 70 } 71 return true; 72 } 73 74 public boolean last() throws DException { 75 try { 76 if (!nonIndexedIterator.last()) 77 return false; 78 while (nonIndexConditionVariableValue.run().hashCode() != 0) 79 if (!nonIndexedIterator.previous()) 80 return false; 81 } 82 catch (DException ex) { 83 if (ex.getDseCode().equalsIgnoreCase("DSE2004")) 84 return previous(); 85 throw ex; 86 } 87 88 return true; 89 } 90 91 public void setKeyCount(Object [][] tableAndKeyCount) throws DException { 92 nonIndexedIterator.setKeyCount(tableAndKeyCount); 93 } 94 95 public boolean next() throws DException { 96 try { 97 do { 98 if (!nonIndexedIterator.next()) { 99 return false; 100 } 101 } 102 while (nonIndexConditionVariableValue.run().hashCode() != 0); 103 } 104 catch (DException ex) { 105 if (ex.getDseCode().equalsIgnoreCase("DSE2004")) 106 return next(); 107 throw ex; 108 } 109 return true; 110 } 111 112 public boolean previous() throws DException { 113 int result = 0; 114 try { 115 do { 116 if (!nonIndexedIterator.previous()) { 117 return false; 118 } 119 result = nonIndexConditionVariableValue.run().hashCode(); 120 } 121 while (result != 0); 122 } 123 catch (DException ex) { 124 if (ex.getDseCode().equalsIgnoreCase("DSE2004")) 125 return previous(); 126 throw ex; 127 } 128 129 return true; 130 } 131 132 public boolean seekFromTop(booleanvalueexpression condition) throws 133 DException { 134 throw new UnsupportedOperationException (); 135 } 136 137 public boolean seekFromBottom(booleanvalueexpression condition) throws 138 DException { 139 throw new UnsupportedOperationException (); 140 } 141 142 public Object getColumnValues(_Reference[] leftColumnReferences) throws 143 DException { 144 return nonIndexedIterator.getColumnValues(leftColumnReferences); 145 } 146 147 public String toString() { 148 String str = "NONINDEXEDFILTERITERATOR["; 149 str += nonIndexedIterator + "]"; 150 str += nonIndexedIterator.getClass() + "]"; 151 str += nonIndexConditionVariableValue + "]"; 152 return str; 153 } 154 155 public void setConditionVariableValue(_Reference[] references, 156 Object [] values, int priority) throws 157 DException { 158 this.nonIndexConditionVariableValue.setVariableValues(references, values, 159 priority); 160 nonIndexedIterator.setConditionVariableValue(references, values, priority); 161 } 162 163 public boolean seekFromBottomAbsolute(_IndexPredicate parm1) throws com. 164 daffodilwoods.database.resource.DException { 165 return nonIndexedIterator.seekFromBottomRelative(parm1); 166 } 167 168 public boolean seekFromBottomRelative(Object indexKey) throws com. 169 daffodilwoods.database.resource.DException { 170 return nonIndexedIterator.seekFromBottomRelative(indexKey); 171 } 172 173 public Object getKey() throws com.daffodilwoods.database.resource.DException { 174 return nonIndexedIterator.getKey(); 175 } 176 177 public void move(Object parm1) throws com.daffodilwoods.database.resource. 178 DException { 179 nonIndexedIterator.move(parm1); 180 } 181 182 public Object getColumnValues(int[] parm1) throws com.daffodilwoods.database. 183 resource.DException { 184 return nonIndexedIterator.getColumnValues(parm1); 185 } 186 187 public _Record getRecord() throws com.daffodilwoods.database.resource. 188 DException { 189 return nonIndexedIterator.getRecord(); 190 } 191 192 public Object getColumnValues() throws DException { 193 return nonIndexedIterator.getColumnValues(); 194 } 195 196 public void insert(Object parm1) throws com.daffodilwoods.database.resource. 197 DException { 198 ( (_TableOperations) nonIndexedIterator).insert(parm1); 199 } 200 201 public void update(Object parm1) throws com.daffodilwoods.database.resource. 202 DException { 203 ( (_TableOperations) nonIndexedIterator).update(parm1); 204 } 205 206 public void update(int[] parm1, Object [] parm2) throws com.daffodilwoods. 207 database.resource.DException { 208 ( (_TableOperations) nonIndexedIterator).update(parm1, parm2); 209 } 210 211 public void delete() throws com.daffodilwoods.database.resource.DException { 212 ( (_TableOperations) nonIndexedIterator).delete(); 213 } 214 215 public void insert(_DatabaseUser parm1, Object parm2) throws com. 216 daffodilwoods.database.resource.DException { 217 ( (_UserTableOperations) nonIndexedIterator).insert(parm1, parm2); 218 } 219 220 public void update(_DatabaseUser parm1, Object parm2) throws com. 221 daffodilwoods.database.resource.DException { 222 ( (_UserTableOperations) nonIndexedIterator).update(parm1, parm2); 223 } 224 225 public void update(_DatabaseUser parm1, int[] parm2, Object [] parm3) throws 226 com.daffodilwoods.database.resource.DException { 227 ( (_UserTableOperations) nonIndexedIterator).update(parm1, parm2, parm3); 228 } 229 230 public void delete(_DatabaseUser parm1) throws com.daffodilwoods.database. 231 resource.DException { 232 ( (_UserTableOperations) nonIndexedIterator).delete(parm1); 233 } 234 235 public TableDetails[] getTableDetails() throws com.daffodilwoods.database. 236 resource.DException { 237 return nonIndexedIterator.getTableDetails(); 238 } 239 240 public _Iterator getBaseIterator(ColumnDetails column) throws com. 241 daffodilwoods.database.resource.DException { 242 return nonIndexedIterator.getBaseIterator(column); 243 } 244 245 public _KeyColumnInformation[] getKeyColumnInformations() throws DException { 246 return nonIndexedIterator.getKeyColumnInformations(); 247 } 248 249 public Object [] getUniqueColumnReference() throws DException { 250 return backUpIterator.getUniqueColumnReference(); 251 } 252 253 public boolean seek(Object indexKey) throws DException { 254 return nonIndexedIterator.seek(indexKey); 255 } 256 257 public boolean seekFromTop(_IndexPredicate[] parm1) throws com.daffodilwoods. 258 database.resource.DException { 259 return nonIndexedIterator.seekFromTop(parm1); 260 } 261 262 public boolean seekFromBottom(_IndexPredicate[] parm1) throws com. 263 daffodilwoods.database.resource.DException { 264 return nonIndexedIterator.seekFromBottom(parm1); 265 } 266 267 public boolean seekFromTopRelative(Object indexKey) throws com.daffodilwoods. 268 database.resource.DException { 269 return nonIndexedIterator.seekFromTopRelative(indexKey); 270 } 271 272 public Object getColumnValues(_Reference references) throws DException { 273 return nonIndexedIterator.getColumnValues(references); 274 } 275 276 public int getBtreeIndex() throws com.daffodilwoods.database.resource. 277 DException { 278 return ( (_IndexIteratorInfo) nonIndexedIterator).getBtreeIndex(); 279 } 280 281 boolean test = false; 282 283 public _OrderCount getOrderCounts() throws DException { 284 285 return nonIndexedIterator.getOrderCounts(); 286 } 287 288 public _Order getDefaultOrder() throws DException { 289 return nonIndexedIterator.getDefaultOrder(); 290 } 291 292 public boolean locateKey(Object parm1, boolean parm2) throws com. 293 daffodilwoods.database.resource.DException { 294 if ( ( (_IndexIteratorInfo) nonIndexedIterator).locateKey(parm1, parm2)) 295 return nonIndexConditionVariableValue.run().hashCode() != 0 ? 296 parm2 ? next() : previous() : true; 297 return false; 298 } 299 300 public void ensureRecordInMemory() throws com.daffodilwoods.database.resource. 301 DException { 302 ( (_IndexIteratorInfo) nonIndexedIterator).ensureRecordInMemory(); 303 } 304 305 public void moveOnActualKey(Object parm1) throws com.daffodilwoods.database. 306 resource.DException { 307 ( (_IndexIteratorInfo) nonIndexedIterator).moveOnActualKey(parm1); 308 } 309 310 public Object getActualKey() throws com.daffodilwoods.database.resource. 311 DException { 312 return ( (_IndexIteratorInfo) nonIndexedIterator).getActualKey(); 313 } 314 315 public _ExecutionPlan getExecutionPlan() throws DException { 316 _ExecutionPlan cplan = nonIndexedIterator.getExecutionPlan(); 317 _ExecutionPlan cplans[] = cplan == null ? null : new _ExecutionPlan[] { 318 cplan}; 319 ExecutionPlan plan = new ExecutionPlan("NonIndexedFilterIterator", cplans, 320 "" + nonIndexConditionVariableValue, null, null); 321 return plan; 322 } 323 324 public boolean seekKeyAddress(Object parm1) throws com.daffodilwoods.database. 325 resource.DException { 326 327 throw new java.lang.UnsupportedOperationException ( 328 "Method seekKeyAddress() not yet implemented."); 329 } 330 331 public Object getPhysicalAddress() throws com.daffodilwoods.database.resource. 332 DException { 333 return ( (_IndexIteratorInfo) nonIndexedIterator).getPhysicalAddress(); 334 } 335 336 public _Iterator getForeignKeyIterator() throws DException { 337 return nonIndexedIterator; 338 } 339 340 public ExecutionPlanForBrowser getExecutionPlanForBrowser() throws DException { 341 ExecutionPlanForBrowser cplan = nonIndexedIterator. 342 getExecutionPlanForBrowser(); 343 ExecutionPlanForBrowser cplans[] = cplan == null ? null : 344 new ExecutionPlanForBrowser[] { 345 cplan}; 346 ExecutionPlanForBrowser plan = new ExecutionPlanForBrowser("Filter " + 347 nonIndexConditionVariableValue, "NonIndexedFilterIterator", cplans, null, null, null); 348 return plan; 349 } 350 351 public SuperComparator getComparator() { 352 return ( (_IndexIteratorInfo) nonIndexedIterator).getComparator(); 353 } 354 355 public SuperComparator getObjectComparator() throws com.daffodilwoods. 356 database.resource.DException { 357 return ( (_IndexIteratorInfo) nonIndexedIterator).getObjectComparator(); 358 } 359 360 public _Iterator getBaseIteratorHasRecord(ColumnDetails columnDetails) throws 361 DException { 362 return nonIndexedIterator.getBaseIteratorHasRecord(columnDetails); 363 } 364 365 public Object [][] getFunctionalColumnMapping() throws DException { 366 throw new UnsupportedOperationException ( 367 "getFunctionalColumnMapping() Not Supported"); 368 } 369 370 public FieldBase field(_Reference reference) throws com.daffodilwoods. 371 database.resource.DException { 372 throw new java.lang.UnsupportedOperationException ( 373 "Method not yet implemented."); 374 } 375 376 public FieldBase[] fields(_Reference[] references) throws com.daffodilwoods. 377 database.resource.DException { 378 throw new java.lang.UnsupportedOperationException ( 379 "Method fields() not yet implemented."); 380 } 381 382 public FieldBase[] fields(int[] columns) throws com.daffodilwoods.database. 383 resource.DException { 384 throw new java.lang.UnsupportedOperationException ( 385 "Method fields() not yet implemented."); 386 } 387 388 public void releaseResource() throws DException { 389 } 390 public byte[] getByteKey() throws DException{ 391 return null; 392 } 393 public void moveByteKey(byte[] key) throws DException{ 394 395 } 396 public void deleteBlobClobRecord( _DatabaseUser user) throws com.daffodilwoods.database.resource.DException { 397 ( (_TableOperations) nonIndexedIterator).deleteBlobClobRecord(user) ; 398 } 399 400 public void setSpecificUnderlyingReferences(_Reference[] specificUnderlyingReferences) throws DException{ 401 throw new java.lang.UnsupportedOperationException ( 402 "Method not yet implemented."); 403 } 404 405 406 } 407 | Popular Tags |