class GcLog
extends java.lang.Object
FileRepository
.Modifier and Type | Field and Description |
---|---|
private java.time.Instant |
gcLogExpire |
private LockFile |
lock |
private static java.lang.String |
LOG_EXPIRY_DEFAULT |
private java.io.File |
logFile |
private boolean |
nonEmpty |
private FileRepository |
repo |
Constructor and Description |
---|
GcLog(FileRepository repo)
Construct a GcLog object for a
FileRepository |
Modifier and Type | Method and Description |
---|---|
private boolean |
autoGcBlockedByOldLockFile() |
(package private) boolean |
commit()
Commit changes to the gc log, if there have been any writes.
|
private java.time.Instant |
getLogExpiry() |
(package private) boolean |
lock()
Lock the GC log file for updates
|
(package private) void |
unlock()
Unlock (roll back) the GC log lock
|
(package private) void |
write(java.lang.String content)
Write to the pending gc log.
|
private final FileRepository repo
private final java.io.File logFile
private final LockFile lock
private java.time.Instant gcLogExpire
private static final java.lang.String LOG_EXPIRY_DEFAULT
private boolean nonEmpty
GcLog(FileRepository repo)
FileRepository
repo
- the repositoryprivate java.time.Instant getLogExpiry() throws java.text.ParseException
java.text.ParseException
private boolean autoGcBlockedByOldLockFile()
boolean lock()
true
if we hold the lockvoid unlock()
boolean commit()
void write(java.lang.String content) throws java.io.IOException
content
- The content to writejava.io.IOException