| Constructor and Description |
|---|
FileRecordLog(File logFile)
Create a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
long |
append(String journalId,
String producerId,
InputStream in,
int length)
Append a record to this log.
|
void |
close()
Close this log.
|
boolean |
contains(long revision)
Return a flag indicating whether this record log contains a certain revision.
|
boolean |
exceeds(long size)
Return a flag indicating whether this record log exceeds a given size.
|
long |
getLastRevision()
Return the last revision.
|
long |
getPreviousRevision()
Return the previous revision.
|
void |
init(long previousRevision)
Initialize this record log by writing a header containing the
previous revision.
|
boolean |
isNew()
Return a flag indicating whether this record log is new.
|
ReadRecord |
read(NamespaceResolver resolver,
NamePathResolver npResolver)
Read the file record at the current seek position.
|
void |
seek(long revision)
Seek an entry.
|
public FileRecordLog(File logFile) throws IOException
logFile - file containing record logIOException - if an I/O error occurspublic void init(long previousRevision)
throws IOException
IOExceptionpublic boolean contains(long revision)
revision - revision to look fortrue if this record log contain a certain revision;
false otherwisepublic boolean isNew()
true if this record log is new;
false otherwisepublic boolean exceeds(long size)
public void seek(long revision)
throws IOException
revision - revision to seekIOException - if an I/O error occurspublic ReadRecord read(NamespaceResolver resolver, NamePathResolver npResolver) throws IOException
resolver - namespace resolverIOException - if an I/O error occurspublic long append(String journalId, String producerId, InputStream in, int length) throws IOException
journalId - journal identifierproducerId - producer identifierin - record to addlength - record lengthIOException - if an I/O error occurspublic long getPreviousRevision()
public long getLastRevision()
public void close()
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.