|
| ScatteringFileStoreData (IFileSystem fileSystem, string basePath, string fileName, string fileExtention, int maxFileSlice) |
|
void | Dispose () |
|
bool | Delete () |
| Deletes the data block. More...
|
|
void | Open (bool readOnly) |
| Opens the data block and make it ready to be accessed. More...
|
|
void | Close () |
| Closes the block and make it unavailable. More...
|
|
int | Read (long position, byte[] buffer, int offset, int length) |
| Reads a given amount of data from the block, starting at the absolute position given and copying into the provided buffer. More...
|
|
void | Write (long position, byte[] buffer, int offset, int length) |
| Writes a given buffer into the block, starting at the absolute position given. More...
|
|
void | Flush () |
| Flushes the data written in the temporary store of the block to the underlying medium. More...
|
|
void | SetLength (long value) |
| Sets the length of the data block. More...
|
|
Definition at line 23 of file ScatteringFileStoreData.cs.
Deveel.Data.Store.ScatteringFileStoreData.ScatteringFileStoreData |
( |
IFileSystem |
fileSystem, |
|
|
string |
basePath, |
|
|
string |
fileName, |
|
|
string |
fileExtention, |
|
|
int |
maxFileSlice |
|
) |
| |
|
inline |
Definition at line 28 of file ScatteringFileStoreData.cs.
29 if (fileSystem == null)
30 throw new ArgumentNullException(
"fileSystem");
List< FileStoreData > fileSlices
Deveel.Data.Store.ScatteringFileStoreData.~ScatteringFileStoreData |
( |
| ) |
|
|
inlineprivate |
void Deveel.Data.Store.ScatteringFileStoreData.Close |
( |
| ) |
|
|
inline |
Closes the block and make it unavailable.
When IDisposable.Dispose is invoked this method is also called to prevent any operation before disposal.
Implements Deveel.Data.Store.IStoreData.
Definition at line 198 of file ScatteringFileStoreData.cs.
List< FileStoreData > fileSlices
readonly object objectLock
bool Deveel.Data.Store.ScatteringFileStoreData.Delete |
( |
| ) |
|
|
inline |
Deletes the data block.
- Returns
- Returns
true
if the block was successfully deleted, or false
otherwise.
Implements Deveel.Data.Store.IStoreData.
Definition at line 135 of file ScatteringFileStoreData.cs.
139 for (
int i = countFiles - 1; i >= 0; --i) {
141 bool deleteSuccess =
new FileStoreData(f).Delete();
string SliceFileName(int i)
long Deveel.Data.Store.ScatteringFileStoreData.DiscoverSize |
( |
| ) |
|
|
inlineprivate |
Definition at line 84 of file ScatteringFileStoreData.cs.
85 long runningTotal = 0;
94 runningTotal += fileLength;
string SliceFileName(int i)
bool FileExists(string path)
long GetFileSize(string path)
readonly object objectLock
void Deveel.Data.Store.ScatteringFileStoreData.Dispose |
( |
bool |
disposing | ) |
|
|
inlineprivate |
void Deveel.Data.Store.ScatteringFileStoreData.Dispose |
( |
| ) |
|
|
inline |
void Deveel.Data.Store.ScatteringFileStoreData.Flush |
( |
| ) |
|
|
inline |
void Deveel.Data.Store.ScatteringFileStoreData.Open |
( |
bool |
readOnly | ) |
|
|
inline |
Opens the data block and make it ready to be accessed.
- Parameters
-
readOnly | Indicates if the block must be open in read-only mode. |
Implements Deveel.Data.Store.IStoreData.
Definition at line 148 of file ScatteringFileStoreData.cs.
159 throw new IOException(
"File length exceeds maximum slice size setting.");
163 throw new IOException(
"Unable to convert to a scattered store because Read-only.");
167 var slice =
new FileStoreData(f);
168 slice.Open(readOnly);
171 long runningLength = slice.Length;
180 slice =
new FileStoreData(slicePart);
181 slice.Open(readOnly);
184 runningLength += slice.Length;
string SliceFileName(int i)
bool FileExists(string path)
List< FileStoreData > fileSlices
readonly object objectLock
int Deveel.Data.Store.ScatteringFileStoreData.Read |
( |
long |
position, |
|
|
byte[] |
buffer, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
| |
|
inline |
Reads a given amount of data from the block, starting at the absolute position given and copying into the provided buffer.
- Parameters
-
position | The absolute position within the data block from where to start reading. |
buffer | The destination buffer where the data read will be filled in. |
offset | The starting offset within the buffer where to start copying the data read. |
length | The desired number of bytes to read from the data block. |
- Returns
- Returns the actual number of bytes read from the data block or 0 if the end of the block was reached.
Implements Deveel.Data.Store.IStoreData.
Definition at line 206 of file ScatteringFileStoreData.cs.
220 throw new IOException(
"Store not open.");
227 int readCount =slice.Read(fileP, buffer, offset, fileLen);
231 position += readCount;
List< FileStoreData > fileSlices
readonly object objectLock
void Deveel.Data.Store.ScatteringFileStoreData.SetLength |
( |
long |
value | ) |
|
|
inline |
Sets the length of the data block.
- Parameters
-
value | The new size to set for the data block. |
If the value is less than Length this method will shrink the data block and trim the exceeding contents. If the value is more than Length then it is responsibility of the implementation of this contract to increase the contents.
Implements Deveel.Data.Store.IStoreData.
Definition at line 275 of file ScatteringFileStoreData.cs.
280 if (totalSizeToGrow < 0) {
281 throw new IOException(
"Unable to make the data area size " +
282 "smaller for this type of store.");
285 while (totalSizeToGrow > 0) {
289 long oldSliceLength = slice.Length;
293 slice.SetLength(oldSliceLength + toGrow);
296 totalSizeToGrow -= toGrow;
298 if (totalSizeToGrow > 0) {
301 slice =
new FileStoreData(sliceFile);
307 trueFileLength = value;
string SliceFileName(int i)
List< FileStoreData > fileSlices
readonly object objectLock
string Deveel.Data.Store.ScatteringFileStoreData.SliceFileName |
( |
int |
i | ) |
|
|
inlineprivate |
Definition at line 68 of file ScatteringFileStoreData.cs.
72 var fn =
new StringBuilder();
81 return Path.Combine(
BasePath, fn.ToString());
A long string in the system.
string CombinePath(string path1, string path2)
void Deveel.Data.Store.ScatteringFileStoreData.Write |
( |
long |
position, |
|
|
byte[] |
buffer, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
| |
|
inline |
Writes a given buffer into the block, starting at the absolute position given.
- Parameters
-
position | The absolute position within the data block from where to start writing. |
buffer | The data to write into the block. |
offset | The starting offset within the buffer where to start writing data from. |
length | The number of bytes to write into the data block. |
Implements Deveel.Data.Store.IStoreData.
Definition at line 240 of file ScatteringFileStoreData.cs.
252 throw new IOException(
"Store not open.");
259 slice.Write(fileP, buffer, offset, fileLen);
List< FileStoreData > fileSlices
readonly object objectLock
List<FileStoreData> Deveel.Data.Store.ScatteringFileStoreData.fileSlices |
|
private |
readonly object Deveel.Data.Store.ScatteringFileStoreData.objectLock = new object() |
|
private |
long Deveel.Data.Store.ScatteringFileStoreData.trueFileLength |
|
private |
string Deveel.Data.Store.ScatteringFileStoreData.BasePath |
|
getprivate set |
bool Deveel.Data.Store.ScatteringFileStoreData.Exists |
|
get |
int Deveel.Data.Store.ScatteringFileStoreData.FileCount |
|
get |
string Deveel.Data.Store.ScatteringFileStoreData.FileExtention |
|
getprivate set |
string Deveel.Data.Store.ScatteringFileStoreData.FileName |
|
getprivate set |
IFileSystem Deveel.Data.Store.ScatteringFileStoreData.FileSystem |
|
getprivate set |
bool Deveel.Data.Store.ScatteringFileStoreData.IsOpen |
|
getprivate set |
bool Deveel.Data.Store.ScatteringFileStoreData.IsReadOnly |
|
getprivate set |
long Deveel.Data.Store.ScatteringFileStoreData.Length |
|
get |
int Deveel.Data.Store.ScatteringFileStoreData.MaxFileSlice |
|
getprivate set |
The documentation for this class was generated from the following file: