static final class NGTransaction.LogManager extends ByteArrayOutputStream
Modifier and Type | Field and Description |
---|---|
(package private) int |
commitCount
Number of commit operation since starting up.
|
(package private) int |
current
Current file pointer in log
|
(package private) File |
dir |
private static byte[] |
emptyUTFString |
(package private) int |
garbageCount
Number of garbage operation since starting up.
|
(package private) long |
garbageTime
Cumulated time of garbage operations since starting up.
|
(package private) long |
lastGarbageDate
Date of last garbage.
|
(package private) int |
loadFromLog
Number of load from a log file.
|
private static String |
LockPathname
Coherence lock filename
|
(package private) Hashtable<Object,Operation> |
log
Memory log of all operations already committed but not reported on disk.
|
(package private) NGTransaction.LogFile[] |
logFile
log file
|
(package private) int |
logidx
Index of log file in used.
|
private String |
mode |
private Repository |
repository |
buf, count
Constructor and Description |
---|
LogManager(File dir,
Repository repository,
boolean syncOnWrite) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
backup(File backupDir)
Makes a copy of all used log files.
|
(package private) void |
commit(Hashtable<Object,Operation> ctxlog)
Reports all buffered operations in logs.
|
private void |
garbage(int idx) |
private void |
garbage(NGTransaction.LogFile logf)
Reports all 'live' operations of a particular log file in the repository, the
log file is then cleaned and closed.
|
byte[] |
getFromLog(Operation op) |
byte[] |
getFromLog(String dirName,
String name) |
String[] |
getList(String prefix) |
(package private) int |
getLogFileSize()
Returns the size of disk log in bytes.
|
byte[] |
load(String dirName,
String name) |
String |
logContent(int idx) |
String |
logCounters() |
(package private) void |
stop() |
(package private) void |
writeInt(int v) |
(package private) void |
writeUTF(String str) |
close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo
flush, write
Hashtable<Object,Operation> log
int logidx
NGTransaction.LogFile[] logFile
int current
int commitCount
int loadFromLog
int garbageCount
long garbageTime
long lastGarbageDate
private static final String LockPathname
private Repository repository
File dir
private String mode
private static final byte[] emptyUTFString
LogManager(File dir, Repository repository, boolean syncOnWrite) throws IOException
IOException
int getLogFileSize()
void backup(File backupDir) throws IOException
backupDir
- IOException
void commit(Hashtable<Object,Operation> ctxlog) throws IOException
ctxlog
- the log object.IOException
- an error occurs.public byte[] getFromLog(String dirName, String name) throws IOException
IOException
public byte[] getFromLog(Operation op) throws IOException
IOException
public byte[] load(String dirName, String name) throws IOException
IOException
public String logCounters()
public String logContent(int idx)
private final void garbage(int idx) throws IOException
IOException
private final void garbage(NGTransaction.LogFile logf) throws IOException
logf
- The log file to garbage.IOException
- an error occurs.void stop()
void writeUTF(String str)
void writeInt(int v)
Copyright © 2023 ScalAgent D.T.. All rights reserved.