1 21 22 package org.apache.derby.impl.store.access.heap; 23 24 import org.apache.derby.iapi.store.access.ScanInfo; 25 26 import org.apache.derby.iapi.error.StandardException; 27 28 import org.apache.derby.iapi.reference.SQLState; 29 30 import org.apache.derby.iapi.services.io.FormatableBitSet; 31 import org.apache.derby.iapi.services.i18n.MessageService; 32 import java.util.Properties ; 33 34 44 class HeapScanInfo implements ScanInfo 45 { 46 49 private int stat_numpages_visited = 0; 50 private int stat_numrows_visited = 0; 51 private int stat_numrows_qualified = 0; 52 private int stat_numColumnsFetched = 0; 53 private FormatableBitSet stat_validColumns = null; 54 55 56 HeapScanInfo(HeapScan scan) 57 { 58 stat_numpages_visited = scan.getNumPagesVisited(); 60 stat_numrows_visited = scan.getNumRowsVisited(); 61 stat_numrows_qualified = scan.getNumRowsQualified(); 62 63 stat_validColumns = 64 (scan.getScanColumnList() == null ? 65 null : ((FormatableBitSet) scan.getScanColumnList().clone())); 66 67 if (stat_validColumns == null) 68 { 69 stat_numColumnsFetched = ((Heap) scan.getOpenConglom().getConglomerate()).format_ids.length; 70 } 71 else 72 { 73 for (int i = 0; i < stat_validColumns.size(); i++) 74 { 75 if (stat_validColumns.get(i)) 76 stat_numColumnsFetched++; 77 } 78 } 79 80 } 81 82 114 public Properties getAllScanInfo(Properties prop) 115 throws StandardException 116 { 117 if (prop == null) 118 prop = new Properties (); 119 120 prop.put( 121 MessageService.getTextMessage(SQLState.STORE_RTS_SCAN_TYPE), 122 MessageService.getTextMessage(SQLState.STORE_RTS_HEAP)); 123 prop.put( 124 MessageService.getTextMessage(SQLState.STORE_RTS_NUM_PAGES_VISITED), 125 Integer.toString(stat_numpages_visited)); 126 prop.put( 127 MessageService.getTextMessage(SQLState.STORE_RTS_NUM_ROWS_VISITED), 128 Integer.toString(stat_numrows_visited)); 129 prop.put( 130 MessageService.getTextMessage(SQLState.STORE_RTS_NUM_ROWS_QUALIFIED), 131 Integer.toString(stat_numrows_qualified)); 132 prop.put( 133 MessageService.getTextMessage(SQLState.STORE_RTS_NUM_COLUMNS_FETCHED), 134 Integer.toString(stat_numColumnsFetched)); 135 prop.put( 136 MessageService.getTextMessage(SQLState.STORE_RTS_COLUMNS_FETCHED_BIT_SET), 137 (stat_validColumns == null ? 138 MessageService.getTextMessage(SQLState.STORE_RTS_ALL) : 139 stat_validColumns.toString())); 140 141 return(prop); 142 } 143 } 144 | Popular Tags |