public class Tablespace extends Object
| Constructor and Description |
|---|
Tablespace(String name,
byte id) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Tablespace.TablespaceRecord |
createMetadataRecord(String yamcsInstance,
Tablespace.TablespaceRecord.Builder trb)
Creates a new tablespace record and adds it to the metadata database
|
void |
dispose(YRDB rdb) |
List<Tablespace.TablespaceRecord> |
filter(Tablespace.TablespaceRecord.Type type,
String instanceName,
java.util.function.Predicate<Tablespace.TablespaceRecord.Builder> p) |
String |
getCustomDataDir() |
byte[] |
getData(byte[] key) |
String |
getDataDir() |
byte |
getId() |
String |
getName() |
YRDB |
getRdb()
Get the main database of the tablespace
|
YRDB |
getRdb(String relativePath) |
YRDB |
getRdb(String partitionDir,
boolean readOnly)
(Creates) and returns a database in the given partition directory.
|
RDBFactory |
getRdbFactory() |
List<Tablespace.TablespaceRecord> |
getTableHistograms(String instanceName,
String tableName)
Returns a list of all records of type HISTOGRAM for a given instance and table
If instanceName = tablespace name, it returns also records which do not have an instanceName specified.
|
List<Tablespace.TablespaceRecord> |
getTablePartitions(String instanceName,
String tableName)
Returns a list of all records of type TABLE_PARTITION for a given instance and table
If instanceName = tablespace name, it returns also records which do not have an instanceName specified.
|
void |
loadDb(boolean readonly) |
void |
putData(byte[] key,
byte[] value)
inserts data into the main partition
|
void |
remove(byte[] key) |
void |
removeTbsIndex(Tablespace.TablespaceRecord.Type type,
int tbsIndex) |
void |
removeTbsIndices(Tablespace.TablespaceRecord.Type type,
IntArray tbsIndexArray) |
void |
setCustomDataDir(String dataDir) |
public Tablespace(String name, byte id)
public void loadDb(boolean readonly)
throws IOException,
org.rocksdb.RocksDBException
IOExceptionorg.rocksdb.RocksDBExceptionpublic String getName()
public byte getId()
public List<Tablespace.TablespaceRecord> getTablePartitions(String instanceName, String tableName) throws org.rocksdb.RocksDBException, IOException
org.rocksdb.RocksDBExceptionIOExceptionpublic List<Tablespace.TablespaceRecord> getTableHistograms(String instanceName, String tableName) throws org.rocksdb.RocksDBException, IOException
org.rocksdb.RocksDBExceptionIOExceptionpublic List<Tablespace.TablespaceRecord> filter(Tablespace.TablespaceRecord.Type type, String instanceName, java.util.function.Predicate<Tablespace.TablespaceRecord.Builder> p) throws org.rocksdb.RocksDBException, DatabaseCorruptionException
org.rocksdb.RocksDBExceptionDatabaseCorruptionExceptionpublic Tablespace.TablespaceRecord createMetadataRecord(String yamcsInstance, Tablespace.TablespaceRecord.Builder trb) throws org.rocksdb.RocksDBException
trb - - the builder has to have all fields set except for the tbsIndex which will be assigned by this methodorg.rocksdb.RocksDBExceptionpublic String getCustomDataDir()
public YRDB getRdb(String partitionDir, boolean readOnly) throws IOException
partitionDir - readOnly - IOExceptionpublic YRDB getRdb(String relativePath) throws IOException
IOExceptionpublic YRDB getRdb()
public void dispose(YRDB rdb)
public void setCustomDataDir(String dataDir)
public String getDataDir()
public void removeTbsIndex(Tablespace.TablespaceRecord.Type type, int tbsIndex) throws org.rocksdb.RocksDBException
org.rocksdb.RocksDBExceptionpublic void removeTbsIndices(Tablespace.TablespaceRecord.Type type, IntArray tbsIndexArray) throws org.rocksdb.RocksDBException
org.rocksdb.RocksDBExceptionpublic void close()
public RDBFactory getRdbFactory()
public void putData(byte[] key,
byte[] value)
throws org.rocksdb.RocksDBException
key - value - org.rocksdb.RocksDBExceptionpublic byte[] getData(byte[] key)
throws org.rocksdb.RocksDBException
org.rocksdb.RocksDBExceptionpublic void remove(byte[] key)
throws org.rocksdb.RocksDBException
org.rocksdb.RocksDBExceptionCopyright © 2018 Space Applications Services. All rights reserved.