Package com.mckoi.store
Class JournalledSystem.NonLoggingResource
- java.lang.Object
-
- com.mckoi.store.JournalledSystem.AbstractResource
-
- com.mckoi.store.JournalledSystem.NonLoggingResource
-
- All Implemented Interfaces:
JournalledResource
- Enclosing class:
- JournalledSystem
private final class JournalledSystem.NonLoggingResource extends JournalledSystem.AbstractResource
An implementation of AbstractResource that doesn't log.
-
-
Field Summary
-
Fields inherited from class com.mckoi.store.JournalledSystem.AbstractResource
data, id, name, read_only
-
-
Constructor Summary
Constructors Constructor Description NonLoggingResource(java.lang.String name, long id, StoreDataAccessor data)
Constructs the resource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the resource.void
delete()
Deletes the resource.boolean
exists()
Returns true if the resource currently exists.long
getSize()
Returns the size of this resource.void
notifyPostRecover()
void
open(boolean read_only)
Opens the resource.(package private) void
persistClose()
void
persistDelete()
void
persistPageChange(long page, int off, int len, java.io.DataInputStream din)
void
persistSetSize(long new_size)
void
read(long page_number, byte[] buf, int off)
Reads a page from the resource.void
setSize(long size)
Sets the size of the resource.void
synch()
void
write(long page_number, byte[] buf, int off, int len)
Writes a page of some previously specified size.-
Methods inherited from class com.mckoi.store.JournalledSystem.AbstractResource
getID, getPageSize, toString
-
-
-
-
Constructor Detail
-
NonLoggingResource
NonLoggingResource(java.lang.String name, long id, StoreDataAccessor data)
Constructs the resource.
-
-
Method Detail
-
persistClose
void persistClose() throws java.io.IOException
- Specified by:
persistClose
in classJournalledSystem.AbstractResource
- Throws:
java.io.IOException
-
persistDelete
public void persistDelete() throws java.io.IOException
- Specified by:
persistDelete
in classJournalledSystem.AbstractResource
- Throws:
java.io.IOException
-
persistSetSize
public void persistSetSize(long new_size) throws java.io.IOException
- Specified by:
persistSetSize
in classJournalledSystem.AbstractResource
- Throws:
java.io.IOException
-
persistPageChange
public void persistPageChange(long page, int off, int len, java.io.DataInputStream din) throws java.io.IOException
- Specified by:
persistPageChange
in classJournalledSystem.AbstractResource
- Throws:
java.io.IOException
-
synch
public void synch() throws java.io.IOException
- Specified by:
synch
in classJournalledSystem.AbstractResource
- Throws:
java.io.IOException
-
notifyPostRecover
public void notifyPostRecover()
- Specified by:
notifyPostRecover
in classJournalledSystem.AbstractResource
-
open
public void open(boolean read_only) throws java.io.IOException
Opens the resource.- Throws:
java.io.IOException
-
read
public void read(long page_number, byte[] buf, int off) throws java.io.IOException
Reads a page from the resource.- Throws:
java.io.IOException
-
write
public void write(long page_number, byte[] buf, int off, int len) throws java.io.IOException
Writes a page of some previously specified size.- Throws:
java.io.IOException
-
setSize
public void setSize(long size) throws java.io.IOException
Sets the size of the resource.- Throws:
java.io.IOException
-
getSize
public long getSize() throws java.io.IOException
Returns the size of this resource.- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
Closes the resource.- Throws:
java.io.IOException
-
delete
public void delete() throws java.io.IOException
Deletes the resource.- Throws:
java.io.IOException
-
exists
public boolean exists()
Returns true if the resource currently exists.
-
-