1 21 22 package org.apache.derby.impl.store.raw.log; 23 24 import org.apache.derby.iapi.reference.SQLState; 25 26 import org.apache.derby.iapi.services.monitor.ModuleControl; 27 import org.apache.derby.iapi.services.monitor.ModuleSupportable; 28 import org.apache.derby.iapi.services.sanity.SanityManager; 29 import org.apache.derby.iapi.services.io.Formatable; 30 31 import org.apache.derby.iapi.services.property.PersistentSet; 32 import org.apache.derby.iapi.store.raw.Compensation; 33 import org.apache.derby.iapi.store.raw.Loggable; 34 import org.apache.derby.iapi.store.raw.RawStoreFactory; 35 import org.apache.derby.iapi.store.raw.ScanHandle; 36 import org.apache.derby.iapi.store.raw.log.LogFactory; 37 import org.apache.derby.iapi.store.raw.log.LogInstant; 38 import org.apache.derby.iapi.store.raw.log.Logger; 39 import org.apache.derby.iapi.store.raw.log.LogScan; 40 41 import org.apache.derby.iapi.store.raw.data.DataFactory; 42 import org.apache.derby.iapi.store.raw.xact.TransactionFactory; 43 import org.apache.derby.iapi.store.raw.xact.RawTransaction; 44 import org.apache.derby.iapi.store.raw.xact.TransactionId; 45 46 import org.apache.derby.iapi.error.StandardException; 47 48 import org.apache.derby.io.StorageFile; 49 import org.apache.derby.iapi.store.access.DatabaseInstant; 50 import org.apache.derby.catalog.UUID; 51 52 import java.util.Properties ; 53 import java.io.File ; 54 55 65 66 public class ReadOnly implements LogFactory, ModuleSupportable { 67 68 private String logArchiveDirectory = null; 69 70 73 74 public Logger getLogger() { 75 return null; 76 } 77 78 82 public void recover(RawStoreFactory rawStoreFactory, 83 DataFactory dataFactory, 84 TransactionFactory transactionFactory) 85 throws StandardException 86 { 87 if (transactionFactory != null) 88 transactionFactory.useTransactionTable((Formatable)null); 89 } 90 91 94 public boolean checkpoint(RawStoreFactory rawStoreFactory, 95 DataFactory dataFactory, 96 TransactionFactory transactionFactory, 97 boolean wait) 98 { 99 return true; 100 } 101 102 public StandardException markCorrupt(StandardException originalError) { 103 return originalError; 104 } 105 106 public void flush(LogInstant where) throws StandardException { 107 } 108 109 112 113 public boolean canSupport(Properties startParams) { 114 115 String runtimeLogAttributes = startParams.getProperty(LogFactory.RUNTIME_ATTRIBUTES); 116 if (runtimeLogAttributes == null) 117 return false; 118 119 return runtimeLogAttributes.equals(LogFactory.RT_READONLY); 120 } 121 122 125 126 public LogInstant setTruncationLWM(UUID name, 127 LogInstant instant, 128 RawStoreFactory rawStoreFactory, 129 TransactionFactory transFactory) 130 throws StandardException 131 { 132 if (SanityManager.DEBUG) 133 SanityManager.THROWASSERT("functionality not implemented"); 134 135 throw StandardException.newException( 136 SQLState.STORE_FEATURE_NOT_IMPLEMENTED); 137 138 } 139 140 143 public void setTruncationLWM(UUID name, LogInstant instant) throws StandardException 144 { 145 if (SanityManager.DEBUG) 146 SanityManager.THROWASSERT("functionality not implemented"); 147 148 throw StandardException.newException( 149 SQLState.STORE_FEATURE_NOT_IMPLEMENTED); 150 } 151 152 153 156 public void removeTruncationLWM(UUID name, 157 RawStoreFactory rawStoreFactory, 158 TransactionFactory transFactory) 159 throws StandardException 160 { 161 if (SanityManager.DEBUG) 162 SanityManager.THROWASSERT("functionality not implemented"); 163 164 throw StandardException.newException( 165 SQLState.STORE_FEATURE_NOT_IMPLEMENTED); 166 } 167 168 169 172 public LogInstant getTruncationLWM(UUID name) throws StandardException 173 { 174 if (SanityManager.DEBUG) 175 SanityManager.THROWASSERT("functionality not implemented"); 176 177 throw StandardException.newException( 178 SQLState.STORE_FEATURE_NOT_IMPLEMENTED); 179 } 180 181 184 public void removeTruncationLWM(UUID name) throws StandardException 185 { 186 if (SanityManager.DEBUG) 187 SanityManager.THROWASSERT("functionality not implemented"); 188 189 throw StandardException.newException( 190 SQLState.STORE_FEATURE_NOT_IMPLEMENTED); 191 } 192 193 196 public ScanHandle openFlushedScan(DatabaseInstant i, int groupsIWant) 197 throws StandardException 198 { 199 if (SanityManager.DEBUG) 200 SanityManager.THROWASSERT("functionality not implemented"); 201 202 throw StandardException.newException( 203 SQLState.STORE_FEATURE_NOT_IMPLEMENTED); 204 } 205 206 209 public LogScan openForwardsScan(LogInstant startAt,LogInstant stopAt) 210 throws StandardException 211 { 212 if (SanityManager.DEBUG) 213 SanityManager.THROWASSERT("functionality not implemented"); 214 215 throw StandardException.newException( 216 SQLState.STORE_FEATURE_NOT_IMPLEMENTED); 217 } 218 219 221 public LogInstant getFirstUnflushedInstant() 222 { 223 if (SanityManager.DEBUG) 224 SanityManager.THROWASSERT("functionality not implemented"); 225 226 return null; 227 } 228 229 232 public LogScan openForwardsFlushedScan(LogInstant startAt) 233 throws StandardException 234 { 235 if (SanityManager.DEBUG) 236 SanityManager.THROWASSERT("functionality not implemented"); 237 238 throw StandardException.newException( 239 SQLState.STORE_FEATURE_NOT_IMPLEMENTED); 240 } 241 242 246 public void freezePersistentStore() throws StandardException 247 { 248 } 250 251 255 public void unfreezePersistentStore() throws StandardException 256 { 257 } 259 260 265 public boolean logArchived() 266 { 267 return (logArchiveDirectory != null); 268 } 269 270 273 public void getLogFactoryProperties(PersistentSet set) 274 { 275 } 277 278 public StorageFile getLogDirectory() 279 { 280 return null; 281 } 282 283 public String getCanonicalLogPath() 284 { 285 return null; 286 } 287 288 289 public void enableLogArchiveMode() 292 { 293 } 295 296 public void disableLogArchiveMode() 297 { 298 } 300 301 public void deleteOnlineArchivedLogFiles() 304 { 305 } 307 308 309 public boolean inRFR() 311 { 312 return false; 313 } 314 315 318 public void checkpointInRFR(LogInstant cinstant, long redoLWM, 319 DataFactory df) throws StandardException 320 { 321 } 323 324 325 331 public void startLogBackup(File toDir) throws StandardException 332 { 333 } 335 336 337 344 public void endLogBackup(File toDir) throws StandardException 345 { 346 } 348 349 350 354 public void abortLogBackup() 355 { 356 } 358 359 363 public void setDatabaseEncrypted(boolean flushLog) 364 { 365 } 367 368 369 381 public void startNewLogFile() throws StandardException 382 { 383 } 385 386 396 public boolean isCheckpointInLastLogFile() 397 throws StandardException 398 { 399 return false; 401 } 402 403 413 public void deleteLogFileAfterCheckpointLogFile() 414 throws StandardException 415 { 416 } 418 419 420 421 439 public boolean checkVersion(int requiredMajorVersion, 440 int requiredMinorVersion, 441 String feature) 442 throws StandardException 443 { 444 throw StandardException.newException( 446 SQLState.STORE_FEATURE_NOT_IMPLEMENTED); 447 } 448 } 449 | Popular Tags |