public class TransBinaryDataFile extends TransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBinaryDataFile.TxnBinFile> implements org.apache.jena.dboe.base.file.BinaryDataFile
BinaryDataFile.
A binary file that is append-only and allows only one writer at a time.
All readers see the file up to the last commit point at the time
they started. The sole writer sees more of the file.TransactionalComponentLifecycle.ComponentState<X>| Constructor and Description |
|---|
TransBinaryDataFile(org.apache.jena.dboe.base.file.BinaryDataFile binFile,
ComponentId cid,
org.apache.jena.dboe.base.file.BufferChannel bufferChannel)
Create a transactional BinaryDataFile over a base implementation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanStart() |
void |
close() |
void |
finishRecovery() |
boolean |
isEmpty() |
boolean |
isOpen() |
long |
length() |
void |
open() |
int |
read(long posn,
byte[] b,
int start,
int length) |
void |
recover(ByteBuffer ref) |
void |
startRecovery() |
void |
sync() |
void |
truncate(long size)
Truncate only supported for an abort - this transactional version of
BinaryDataFile will not truncate to earlier than the committed length. |
long |
write(byte[] b,
int start,
int length) |
abort, attach, begin, commit, commitEnd, commitPrepare, complete, detach, getComponentId, getComponentState, promote, setComponentState, shutdownequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitread, writepublic TransBinaryDataFile(org.apache.jena.dboe.base.file.BinaryDataFile binFile, ComponentId cid, org.apache.jena.dboe.base.file.BufferChannel bufferChannel)
public void startRecovery()
startRecovery in interface TransactionalComponentstartRecovery in class TransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBinaryDataFile.TxnBinFile>public void recover(ByteBuffer ref)
recover in interface TransactionalComponentrecover in class TransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBinaryDataFile.TxnBinFile>public void finishRecovery()
finishRecovery in interface TransactionalComponentfinishRecovery in class TransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBinaryDataFile.TxnBinFile>public void cleanStart()
cleanStart in interface TransactionalComponentpublic void open()
open in interface org.apache.jena.dboe.base.file.BinaryDataFilepublic boolean isOpen()
isOpen in interface org.apache.jena.dboe.base.file.BinaryDataFilepublic int read(long posn,
byte[] b,
int start,
int length)
read in interface org.apache.jena.dboe.base.file.BinaryDataFilepublic long write(byte[] b,
int start,
int length)
write in interface org.apache.jena.dboe.base.file.BinaryDataFilepublic void truncate(long size)
BinaryDataFile will not truncate to earlier than the committed length.truncate in interface org.apache.jena.dboe.base.file.BinaryDataFilepublic void sync()
sync in interface org.apache.jena.atlas.lib.Syncsync in interface org.apache.jena.dboe.base.file.BinaryDataFilepublic void close()
close in interface org.apache.jena.atlas.lib.Closeableclose in interface org.apache.jena.dboe.base.file.BinaryDataFilepublic long length()
length in interface org.apache.jena.dboe.base.file.BinaryDataFilepublic boolean isEmpty()
isEmpty in interface org.apache.jena.dboe.base.file.BinaryDataFileLicensed under the Apache License, Version 2.0