/** * Construct an instance. * * @param connectionId the connection id * @param maxWireVersion the max wire version * @param serverType the server type * @param maxBatchCount the max batch count * @param maxDocumentSize the max document size in bytes * @param maxMessageSize the max message size in bytes * @param compressors the available compressors on the connection * @since 3.10 */ public ConnectionDescription(final ConnectionId connectionId, final int maxWireVersion, final ServerType serverType, final int maxBatchCount, final int maxDocumentSize, final int maxMessageSize, final List<String> compressors) { this(connectionId, new ServerVersion(), maxWireVersion, serverType, maxBatchCount, maxDocumentSize, maxMessageSize, compressors); }
return false; if (!serverVersion.equals(that.serverVersion)) { return false;
@Override public int hashCode() { int result = connectionId.hashCode(); result = 31 * result + serverVersion.hashCode(); result = 31 * result + maxBatchCount; result = 31 * result + serverType.hashCode(); result = 31 * result + maxBatchCount; result = 31 * result + maxDocumentSize; result = 31 * result + maxMessageSize; result = 31 * result + compressors.hashCode(); return result; }
/** * Construct a defaulted connection description instance. * * @param serverId the server address */ public ConnectionDescription(final ServerId serverId) { this(new ConnectionId(serverId), new ServerVersion(), 0, ServerType.UNKNOWN, DEFAULT_MAX_WRITE_BATCH_SIZE, getDefaultMaxDocumentSize(), DEFAULT_MAX_MESSAGE_SIZE, Collections.<String>emptyList()); }
return false; if (!version.equals(that.version)) { return false;
@Override public int hashCode() { int result = address.hashCode(); result = 31 * result + type.hashCode(); result = 31 * result + (canonicalAddress != null ? canonicalAddress.hashCode() : 0); result = 31 * result + hosts.hashCode(); result = 31 * result + passives.hashCode(); result = 31 * result + arbiters.hashCode(); result = 31 * result + (primary != null ? primary.hashCode() : 0); result = 31 * result + maxDocumentSize; result = 31 * result + tagSet.hashCode(); result = 31 * result + (setName != null ? setName.hashCode() : 0); result = 31 * result + (electionId != null ? electionId.hashCode() : 0); result = 31 * result + (setVersion != null ? setVersion.hashCode() : 0); result = 31 * result + (lastWriteDate != null ? lastWriteDate.hashCode() : 0); result = 31 * result + (int) (lastUpdateTimeNanos ^ (lastUpdateTimeNanos >>> 32)); result = 31 * result + (ok ? 1 : 0); result = 31 * result + state.hashCode(); result = 31 * result + version.hashCode(); result = 31 * result + minWireVersion; result = 31 * result + maxWireVersion; result = 31 * result + (logicalSessionTimeoutMinutes != null ? logicalSessionTimeoutMinutes.hashCode() : 0); result = 31 * result + (exception == null ? 0 : exception.getClass().hashCode()); result = 31 * result + (exception == null ? 0 : exception.getMessage().hashCode()); return result; }
static ServerVersion getVersion(final BsonDocument buildInfoResult) { List<BsonValue> versionArray = buildInfoResult.getArray("versionArray").subList(0, 3); return new ServerVersion(asList(versionArray.get(0).asInt32().getValue(), versionArray.get(1).asInt32().getValue(), versionArray.get(2).asInt32().getValue())); }
return true; if (!previous.getVersion().equals(current.getVersion())) { return true;
@Override public int hashCode() { int result = connectionId.hashCode(); result = 31 * result + serverVersion.hashCode(); result = 31 * result + maxBatchCount; result = 31 * result + serverType.hashCode(); result = 31 * result + maxBatchCount; result = 31 * result + maxDocumentSize; result = 31 * result + maxMessageSize; result = 31 * result + compressors.hashCode(); return result; }
/** * Construct an instance. * * @param connectionId the connection id * @param maxWireVersion the max wire version * @param serverType the server type * @param maxBatchCount the max batch count * @param maxDocumentSize the max document size in bytes * @param maxMessageSize the max message size in bytes * @param compressors the available compressors on the connection * @since 3.10 */ public ConnectionDescription(final ConnectionId connectionId, final int maxWireVersion, final ServerType serverType, final int maxBatchCount, final int maxDocumentSize, final int maxMessageSize, final List<String> compressors) { this(connectionId, new ServerVersion(), maxWireVersion, serverType, maxBatchCount, maxDocumentSize, maxMessageSize, compressors); }
return false; if (!serverVersion.equals(that.serverVersion)) { return false;
@Override public int hashCode() { int result = address.hashCode(); result = 31 * result + type.hashCode(); result = 31 * result + (canonicalAddress != null ? canonicalAddress.hashCode() : 0); result = 31 * result + hosts.hashCode(); result = 31 * result + passives.hashCode(); result = 31 * result + arbiters.hashCode(); result = 31 * result + (primary != null ? primary.hashCode() : 0); result = 31 * result + maxDocumentSize; result = 31 * result + tagSet.hashCode(); result = 31 * result + (setName != null ? setName.hashCode() : 0); result = 31 * result + (electionId != null ? electionId.hashCode() : 0); result = 31 * result + (setVersion != null ? setVersion.hashCode() : 0); result = 31 * result + (lastWriteDate != null ? lastWriteDate.hashCode() : 0); result = 31 * result + (int) (lastUpdateTimeNanos ^ (lastUpdateTimeNanos >>> 32)); result = 31 * result + (ok ? 1 : 0); result = 31 * result + state.hashCode(); result = 31 * result + version.hashCode(); result = 31 * result + minWireVersion; result = 31 * result + maxWireVersion; result = 31 * result + (logicalSessionTimeoutMinutes != null ? logicalSessionTimeoutMinutes.hashCode() : 0); result = 31 * result + (exception == null ? 0 : exception.getClass().hashCode()); result = 31 * result + (exception == null ? 0 : exception.getMessage().hashCode()); return result; }
/** * Construct a defaulted connection description instance. * * @param serverId the server address */ public ConnectionDescription(final ServerId serverId) { this(new ConnectionId(serverId), new ServerVersion(), 0, ServerType.UNKNOWN, DEFAULT_MAX_WRITE_BATCH_SIZE, getDefaultMaxDocumentSize(), DEFAULT_MAX_MESSAGE_SIZE, Collections.<String>emptyList()); }
return false; if (!version.equals(that.version)) { return false;
static ServerVersion getVersion(final BsonDocument buildInfoResult) { List<BsonValue> versionArray = buildInfoResult.getArray("versionArray").subList(0, 3); return new ServerVersion(asList(versionArray.get(0).asInt32().getValue(), versionArray.get(1).asInt32().getValue(), versionArray.get(2).asInt32().getValue())); }
return true; if (!previous.getVersion().equals(current.getVersion())) { return true;