Class BplusIndexJsons
java.lang.Object
com.semedy.reasoner.edb.persistentstore.BplusIndexJsons
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionthe buffered file for dataBPlusTree<byte[],ByteBuffer> the bplus tree for symbols -
Constructor Summary
ConstructorsConstructorDescriptionBplusIndexJsons(int pagesize, String dir, String name, String endtreefile, String enddatafile, boolean compress) BplusIndexJsons(BPlusTree<byte[], ByteBuffer> btreelong) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckSanity(String message, boolean shadow) check sanity of treevoidexport and import jsons to remove deleted jsons from filevoidclear()clear storevoidclose()close storebooleancontainsKey(String key) does it contain a json with keyvoiddelete()delete json from storevoidexportJsons(String path) export all jsons into filevoidexportJsonsAsZip(String path) export all jsons into filevoidflush()flush storeget json with keylonggetAddress(String key) voidimportJsons(String path) import jsons from filelongadd json with key key to storevoidread jsons from streambooleanlongsize()return number of stored jsonsvoidbegin transactionvoidcommit transactionvoidrollback last changes
-
Field Details
-
_keys
the bplus tree for symbols -
_bufferFile
the buffered file for data
-
-
Constructor Details
-
BplusIndexJsons
public BplusIndexJsons(int pagesize, String dir, String name, String endtreefile, String enddatafile, boolean compress) throws IOException, EDBException - Throws:
IOExceptionEDBException
-
BplusIndexJsons
-
-
Method Details
-
checkSanity
check sanity of tree- Returns:
- Throws:
IOException
-
put
add json with key key to store- Parameters:
key-data-- Returns:
- Throws:
EDBExceptionIOException
-
containsKey
does it contain a json with key- Parameters:
key-- Returns:
- Throws:
IOException
-
get
get json with key- Parameters:
key-- Returns:
- Throws:
IOException
-
getAddress
- Throws:
IOException
-
remove
- Throws:
IOExceptionEDBException
-
clear
clear store- Throws:
IOExceptionEDBException
-
close
close store- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
flush
flush store- Throws:
IOException
-
delete
delete json from store- Throws:
IOException
-
transactionRollback
rollback last changes- Throws:
IOException
-
transactionBegin
begin transaction- Throws:
IOException
-
transactionCommit
commit transaction- Throws:
IOExceptionEDBException
-
size
public long size()return number of stored jsons- Returns:
-
exportJsons
export all jsons into file- Parameters:
path-- Throws:
IOException
-
exportJsonsAsZip
export all jsons into file- Parameters:
path-- Throws:
IOException
-
importJsons
public void importJsons(String path) throws FileNotFoundException, IOException, EDBException, org.json.JSONException, SemReasonerException import jsons from file- Parameters:
path-- Throws:
FileNotFoundExceptionIOExceptionEDBExceptionorg.json.JSONExceptionSemReasonerException
-
cleanUp
public void cleanUp(String tempPath) throws IOException, org.json.JSONException, SemReasonerException export and import jsons to remove deleted jsons from file- Parameters:
tempPath-- Throws:
IOExceptionorg.json.JSONExceptionSemReasonerException
-
readJsonFromStream
public void readJsonFromStream(InputStream in) throws IOException, EDBException, org.json.JSONException, SemReasonerException read jsons from stream- Parameters:
in-- Throws:
IOExceptionEDBExceptionorg.json.JSONExceptionSemReasonerException
-