Class JsonFile
java.lang.Object
com.semedy.reasoner.edb.persistentstore.bplustree.JsonFile
- All Implemented Interfaces:
DataFile
,AutoCloseable
- Author:
- angele
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checks free space listboolean
checks for double occurencesvoid
clear()
clear filevoid
close()
Close filevoid
create()
Create a file.void
delete()
delete fileelements()
iterator for the file elementsvoid
flush()
Flush filevoid
free
(long offset) Frees up space at offsetint
length
(long pos) length of file piece at posboolean
open()
Open an existing file.byte[]
read
(long offset) Reads data at offset from file and returns itint
readInt
(long position) read integer at positionvoid
begin transactionvoid
commit transactionvoid
rollback transactionlong
write
(byte[] data) write data into file.long
writeCompressed
(byte[] data, int originalLength) write compressed to file.
-
Constructor Details
-
JsonFile
-
-
Method Details
-
transactionBegin
Description copied from interface:DataFile
begin transaction- Specified by:
transactionBegin
in interfaceDataFile
- Throws:
IOException
-
transactionCommit
Description copied from interface:DataFile
commit transaction- Specified by:
transactionCommit
in interfaceDataFile
- Throws:
IOException
-
transactionRollback
Description copied from interface:DataFile
rollback transaction- Specified by:
transactionRollback
in interfaceDataFile
- Throws:
IOException
-
create
Description copied from interface:DataFile
Create a file. If it exists it will be cleared. File has a header of 32 bytes- Specified by:
create
in interfaceDataFile
- Throws:
IOException
-
open
Description copied from interface:DataFile
Open an existing file. Return true if successful.- Specified by:
open
in interfaceDataFile
- Returns:
- Throws:
IOException
-
checkSanity1
public boolean checkSanity1()Description copied from interface:DataFile
checks for double occurences- Specified by:
checkSanity1
in interfaceDataFile
- Returns:
-
checkSanity
public boolean checkSanity()Description copied from interface:DataFile
checks free space list- Specified by:
checkSanity
in interfaceDataFile
- Returns:
-
read
Description copied from interface:DataFile
Reads data at offset from file and returns it- Specified by:
read
in interfaceDataFile
- Returns:
- Throws:
IOException
-
free
Description copied from interface:DataFile
Frees up space at offset- Specified by:
free
in interfaceDataFile
- Throws:
IOException
-
close
Description copied from interface:DataFile
Close file- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDataFile
- Throws:
IOException
-
flush
Description copied from interface:DataFile
Flush file- Specified by:
flush
in interfaceDataFile
- Throws:
IOException
-
readInt
Description copied from interface:DataFile
read integer at position- Specified by:
readInt
in interfaceDataFile
- Returns:
- Throws:
IOException
-
write
Description copied from interface:DataFile
write data into file. Returns address of data- Specified by:
write
in interfaceDataFile
- Returns:
- Throws:
IOException
-
writeCompressed
Description copied from interface:DataFile
write compressed to file. Returns address of data- Specified by:
writeCompressed
in interfaceDataFile
- Returns:
- Throws:
IOException
-
delete
Description copied from interface:DataFile
delete file- Specified by:
delete
in interfaceDataFile
- Throws:
IOException
-
length
Description copied from interface:DataFile
length of file piece at pos- Specified by:
length
in interfaceDataFile
- Returns:
- Throws:
IOException
-
clear
Description copied from interface:DataFile
clear file- Specified by:
clear
in interfaceDataFile
- Throws:
IOException
EDBException
-
elements
Description copied from interface:DataFile
iterator for the file elements
-