public class LevelDBTableService extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LevelDBTableService.KeyValueDBComparator
A comparator for the keys of key/value pairs.
|
static class |
LevelDBTableService.TableStats
Represents LevelDB's table stats.
|
| Constructor and Description |
|---|
LevelDBTableService()
Protect the constructor as this class needs to be singleton, but keep it package visible for testing.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearTables()
only use in unit test since the singleton may be reused for multiple tests.
|
void |
dropTable(String name) |
void |
ensureTableExists(String tableName) |
static LevelDBTableService |
getInstance() |
org.iq80.leveldb.DB |
getTable(String tableName) |
Map<TableId,LevelDBTableService.TableStats> |
getTableStats()
Gets tables stats.
|
org.iq80.leveldb.WriteOptions |
getWriteOptions() |
Collection<String> |
list() |
void |
setConfiguration(CConfiguration config)
For guice injecting configuration object to this singleton.
|
public LevelDBTableService()
public static LevelDBTableService getInstance()
@Inject public void setConfiguration(CConfiguration config) throws IOException
IOExceptionpublic void clearTables()
public Collection<String> list() throws Exception
Exceptionpublic Map<TableId,LevelDBTableService.TableStats> getTableStats() throws Exception
Exceptionpublic org.iq80.leveldb.WriteOptions getWriteOptions()
public org.iq80.leveldb.DB getTable(String tableName) throws IOException
IOExceptionpublic void ensureTableExists(String tableName) throws IOException
IOExceptionpublic void dropTable(String name) throws IOException
IOExceptionCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.