Package de.caluga.morphium.driver.wire
Class PooledDriver
- java.lang.Object
-
- de.caluga.morphium.driver.wire.DriverBase
-
- de.caluga.morphium.driver.wire.PooledDriver
-
- All Implemented Interfaces:
MorphiumDriver,Closeable,AutoCloseable
public class PooledDriver extends DriverBase
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.caluga.morphium.driver.MorphiumDriver
MorphiumDriver.DriverStatsKey
-
-
Field Summary
Fields Modifier and Type Field Description static StringdriverName
-
Constructor Summary
Constructors Constructor Description PooledDriver()
-
Method Summary
-
Methods inherited from class de.caluga.morphium.driver.wire.DriverBase
clearTransactionContext, exists, getAuthDb, getConnectionTimeout, getCredentials, getDefaultBatchSize, getDefaultJ, getDefaultReadPreference, getDefaultW, getDefaultWriteTimeout, getHeartbeatFrequency, getHostSeed, getLocalThreshold, getMaxBsonObjectSize, getMaxConnectionIdleTime, getMaxConnectionLifetime, getMaxConnections, getMaxConnectionsPerHost, getMaximums, getMaxMessageSize, getMaxWaitTime, getMaxWriteBatchSize, getMinConnections, getMinConnectionsPerHost, getNextId, getPassword, getReadTimeout, getReplicaSetName, getRetriesOnNetworkError, getSleepBetweenErrorRetries, getTransactionContext, getUser, getUuidRepresentation, heartBeatFrequency, isDefaultJ, isReplicaset, isReplicaSet, isRetryReads, isRetryWrites, isTransactionInProgress, isUseSSL, listCollections, listDatabases, setAuthDb, setConnectionTimeout, setCredentials, setDefaultBatchSize, setDefaultJ, setDefaultReadPreference, setDefaultW, setDefaultWriteTimeout, setHeartbeatFrequency, setHostSeed, setHostSeed, setLocalThreshold, setMaxBsonObjectSize, setMaxConnectionIdleTime, setMaxConnectionLifetime, setMaxConnections, setMaxConnectionsPerHost, setMaxMessageSize, setMaxWaitTime, setMaxWriteBatchSize, setMinConnections, setMinConnectionsPerHost, setPassword, setReadTimeout, setReplicaSet, setReplicaSetName, setRetriesOnNetworkError, setRetryReads, setRetryWrites, setSleepBetweenErrorRetries, setTransactionContext, setUser, setUseSSL, setUuidRepresentation, startTransaction, useSsl
-
-
-
-
Field Detail
-
driverName
public static final String driverName
- See Also:
- Constant Field Values
-
-
Method Detail
-
connect
public void connect(String replSet) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
connect
public void connect() throws MorphiumDriverException- Throws:
MorphiumDriverException
-
startHeartbeat
protected void startHeartbeat()
-
watch
public void watch(WatchCommand settings) throws MorphiumDriverException
- Specified by:
watchin interfaceMorphiumDriver- Specified by:
watchin classDriverBase- Throws:
MorphiumDriverException
-
getReadConnection
public MongoConnection getReadConnection(ReadPreference rp)
-
getPrimaryConnection
public MongoConnection getPrimaryConnection(WriteConcern wc) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
releaseConnection
public void releaseConnection(MongoConnection con)
-
isConnected
public boolean isConnected()
-
createAggregator
public <T,R> Aggregator<T,R> createAggregator(Morphium morphium, Class<? extends T> type, Class<? extends R> resultType)
-
getName
public String getName()
-
setConnectionUrl
public void setConnectionUrl(String connectionUrl)
- Specified by:
setConnectionUrlin interfaceMorphiumDriver- Overrides:
setConnectionUrlin classDriverBase
-
close
public void close()
-
killCursors
protected void killCursors(String db, String coll, long... ids) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
commitTransaction
public void commitTransaction() throws MorphiumDriverException- Throws:
MorphiumDriverException
-
abortTransaction
public void abortTransaction() throws MorphiumDriverException- Throws:
MorphiumDriverException
-
getReplsetStatus
public Map<String,Object> getReplsetStatus() throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getDBStats
public Map<String,Object> getDBStats(String db) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getCollStats
public Map<String,Object> getCollStats(String db, String coll) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
currentOp
public List<Map<String,Object>> currentOp(int threshold) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
closeIteration
public void closeIteration(MorphiumCursor crs) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getDbStats
public Map<String,Object> getDbStats(String db, boolean withStorage) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
exists
public boolean exists(String db) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getDbStats
public Map<String,Object> getDbStats(String db) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
isCapped
public boolean isCapped(String db, String coll) throws MorphiumDriverException
- Specified by:
isCappedin interfaceMorphiumDriver- Specified by:
isCappedin classDriverBase- Throws:
MorphiumDriverException
-
createBulkContext
public BulkRequestContext createBulkContext(Morphium m, String db, String collection, boolean ordered, WriteConcern wc)
-
getDriverStats
public Map<MorphiumDriver.DriverStatsKey,Double> getDriverStats()
-
-