Package org.pentaho.di.core.database.map
Class DatabaseConnectionMap
java.lang.Object
org.pentaho.di.core.database.map.DatabaseConnectionMap
This class contains a map between on the one hand
the transformation name/thread the partition ID the connection group
And on the other hand
The database connection The number of times it was opened
- Author:
- Matt
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTransactionListener
(String transactionId, DatabaseTransactionListener listener) static String
createEntryKey
(String connectionGroup, String partitionID, Database database) getDatabase
(String connectionGroup, String partitionID, Database database) Deprecated.use getOrStoreIfAbsent(String, String, Database) insteadstatic DatabaseConnectionMap
getMap()
getOrStoreIfAbsent
(String connectionGroup, String partitionID, Database database) Tries to obtain an existing Database instance for specified parameters.getTransactionListeners
(String transactionId) void
removeConnection
(String connectionGroup, String partitionID, Database database) void
removeTransactionListener
(String transactionId, DatabaseTransactionListener listener) void
removeTransactionListeners
(String transactionId) void
storeDatabase
(String connectionGroup, String partitionID, Database database) Deprecated.use getOrStoreIfAbsent(String, String, Database) instead
-
Method Details
-
getInstance
-
getOrStoreIfAbsent
Tries to obtain an existing Database instance for specified parameters. If none is found, then maps the key's value to database. Similarly to ConcurrentHashMap.putIfAbsent(Object, Object) returns null if there was no value for the specified key and they mapped value otherwise.- Parameters:
connectionGroup
- connection grouppartitionID
- partition's iddatabase
- database- Returns:
- null or previous value
-
removeConnection
-
storeDatabase
@Deprecated public void storeDatabase(String connectionGroup, String partitionID, Database database) Deprecated.use getOrStoreIfAbsent(String, String, Database) instead -
getDatabase
@Deprecated public Database getDatabase(String connectionGroup, String partitionID, Database database) Deprecated.use getOrStoreIfAbsent(String, String, Database) instead -
createEntryKey
-
getMap
-
getNextTransactionId
-
addTransactionListener
-
removeTransactionListener
-
getTransactionListeners
-
removeTransactionListeners
-