Package org.teamapps.universaldb
Class UniversalDB
- java.lang.Object
-
- org.teamapps.universaldb.UniversalDB
-
- All Implemented Interfaces:
DataBaseMapper,TransactionHandler
public class UniversalDB extends java.lang.Object implements DataBaseMapper, TransactionHandler
-
-
Constructor Summary
Constructors Constructor Description UniversalDB(java.io.File storagePath, SchemaInfoProvider schemaInfo, FileStore fileStore, ClusterConfig clusterConfig)
-
Method Summary
-
-
-
Constructor Detail
-
UniversalDB
public UniversalDB(java.io.File storagePath, SchemaInfoProvider schemaInfo, FileStore fileStore, ClusterConfig clusterConfig) throws java.lang.Exception- Throws:
java.lang.Exception
-
-
Method Detail
-
getUserId
public static int getUserId()
-
setUserId
public static void setUserId(int userId)
-
startThreadLocalTransaction
public static void startThreadLocalTransaction()
-
getThreadLocalTransaction
public static Transaction getThreadLocalTransaction()
-
executeThreadLocalTransaction
public static void executeThreadLocalTransaction()
-
createStandalone
public static UniversalDB createStandalone(java.io.File storagePath, SchemaInfoProvider schemaInfoProvider) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createStandalone
public static UniversalDB createStandalone(java.io.File storagePath, Schema schema) throws java.io.IOException
- Throws:
java.io.IOException
-
createClusterNode
public static UniversalDB createClusterNode(java.io.File storagePath, Schema schema, ClusterConfig clusterConfig) throws java.io.IOException
- Throws:
java.io.IOException
-
createClusterNode
public static UniversalDB createClusterNode(java.io.File storagePath, ClusterConfig clusterConfig) throws java.io.IOException
- Throws:
java.io.IOException
-
executeTransaction
public void executeTransaction(ClusterTransaction transaction) throws java.io.IOException
- Throws:
java.io.IOException
-
synchronizeTransaction
public void synchronizeTransaction(ClusterTransaction transaction) throws java.io.IOException
- Throws:
java.io.IOException
-
getSchemaIndex
public SchemaIndex getSchemaIndex()
-
getDatabaseById
public DatabaseIndex getDatabaseById(int mappingId)
- Specified by:
getDatabaseByIdin interfaceDataBaseMapper
-
getCollectionIndexById
public TableIndex getCollectionIndexById(int mappingId)
- Specified by:
getCollectionIndexByIdin interfaceDataBaseMapper
-
getColumnById
public ColumnIndex getColumnById(int mappingId)
- Specified by:
getColumnByIdin interfaceDataBaseMapper
-
getCurrentTransactionId
public long getCurrentTransactionId()
- Specified by:
getCurrentTransactionIdin interfaceTransactionHandler
-
getLastTransactionId
public long getLastTransactionId()
- Specified by:
getLastTransactionIdin interfaceTransactionHandler
-
getTransactionCount
public long getTransactionCount()
- Specified by:
getTransactionCountin interfaceTransactionHandler
-
getSchema
public Schema getSchema()
- Specified by:
getSchemain interfaceTransactionHandler
-
updateSchema
public void updateSchema(Schema schema) throws java.io.IOException
- Specified by:
updateSchemain interfaceTransactionHandler- Throws:
java.io.IOException
-
getTransactions
public java.util.Iterator<byte[]> getTransactions(long startTransaction, long lastTransaction)- Specified by:
getTransactionsin interfaceTransactionHandler
-
handleTransactionSynchronizationPacket
public void handleTransactionSynchronizationPacket(TransactionPacket packet)
- Specified by:
handleTransactionSynchronizationPacketin interfaceTransactionHandler
-
getDatabaseMapper
public DataBaseMapper getDatabaseMapper()
- Specified by:
getDatabaseMapperin interfaceTransactionHandler
-
getTransactionIdProvider
public TransactionIdProvider getTransactionIdProvider()
- Specified by:
getTransactionIdProviderin interfaceTransactionHandler
-
executeTransactionRequest
public void executeTransactionRequest(TransactionRequest transactionRequest) throws java.io.IOException
- Specified by:
executeTransactionRequestin interfaceTransactionHandler- Throws:
java.io.IOException
-
-