1 21 22 package org.apache.derby.impl.store.access.conglomerate; 23 24 import org.apache.derby.iapi.reference.SQLState; 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.conglomerate.Conglomerate; 31 import org.apache.derby.iapi.store.access.conglomerate.LogicalUndo; 32 import org.apache.derby.iapi.store.access.conglomerate.TransactionManager; 33 34 import org.apache.derby.iapi.store.access.ConglomerateController; 35 import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo; 36 import org.apache.derby.iapi.store.access.RowUtil; 37 import org.apache.derby.iapi.store.access.SpaceInfo; 38 39 import org.apache.derby.iapi.store.raw.ContainerHandle; 40 import org.apache.derby.iapi.store.raw.Page; 41 import org.apache.derby.iapi.store.raw.RecordHandle; 42 import org.apache.derby.iapi.store.raw.Transaction; 43 44 45 import org.apache.derby.iapi.types.RowLocation; 46 47 import org.apache.derby.iapi.services.io.FormatableBitSet; 48 49 import java.util.Properties ; 50 51 52 54 55 abstract class GenericController 56 { 57 61 protected OpenConglomerate open_conglom; 62 63 67 68 72 protected void getRowPositionFromRowLocation( 73 RowLocation row_loc, 74 RowPosition pos) 75 throws StandardException 76 { 77 throw StandardException.newException( 79 SQLState.HEAP_UNIMPLEMENTED_FEATURE); 80 81 } 82 83 protected void queueDeletePostCommitWork( 84 RowPosition pos) 85 throws StandardException 86 { 87 throw StandardException.newException( 89 SQLState.HEAP_UNIMPLEMENTED_FEATURE); 90 } 91 92 93 97 public void init( 98 OpenConglomerate open_conglom) 99 throws StandardException 100 { 101 if (SanityManager.DEBUG) 102 SanityManager.ASSERT(open_conglom != null); 103 104 this.open_conglom = open_conglom; 105 } 106 107 public OpenConglomerate getOpenConglom() 108 { 109 return(open_conglom); 110 } 111 112 113 118 119 public void checkConsistency() 120 throws StandardException 121 { 122 open_conglom.checkConsistency(); 123 } 124 125 public void debugConglomerate() 126 throws StandardException 127 { 128 open_conglom.debugConglomerate(); 129 } 130 131 public void getTableProperties(Properties prop) 132 throws StandardException 133 { 134 open_conglom.getTableProperties(prop); 135 } 136 137 public Properties getInternalTablePropertySet(Properties prop) 138 throws StandardException 139 { 140 return(open_conglom.getInternalTablePropertySet(prop)); 141 } 142 143 public SpaceInfo getSpaceInfo() 144 throws StandardException 145 { 146 return(open_conglom.getSpaceInfo()); 147 } 148 149 public void close() 150 throws StandardException 151 { 152 if (open_conglom != null) 153 open_conglom.close(); 154 } 155 156 public boolean isKeyed() 157 { 158 return(open_conglom.isKeyed()); 159 } 160 161 public RowLocation newRowLocationTemplate() 162 throws StandardException 163 { 164 if (open_conglom.isClosed()) 165 open_conglom.reopen(); 166 167 return(open_conglom.newRowLocationTemplate()); 168 } 169 170 173 public boolean isTableLocked() 174 { 175 return(open_conglom.isTableLocked()); 176 } 177 178 194 public long getEstimatedRowCount() 195 throws StandardException 196 { 197 if (open_conglom.isClosed()) 198 open_conglom.reopen(); 199 200 long row_count = open_conglom.getContainer().getEstimatedRowCount(0); 208 209 return( (row_count == 0) ? 1 : row_count); 210 } 211 212 230 public void setEstimatedRowCount(long count) 231 throws StandardException 232 { 233 ContainerHandle container = open_conglom.getContainer(); 234 235 if (container == null) 236 open_conglom.reopen(); 237 238 open_conglom.getContainer().setEstimatedRowCount( 239 count, 0); 240 } 241 242 246 247 } 248 | Popular Tags |