Examples of ReadPreference


Examples of com.mongodb.ReadPreference

        String parentId = Utils.getParentIdFromLowerLimit(fromKey);
        TreeLock lock = acquireExclusive(parentId != null ? parentId : "");
        long start = start();
        try {
            DBCursor cursor = dbCollection.find(query).sort(BY_ID_ASC).hint(hint);
            ReadPreference readPreference =
                    getMongoReadPreference(collection, parentId, getDefaultReadPreference(collection));

            if(readPreference.isSlaveOk()){
                LOG.trace("Routing call to secondary for fetching children from [{}] to [{}]", fromKey, toKey);
            }

            cursor.setReadPreference(readPreference);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.