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 void
close()
Closes the databasevoid
delete(byte[] key)
Deletes a value from the databasebyte[]
get(byte[] key)
reads the value associated with the key from the databaseDataIterator
iterator()
Returns a DataIterator whish iterates over all the entries in the dataStorevoid
open()
Opens the databasevoid
put(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:
open
in interfaceDataStore
- Throws:
IOException
- -
-
close
Closes the database- Specified by:
close
in 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:DataStore
Returns a DataIterator whish iterates over all the entries in the dataStore
-