Class SimpleDataFile
java.lang.Object
com.semedy.reasoner.edb.persistentstore.bplustree.SimpleDataFile
- All Implemented Interfaces:
DataFile,AutoCloseable
Simple data file for symbol table
- Author:
- angele
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanchecks free space listbooleanchecks for double occurencesvoidclear()clear filevoidclose()Close filevoidcreate()Create a file.voiddelete()delete fileelements()iterator for the file elementsvoidflush()Flush filevoidfree(long offset) Frees up space at offsetintlength(long position) length of file piece at posbooleanopen()Open an existing file.byte[]read(long offset) Reads data at offset from file and returns itintreadInt(long position) read integer at positionvoidbegin transactionvoidcommit transactionvoidrollback transactionlongwrite(byte[] data) write data into file.longwriteCompressed(byte[] data, int originalLength) write compressed to file.
-
Constructor Details
-
SimpleDataFile
-
-
Method Details
-
transactionBegin
Description copied from interface:DataFilebegin transaction- Specified by:
transactionBeginin interfaceDataFile- Throws:
IOException
-
transactionCommit
Description copied from interface:DataFilecommit transaction- Specified by:
transactionCommitin interfaceDataFile- Throws:
IOException
-
transactionRollback
Description copied from interface:DataFilerollback transaction- Specified by:
transactionRollbackin interfaceDataFile- Throws:
IOException
-
create
Description copied from interface:DataFileCreate a file. If it exists it will be cleared. File has a header of 32 bytes- Specified by:
createin interfaceDataFile- Throws:
IOExceptionEDBException
-
open
Description copied from interface:DataFileOpen an existing file. Return true if successful.- Specified by:
openin interfaceDataFile- Returns:
- Throws:
IOException
-
checkSanity1
public boolean checkSanity1()Description copied from interface:DataFilechecks for double occurences- Specified by:
checkSanity1in interfaceDataFile- Returns:
-
checkSanity
public boolean checkSanity()Description copied from interface:DataFilechecks free space list- Specified by:
checkSanityin interfaceDataFile- Returns:
-
read
Description copied from interface:DataFileReads data at offset from file and returns it- Specified by:
readin interfaceDataFile- Returns:
- Throws:
IOException
-
free
Description copied from interface:DataFileFrees up space at offset- Specified by:
freein interfaceDataFile- Throws:
IOException
-
close
Description copied from interface:DataFileClose file- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceDataFile- Throws:
IOException
-
flush
Description copied from interface:DataFileFlush file- Specified by:
flushin interfaceDataFile- Throws:
IOException
-
readInt
Description copied from interface:DataFileread integer at position- Specified by:
readIntin interfaceDataFile- Returns:
- Throws:
IOException
-
write
Description copied from interface:DataFilewrite data into file. Returns address of data- Specified by:
writein interfaceDataFile- Returns:
- Throws:
IOException
-
writeCompressed
Description copied from interface:DataFilewrite compressed to file. Returns address of data- Specified by:
writeCompressedin interfaceDataFile- Returns:
- Throws:
IOException
-
delete
Description copied from interface:DataFiledelete file- Specified by:
deletein interfaceDataFile- Throws:
IOException
-
length
Description copied from interface:DataFilelength of file piece at pos- Specified by:
lengthin interfaceDataFile- Returns:
- Throws:
IOException
-
clear
Description copied from interface:DataFileclear file- Specified by:
clearin interfaceDataFile- Throws:
IOExceptionEDBException
-
elements
Description copied from interface:DataFileiterator for the file elements
-