|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectseda.sandStorm.core.SimpleSink
seda.sandStorm.lib.aDisk.AFileImpl
seda.sandStorm.lib.aDisk.AFileTPImpl
class AFileTPImpl
This is an implementation of AFile which uses a pool of threads which perform blocking I/O (through the java.io.RandomAccessFile class) on files. This is a portable implementation but is not intended to be high-performance.
AFile| Field Summary | |
|---|---|
private AFile |
afile
|
private boolean |
closed
|
private SinkIF |
compQ
|
private FiniteQueue |
eventQ
|
private java.io.File |
f
|
(package private) java.io.RandomAccessFile |
raf
|
private boolean |
readOnly
|
private AFileTPTM |
tm
|
| Constructor Summary | |
|---|---|
AFileTPImpl(AFile afile,
java.lang.String fname,
SinkIF compQ,
boolean create,
boolean readOnly,
AFileTPTM tm)
Create an AFileTPIMpl with the given AFile, filename, completion queue, create/readOnly flags, and Thread Manager. |
|
| Method Summary | |
|---|---|
void |
close()
Close the file after all enqueued requests have completed. |
boolean |
enqueue_lossy(QueueElementIF req)
Enqueues the given request (which must be an AFileRequest) to the file. |
void |
enqueue_many(QueueElementIF[] elements)
Enqueues the given requests (which must be AFileRequests) to the file. |
void |
enqueue(QueueElementIF req)
Enqueues the given request (which must be an AFileRequest) to the file. |
void |
flush()
Causes a SinkFlushedEvent to be posted on the file's completion queue when all pending requests have completed. |
(package private) QueueIF |
getQueue()
Return the per-file event queue. |
(package private) AFileStat |
stat()
Return information on the properties of the file. |
| Methods inherited from class seda.sandStorm.core.SimpleSink |
|---|
enqueue_abort, enqueue_commit, enqueue_prepare, getEnqueuePredicate, profileSize, setEnqueuePredicate, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.io.File f
java.io.RandomAccessFile raf
private AFile afile
private AFileTPTM tm
private SinkIF compQ
private FiniteQueue eventQ
private boolean readOnly
private boolean closed
| Constructor Detail |
|---|
AFileTPImpl(AFile afile,
java.lang.String fname,
SinkIF compQ,
boolean create,
boolean readOnly,
AFileTPTM tm)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void enqueue(QueueElementIF req)
throws SinkException
enqueue in interface SinkIFenqueue in class AFileImplreq - The QueueElementIF to enqueue
SinkFullException - Indicates that the sink is temporarily full.
SinkClosedException - Indicates that the sink is
no longer being serviced.
SinkExceptionpublic boolean enqueue_lossy(QueueElementIF req)
enqueue_lossy in interface SinkIFenqueue_lossy in class AFileImplreq - The QueueElementIF to enqueue
public void enqueue_many(QueueElementIF[] elements)
throws SinkException
enqueue_many in interface SinkIFenqueue_many in class AFileImplelements - The element array to enqueue
SinkFullException - Indicates that the sink is temporarily full.
SinkClosedException - Indicates that the sink is
no longer being serviced.
SinkExceptionAFileStat stat()
stat in class AFileImplpublic void close()
close in class AFileImplpublic void flush()
flush in class AFileImplQueueIF getQueue()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||