Top Description Fields Constructors Methods
org.h2.store

public Class RecoverTester

extends Object
implements Recorder
Class Inheritance
All Implemented Interfaces
org.h2.store.fs.Recorder
Imports
java.io.IOException, .OutputStreamWriter, .PrintWriter, java.sql.SQLException, java.util.HashSet, org.h2.api.ErrorCode, org.h2.engine.ConnectionInfo, .Constants, .Database, .SessionLocal, org.h2.message.DbException, org.h2.store.fs.FileUtils, .Recorder, org.h2.store.fs.rec.FilePathRec, org.h2.tools.Recover, org.h2.util.IOUtils, .StringUtils, .Utils

A tool that simulates a crash while writing to the database, and then verifies the database doesn't get corrupt.

Field Summary

Modifier and TypeField and Description
private static final RecoverTester
private final HashSet<String>
private final long
private String
private int
private volatile boolean
private int
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static synchronized void
init(String
the value of the recover test parameter
recoverTest
)

Initialize the recover test.

public void
log(int
the operation
op
,
String
the file name or file name list
fileName
,
byte[]
the data or null
data
,
long
the value or 0
x
)

Implements org.h2.store.fs.Recorder.log.

Record the method.

public void
setTestEvery(int testEvery)

private synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceback to summary
private static final RecoverTester instance
knownErrorsback to summary
private final HashSet<String> knownErrors
maxFileSizeback to summary
private final long maxFileSize
testDatabaseback to summary
private String testDatabase
testEveryback to summary
private int testEvery
testingback to summary
private volatile boolean testing
verifyCountback to summary
private int verifyCount
writeCountback to summary
private int writeCount

Constructor Detail

RecoverTesterback to summary
public RecoverTester()

Method Detail

initback to summary
public static synchronized void init(String recoverTest)

Initialize the recover test.

Parameters
recoverTest:String

the value of the recover test parameter

logback to summary
public void log(int op, String fileName, byte[] data, long x)

Implements org.h2.store.fs.Recorder.log.

Doc from org.h2.store.fs.Recorder.log.

Record the method.

Parameters
op:int

the operation

fileName:String

the file name or file name list

data:byte[]

the data or null

x:long

the value or 0

Annotations
@Override
setTestEveryback to summary
public void setTestEvery(int testEvery)
testDatabaseback to summary
private synchronized void testDatabase(String fileName, PrintWriter out)