Example usage for com.mongodb MongoClientSettings getReadPreference

List of usage examples for com.mongodb MongoClientSettings getReadPreference

Introduction

In this page you can find the example usage for com.mongodb MongoClientSettings getReadPreference.

Prototype

public ReadPreference getReadPreference() 

Source Link

Document

The read preference to use for queries, map-reduce, aggregation, and count.

Usage

From source file:com.navercorp.pinpoint.plugin.mongo.interceptor.MongoDriverConnectInterceptor3_7.java

License:Apache License

private String getReadPreference(Object arg) {
    if (!(arg instanceof MongoClientSettings)) {
        return null;
    }//w  w  w. j  a  v a  2s.c o  m

    final MongoClientSettings mongoClientSettings = (MongoClientSettings) arg;

    return mongoClientSettings.getReadPreference().getName();
}