public class DiskBlobVersion extends Object implements BlobVersion
| Modifier | Constructor and Description |
|---|---|
protected |
DiskBlobVersion(DiskBlobStore store,
String version,
File file) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addOpenBlobs(Collection<String> set) |
void |
commit()
Makes the changes to the open blobs in this
BlobVersion available
to others. |
boolean |
equals(Object obj) |
boolean |
erase()
Reverts all committed changes to blobs from this
BlobVersion. |
protected File |
getDirectory() |
String[] |
getModifications()
Blobs that have been modified in this version.
|
protected String |
getVersion() |
int |
hashCode() |
protected boolean |
isObsolete() |
protected boolean |
mkdirs(File dir) |
BlobObject |
open(String uri)
Opens a
BlobObject for reading or writing if this
BlobVersion has not be committed. |
protected OutputStream |
openOutputStream(File file) |
protected Writer |
openWriter(File file,
boolean append) |
void |
prepare()
Prevents any further changes to the store from other threads until
BlobVersion.commit() or BlobVersion.rollback() is called from this thread. |
protected Lock |
readLock() |
void |
rollback()
Aborts all uncommitted changes to blobs, restoring the initial state of
this
BlobVersion. |
String |
toString() |
protected boolean |
unwatch(String uri,
DiskListener listener) |
protected void |
watch(String uri,
DiskListener listener) |
protected DiskBlobVersion(DiskBlobStore store, String version, File file) throws IOException
IOExceptionpublic String[] getModifications() throws IOException
BlobVersiongetModifications in interface BlobVersionIOExceptionpublic BlobObject open(String uri)
BlobVersionBlobObject for reading or writing if this
BlobVersion has not be committed. Opens a read-only
BlobObject using this version if this BlobVersion is
closed.open in interface BlobVersionpublic void prepare()
throws IOException
BlobVersionBlobVersion.commit() or BlobVersion.rollback() is called from this thread.
Checks that the blobs read or written in this BlobVersion were
not changed in another BlobVersion since they were opened.prepare in interface BlobVersionIOException - if a blob opened in this BlobVersion had since
changed.public void commit()
throws IOException
BlobVersionBlobVersion available
to others. This method can only be called at most once for a given
BlobVersion; once this method is called this state is closed and
only the modified blobs can be opened.commit in interface BlobVersionIOException - if a blob opened in this BlobVersion had since
changed.public void rollback()
BlobVersionBlobVersion.rollback in interface BlobVersionpublic boolean erase()
throws IOException
BlobVersionBlobVersion.erase in interface BlobVersiontrue if all blobs of this version were removed
successfully.IOExceptionprotected void addOpenBlobs(Collection<String> set)
protected boolean isObsolete()
throws IOException
IOExceptionprotected File getDirectory()
protected boolean mkdirs(File dir)
protected OutputStream openOutputStream(File file) throws IOException
IOExceptionprotected Writer openWriter(File file, boolean append) throws IOException
IOExceptionprotected String getVersion()
protected void watch(String uri, DiskListener listener)
protected boolean unwatch(String uri, DiskListener listener)
protected Lock readLock()
Copyright © 2016 Chair of Distributed Information Systems - University of Passau. All rights reserved.