public class TempFileBucket extends BaseFileBucket implements Bucket, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
protected FilenameGenerator |
generator |
fileRestartCounter, MAGIC, tempDir| Modifier | Constructor and Description |
|---|---|
protected |
TempFileBucket() |
protected |
TempFileBucket(java.io.DataInputStream dis) |
|
TempFileBucket(long id,
FilenameGenerator generator) |
protected |
TempFileBucket(long id,
FilenameGenerator generator,
boolean deleteOnFree)
Constructor for the TempFileBucket object
Subclasses can call this constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
createFileOnly()
If true, we will fail if the file already exist.
|
RandomAccessBucket |
createShadow()
Create a shallow read-only copy of this bucket, using different
objects but using the same external storage.
|
protected boolean |
deleteOnExit() |
protected boolean |
deleteOnFree() |
boolean |
equals(java.lang.Object obj) |
java.io.File |
getFile()
Returns the file object this buckets data is kept in.
|
int |
hashCode() |
protected void |
innerResume(ClientContext context) |
boolean |
isReadOnly()
Is the bucket read-only?
|
protected int |
magic() |
void |
onResume(ClientContext context)
Called after restarting.
|
protected boolean |
persistent() |
void |
setReadOnly()
Make the bucket read-only.
|
void |
storeTo(java.io.DataOutputStream dos)
Write enough data to reconstruct the Bucket, or throw UnsupportedOperationException.
|
protected boolean |
tempFileAlreadyExists()
If true, then the file is temporary and must already exist, so we will just open it.
|
deleteFile, free, free, getInputStream, getInputStreamUnbuffered, getName, getOutputStream, getOutputStreamUnbuffered, getPersistentTempID, getTempDir, getTempfile, setDeleteOnExit, setTempDir, size, split, toRandomAccessBuffer, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitfree, getInputStream, getInputStreamUnbuffered, getName, getOutputStream, getOutputStreamUnbuffered, sizeprotected transient FilenameGenerator generator
public TempFileBucket(long id,
FilenameGenerator generator)
protected TempFileBucket(long id,
FilenameGenerator generator,
boolean deleteOnFree)
deleteOnExit - Set if you want the bucket deleted on shutdown. Passed to
the parent BaseFileBucket. You must also override deleteOnExit() and
implement your own createShadow()!deleteOnFree - True for a normal temp bucket, false for a shadow.protected TempFileBucket()
protected TempFileBucket(java.io.DataInputStream dis)
throws java.io.IOException,
StorageFormatException
java.io.IOExceptionStorageFormatExceptionprotected boolean createFileOnly()
BaseFileBucketcreateFileOnly in class BaseFileBucketprotected boolean deleteOnFree()
deleteOnFree in class BaseFileBucketpublic java.io.File getFile()
BaseFileBucketgetFile in class BaseFileBucketpublic boolean isReadOnly()
BucketisReadOnly in interface Bucketpublic void setReadOnly()
BucketsetReadOnly in interface Bucketprotected boolean deleteOnExit()
deleteOnExit in class BaseFileBucketpublic RandomAccessBucket createShadow()
BucketcreateShadow in interface BucketcreateShadow in interface RandomAccessBucketprotected void innerResume(ClientContext context) throws ResumeFailedException
ResumeFailedExceptionpublic final void onResume(ClientContext context) throws ResumeFailedException
BucketonResume in interface BucketonResume in class BaseFileBucketcontext - All the necessary runtime support will be on this object.ResumeFailedExceptionprotected boolean persistent()
protected boolean tempFileAlreadyExists()
BaseFileBuckettempFileAlreadyExists in class BaseFileBucketpublic void storeTo(java.io.DataOutputStream dos)
throws java.io.IOException
BucketstoreTo in interface BucketstoreTo in class BaseFileBucketjava.io.IOExceptionprotected int magic()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object