Class BplusIndexJsons
java.lang.Object
com.semedy.reasoner.edb.persistentstore.BplusIndexJsons
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
Modifier and TypeFieldDescriptionthe buffered file for dataBPlusTree<byte[],
ByteBuffer> the bplus tree for symbols -
Constructor Summary
ConstructorDescriptionBplusIndexJsons
(int pagesize, String dir, String name, String endtreefile, String enddatafile, boolean compress) BplusIndexJsons
(BPlusTree<byte[], ByteBuffer> btreelong) -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkSanity
(String message, boolean shadow) check sanity of treevoid
export and import jsons to remove deleted jsons from filevoid
clear()
clear storevoid
close()
close storeboolean
containsKey
(String key) does it contain a json with keyvoid
delete()
delete json from storevoid
exportJsons
(String path) export all jsons into filevoid
exportJsonsAsZip
(String path) export all jsons into filevoid
flush()
flush storeget json with keylong
getAddress
(String key) void
importJsons
(String path) import jsons from filelong
add json with key key to storevoid
read jsons from streamboolean
long
size()
return number of stored jsonsvoid
begin transactionvoid
commit transactionvoid
rollback 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:
IOException
EDBException
-
BplusIndexJsons
-
-
Method Details
-
checkSanity
check sanity of tree- Returns:
- Throws:
IOException
-
put
add json with key key to store- Parameters:
key
-data
-- Returns:
- Throws:
EDBException
IOException
-
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:
IOException
EDBException
-
clear
clear store- Throws:
IOException
EDBException
-
close
close store- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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:
IOException
EDBException
-
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:
FileNotFoundException
IOException
EDBException
org.json.JSONException
SemReasonerException
-
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:
IOException
org.json.JSONException
SemReasonerException
-
readJsonFromStream
public void readJsonFromStream(InputStream in) throws IOException, EDBException, org.json.JSONException, SemReasonerException read jsons from stream- Parameters:
in
-- Throws:
IOException
EDBException
org.json.JSONException
SemReasonerException
-