public class InMemoryDriver extends Object implements MorphiumDriver
InMemory implementation of the MorphiumDriver interface. can be used for testing or caching. Does not cover all functionality yet.
| Constructor and Description |
|---|
InMemoryDriver() |
public void setCredentials(String db, String login, char[] pwd)
setCredentials in interface MorphiumDriverpublic int getDefaultWriteTimeout()
getDefaultWriteTimeout in interface MorphiumDriverpublic void setDefaultWriteTimeout(int wt)
setDefaultWriteTimeout in interface MorphiumDriverpublic boolean isReplicaset()
isReplicaset in interface MorphiumDriverpublic String[] getCredentials(String db)
getCredentials in interface MorphiumDriverpublic boolean isDefaultFsync()
isDefaultFsync in interface MorphiumDriverpublic void setDefaultFsync(boolean j)
setDefaultFsync in interface MorphiumDriverpublic String[] getHostSeed()
getHostSeed in interface MorphiumDriverpublic void setHostSeed(String... host)
setHostSeed in interface MorphiumDriverpublic int getMaxConnectionsPerHost()
getMaxConnectionsPerHost in interface MorphiumDriverpublic void setMaxConnectionsPerHost(int mx)
setMaxConnectionsPerHost in interface MorphiumDriverpublic int getMinConnectionsPerHost()
getMinConnectionsPerHost in interface MorphiumDriverpublic void setMinConnectionsPerHost(int mx)
setMinConnectionsPerHost in interface MorphiumDriverpublic int getMaxConnectionLifetime()
getMaxConnectionLifetime in interface MorphiumDriverpublic void setMaxConnectionLifetime(int timeout)
setMaxConnectionLifetime in interface MorphiumDriverpublic int getMaxConnectionIdleTime()
getMaxConnectionIdleTime in interface MorphiumDriverpublic void setMaxConnectionIdleTime(int time)
setMaxConnectionIdleTime in interface MorphiumDriverpublic int getSocketTimeout()
getSocketTimeout in interface MorphiumDriverpublic void setSocketTimeout(int timeout)
setSocketTimeout in interface MorphiumDriverpublic int getConnectionTimeout()
getConnectionTimeout in interface MorphiumDriverpublic void setConnectionTimeout(int timeout)
setConnectionTimeout in interface MorphiumDriverpublic int getDefaultW()
getDefaultW in interface MorphiumDriverpublic void setDefaultW(int w)
setDefaultW in interface MorphiumDriverpublic int getMaxBlockintThreadMultiplier()
getMaxBlockintThreadMultiplier in interface MorphiumDriverpublic int getHeartbeatFrequency()
getHeartbeatFrequency in interface MorphiumDriverpublic void setHeartbeatFrequency(int heartbeatFrequency)
setHeartbeatFrequency in interface MorphiumDriverpublic void setDefaultBatchSize(int defaultBatchSize)
setDefaultBatchSize in interface MorphiumDriverpublic void setCredentials(Map<String,String[]> credentials)
setCredentials in interface MorphiumDriverpublic int getHeartbeatSocketTimeout()
getHeartbeatSocketTimeout in interface MorphiumDriverpublic void setHeartbeatSocketTimeout(int heartbeatSocketTimeout)
setHeartbeatSocketTimeout in interface MorphiumDriverpublic boolean isUseSSL()
isUseSSL in interface MorphiumDriverpublic void setUseSSL(boolean useSSL)
setUseSSL in interface MorphiumDriverpublic boolean isDefaultJ()
isDefaultJ in interface MorphiumDriverpublic void setDefaultJ(boolean j)
setDefaultJ in interface MorphiumDriverpublic int getWriteTimeout()
getWriteTimeout in interface MorphiumDriverpublic void setWriteTimeout(int writeTimeout)
setWriteTimeout in interface MorphiumDriverpublic int getLocalThreshold()
getLocalThreshold in interface MorphiumDriverpublic void setLocalThreshold(int thr)
setLocalThreshold in interface MorphiumDriverpublic void setMaxBlockingThreadMultiplier(int m)
setMaxBlockingThreadMultiplier in interface MorphiumDriverpublic void heartBeatFrequency(int t)
heartBeatFrequency in interface MorphiumDriverpublic void heartBeatSocketTimeout(int t)
heartBeatSocketTimeout in interface MorphiumDriverpublic void useSsl(boolean ssl)
useSsl in interface MorphiumDriverpublic void connect()
throws MorphiumDriverException
connect in interface MorphiumDriverMorphiumDriverExceptionpublic void setDefaultReadPreference(ReadPreference rp)
setDefaultReadPreference in interface MorphiumDriverpublic void connect(String replicasetName) throws MorphiumDriverException
connect in interface MorphiumDriverMorphiumDriverExceptionpublic Maximums getMaximums()
getMaximums in interface MorphiumDriverpublic boolean isConnected()
isConnected in interface MorphiumDriverpublic int getRetriesOnNetworkError()
getRetriesOnNetworkError in interface MorphiumDriverpublic void setRetriesOnNetworkError(int r)
setRetriesOnNetworkError in interface MorphiumDriverpublic int getSleepBetweenErrorRetries()
getSleepBetweenErrorRetries in interface MorphiumDriverpublic void setSleepBetweenErrorRetries(int s)
setSleepBetweenErrorRetries in interface MorphiumDriverpublic void close()
throws MorphiumDriverException
close in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> getReplsetStatus() throws MorphiumDriverException
getReplsetStatus in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> getDBStats(String db) throws MorphiumDriverException
getDBStats in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> getOps(long threshold) throws MorphiumDriverException
getOps in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> runCommand(String db, Map<String,Object> cmd) throws MorphiumDriverException
runCommand in interface MorphiumDriverMorphiumDriverExceptionpublic MorphiumCursor initIteration(String db, String collection, Map<String,Object> query, Map<String,Integer> sort, Map<String,Object> projection, int skip, int limit, int batchSize, ReadPreference readPreference, Map<String,Object> findMetaData) throws MorphiumDriverException
initIteration in interface MorphiumDriverMorphiumDriverExceptionpublic MorphiumCursor nextIteration(MorphiumCursor crs) throws MorphiumDriverException
nextIteration in interface MorphiumDriverMorphiumDriverExceptionpublic List<Map<String,Object>> find(String db, String collection, Map<String,Object> query, Map<String,Integer> sort, Map<String,Object> projection, int skip, int limit, int batchSize, ReadPreference rp, Map<String,Object> findMetaData) throws MorphiumDriverException
find in interface MorphiumDriverMorphiumDriverExceptionpublic long count(String db, String collection, Map<String,Object> query, ReadPreference rp) throws MorphiumDriverException
count in interface MorphiumDriverMorphiumDriverExceptionpublic List<Map<String,Object>> findByFieldValue(String db, String coll, String field, Object value)
public void insert(String db, String collection, List<Map<String,Object>> objs, WriteConcern wc) throws MorphiumDriverException
MorphiumDriverinsert in interface MorphiumDriverMorphiumDriverExceptionpublic void store(String db, String collection, List<Map<String,Object>> objs, WriteConcern wc) throws MorphiumDriverException
MorphiumDriverstore in interface MorphiumDriverMorphiumDriverExceptionpublic void closeIteration(MorphiumCursor crs) throws MorphiumDriverException
closeIteration in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> update(String db, String collection, Map<String,Object> query, Map<String,Object> op, boolean multiple, boolean upsert, WriteConcern wc) throws MorphiumDriverException
update in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> delete(String db, String collection, Map<String,Object> query, boolean multiple, WriteConcern wc) throws MorphiumDriverException
delete in interface MorphiumDriverMorphiumDriverExceptionpublic void drop(String db, String collection, WriteConcern wc) throws MorphiumDriverException
drop in interface MorphiumDriverMorphiumDriverExceptionpublic void drop(String db, WriteConcern wc) throws MorphiumDriverException
drop in interface MorphiumDriverMorphiumDriverExceptionpublic boolean exists(String db) throws MorphiumDriverException
exists in interface MorphiumDriverMorphiumDriverExceptionpublic List<Object> distinct(String db, String collection, String field, Map<String,Object> filter, ReadPreference rp) throws MorphiumDriverException
distinct in interface MorphiumDriverMorphiumDriverExceptionpublic boolean exists(String db, String collection) throws MorphiumDriverException
exists in interface MorphiumDriverMorphiumDriverExceptionpublic List<Map<String,Object>> getIndexes(String db, String collection) throws MorphiumDriverException
getIndexes in interface MorphiumDriverMorphiumDriverExceptionpublic List<String> getCollectionNames(String db) throws MorphiumDriverException
getCollectionNames in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> group(String db, String coll, Map<String,Object> query, Map<String,Object> initial, String jsReduce, String jsFinalize, ReadPreference rp, String... keys)
group in interface MorphiumDriverpublic List<Map<String,Object>> aggregate(String db, String collection, List<Map<String,Object>> pipeline, boolean explain, boolean allowDiskUse, ReadPreference readPreference) throws MorphiumDriverException
aggregate in interface MorphiumDriverMorphiumDriverExceptionpublic boolean isSocketKeepAlive()
isSocketKeepAlive in interface MorphiumDriverpublic void setSocketKeepAlive(boolean socketKeepAlive)
setSocketKeepAlive in interface MorphiumDriverpublic int getHeartbeatConnectTimeout()
getHeartbeatConnectTimeout in interface MorphiumDriverpublic void setHeartbeatConnectTimeout(int heartbeatConnectTimeout)
setHeartbeatConnectTimeout in interface MorphiumDriverpublic int getMaxWaitTime()
getMaxWaitTime in interface MorphiumDriverpublic void setMaxWaitTime(int maxWaitTime)
setMaxWaitTime in interface MorphiumDriverpublic boolean isCapped(String db, String coll) throws MorphiumDriverException
isCapped in interface MorphiumDriverMorphiumDriverExceptionpublic BulkRequestContext createBulkContext(Morphium m, String db, String collection, boolean ordered, WriteConcern wc)
createBulkContext in interface MorphiumDriverpublic void createIndex(String db, String collection, Map<String,Object> index, Map<String,Object> options) throws MorphiumDriverException
createIndex in interface MorphiumDriverMorphiumDriverExceptionCopyright © 2016. All rights reserved.