Package io.sockit.gameserver
Class LevelDbStore
java.lang.Object
io.sockit.gameserver.LevelDbStore
- All Implemented Interfaces:
DataStore
public class LevelDbStore extends Object implements DataStore
An implementation of the DataStore interface which uses LevelDB to save/persist the Game Engine data.
-
Constructor Summary
Constructors Constructor Description LevelDbStore(File dbFolder)LevelDbStore(String dbFolder) -
Method Summary
Modifier and Type Method Description voidclose()Closes the databasevoiddelete(byte[] key)Deletes a value from the databasebyte[]get(byte[] key)reads the value associated with the key from the databaseDataIteratoriterator()Returns a DataIterator whish iterates over all the entries in the dataStorevoidopen()Opens the databasevoidput(byte[] key, byte[] value)writes a value into the database
-
Constructor Details
-
LevelDbStore
- Parameters:
dbFolder- - the folder where the LevelDB data files are saved
-
LevelDbStore
- Parameters:
dbFolder- - the folder where the LevelDB data files are saved
-
-
Method Details
-
open
Opens the database- Specified by:
openin interfaceDataStore- Throws:
IOException- -
-
close
Closes the database- Specified by:
closein interfaceDataStore- Throws:
IOException- -
-
get
public byte[] get(byte[] key)reads the value associated with the key from the database -
put
public void put(byte[] key, byte[] value)writes a value into the database -
delete
public void delete(byte[] key)Deletes a value from the database -
iterator
Description copied from interface:DataStoreReturns a DataIterator whish iterates over all the entries in the dataStore
-