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.
VERSION_NAME| Constructor and Description |
|---|
InMemoryDriver() |
public List<String> listDatabases()
listDatabases in interface MorphiumDriverpublic List<String> listCollections(String db, String pattern)
MorphiumDriverlistCollections in interface MorphiumDriverpattern - regular expression for the collection, might be nullpublic void resetData()
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()
connect in interface MorphiumDriverpublic void setDefaultReadPreference(ReadPreference rp)
setDefaultReadPreference in interface MorphiumDriverpublic void connect(String replicasetName)
connect in interface MorphiumDriverpublic 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()
close in interface MorphiumDriverpublic Map<String,Object> getReplsetStatus()
getReplsetStatus in interface MorphiumDriverpublic Map<String,Object> getDBStats(String db)
getDBStats in interface MorphiumDriverpublic Map<String,Object> getOps(long threshold)
getOps in interface MorphiumDriverpublic Map<String,Object> runCommand(String db, Map<String,Object> cmd)
runCommand in interface MorphiumDriverpublic 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 void watch(String db, int timeout, boolean fullDocumentOnUpdate, DriverTailableIterationCallback cb) throws MorphiumDriverException
watch in interface MorphiumDriverMorphiumDriverExceptionpublic void watch(String db, String collection, int timeout, boolean fullDocumentOnUpdate, DriverTailableIterationCallback cb) throws MorphiumDriverException
watch 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)
count in interface MorphiumDriverpublic 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 Map<String,Object> store(String db, String collection, List<Map<String,Object>> objs, WriteConcern wc)
MorphiumDriverstore in interface MorphiumDriverpublic void closeIteration(MorphiumCursor crs)
closeIteration in interface MorphiumDriverpublic 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)
drop in interface MorphiumDriverpublic void drop(String db, WriteConcern wc)
drop in interface MorphiumDriverpublic boolean exists(String db)
exists in interface MorphiumDriverpublic List<Object> distinct(String db, String collection, String field, Map<String,Object> filter, ReadPreference rp)
distinct in interface MorphiumDriverpublic boolean exists(String db, String collection)
exists in interface MorphiumDriverpublic List<Map<String,Object>> getIndexes(String db, String collection)
getIndexes in interface MorphiumDriverpublic List<String> getCollectionNames(String db)
getCollectionNames in interface MorphiumDriverpublic 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)
aggregate in interface MorphiumDriverpublic 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 void tailableIteration(String db, String collection, Map<String,Object> query, Map<String,Integer> sort, Map<String,Object> projection, int skip, int limit, int batchSize, ReadPreference readPreference, int timeout, DriverTailableIterationCallback cb) throws MorphiumDriverException
tailableIteration in interface MorphiumDriverMorphiumDriverExceptionpublic int getMaxWaitTime()
getMaxWaitTime in interface MorphiumDriverpublic void setMaxWaitTime(int maxWaitTime)
setMaxWaitTime in interface MorphiumDriverpublic boolean isCapped(String db, String coll)
isCapped in interface MorphiumDriverpublic 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)
createIndex in interface MorphiumDriverpublic List<Map<String,Object>> mapReduce(String db, String collection, String mapping, String reducing) throws MorphiumDriverException
mapReduce in interface MorphiumDriverMorphiumDriverExceptionpublic List<Map<String,Object>> mapReduce(String db, String collection, String mapping, String reducing, Map<String,Object> query) throws MorphiumDriverException
mapReduce in interface MorphiumDriverMorphiumDriverExceptionpublic List<Map<String,Object>> mapReduce(String db, String collection, String mapping, String reducing, Map<String,Object> query, Map<String,Object> sorting) throws MorphiumDriverException
mapReduce in interface MorphiumDriverMorphiumDriverExceptionpublic void startTransaction()
startTransaction in interface MorphiumDriverpublic void commitTransaction()
commitTransaction in interface MorphiumDriverpublic MorphiumTransactionContext getTransactionContext()
getTransactionContext in interface MorphiumDriverpublic void abortTransaction()
abortTransaction in interface MorphiumDriverpublic void setTransactionContext(MorphiumTransactionContext ctx)
setTransactionContext in interface MorphiumDriverCopyright © 2019. All rights reserved.