Package com.mckoi.store
Class ScatteringStoreDataAccessor
java.lang.Object
com.mckoi.store.ScatteringStoreDataAccessor
An implementation of StoreDataAccessor that scatters the addressible
data resource across multiple files in the file system. When one store
data resource reaches a certain threshold size, the content 'flows' over
to the next file.
- Author:
- Tobias Downer
-
Constructor Summary
ConstructorsConstructorDescriptionScatteringStoreDataAccessor
(File path, String file_name, String first_ext, long max_slice_size) Constructs the store data accessor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
Given a file, this will convert to a scattering file store with files no larger than the maximum slice size.boolean
delete()
boolean
exists()
long
getSize()
void
open
(boolean read_only) void
read
(long position, byte[] buf, int off, int len) void
setSize
(long length) void
synch()
void
write
(long position, byte[] buf, int off, int len)
-
Constructor Details
-
Method Details
-
convertToScatteringStore
Given a file, this will convert to a scattering file store with files no larger than the maximum slice size.- Throws:
IOException
-
open
- Throws:
IOException
-
close
- Throws:
IOException
-
delete
public boolean delete() -
exists
public boolean exists() -
read
- Throws:
IOException
-
write
- Throws:
IOException
-
setSize
- Throws:
IOException
-
getSize
- Throws:
IOException
-
synch
- Throws:
IOException
-