io.milvus.param

## Class MultiConnectParam.Builder

- java.lang.Object
- - io.milvus.param.ConnectParam.Builder
  - - io.milvus.param.MultiConnectParam.Builder

Enclosing class:
  MultiConnectParam

    public static class MultiConnectParam.Builder
    extends ConnectParam.Builder

Builder for `MultiConnectParam`

### Method Summary

All Methods Instance Methods Concrete Methods
`MultiConnectParam` `build()` Verifies parameters and creates a new `MultiConnectParam` instance.
`MultiConnectParam.Builder` `keepAliveWithoutCalls(boolean enable)` Enables the keep-alive function for client channel.
`MultiConnectParam.Builder` `withAuthorization(@NonNull java.lang.String authorization)` Sets the secure for this connection
`MultiConnectParam.Builder` `withAuthorization(java.lang.String username, java.lang.String password)` Sets the username and password for this connection
`MultiConnectParam.Builder` `withCaPemPath(@NonNull java.lang.String caPemPath)` Set the ca.pem path for tls two-way authentication, only takes effect when "secure" is True.
`MultiConnectParam.Builder` `withClientKeyPath(@NonNull java.lang.String clientKeyPath)` Set the client.key path for tls two-way authentication, only takes effect when "secure" is True.
`MultiConnectParam.Builder` `withClientPemPath(@NonNull java.lang.String clientPemPath)` Set the client.pem path for tls two-way authentication, only takes effect when "secure" is True.
`MultiConnectParam.Builder` `withConnectTimeout(long connectTimeout, @NonNull java.util.concurrent.TimeUnit timeUnit)` Sets the connection timeout value of client channel.
`MultiConnectParam.Builder` `withDatabaseName(java.lang.String databaseName)` Sets the database name.
`MultiConnectParam.Builder` `withHost(@NonNull java.lang.String host)` Sets the host name/address.
`MultiConnectParam.Builder` `withHosts(@NonNull java.util.List<ServerAddress> hosts)` Sets the addresses.
`MultiConnectParam.Builder` `withIdleTimeout(long idleTimeout, @NonNull java.util.concurrent.TimeUnit timeUnit)` Sets the idle timeout value of client channel.
`MultiConnectParam.Builder` `withKeepAliveTime(long keepAliveTime, @NonNull java.util.concurrent.TimeUnit timeUnit)` Sets the keep-alive time value of client channel.
`MultiConnectParam.Builder` `withKeepAliveTimeout(long keepAliveTimeout, @NonNull java.util.concurrent.TimeUnit timeUnit)` Sets the keep-alive timeout value of client channel.
`MultiConnectParam.Builder` `withPort(int port)` Sets the connection port.
`MultiConnectParam.Builder` `withQueryNodeSingleSearch(@NonNull QueryNodeSingleSearch queryNodeSingleSearch)` Sets single search for query node listener.
`MultiConnectParam.Builder` `withRpcDeadline(long deadline, @NonNull java.util.concurrent.TimeUnit timeUnit)` Set a deadline for how long you are willing to wait for a reply from the server.
`MultiConnectParam.Builder` `withSecure(boolean secure)` Sets secure the authorization for this connection, set to True to enable TLS
`MultiConnectParam.Builder` `withServerName(@NonNull java.lang.String serverName)` Set target name override for SSL host name checking, only takes effect when "secure" is True.
`MultiConnectParam.Builder` `withServerPemPath(@NonNull java.lang.String serverPemPath)` Set the server.pem path for tls two-way authentication, only takes effect when "secure" is True.
`MultiConnectParam.Builder` `withToken(java.lang.String token)` Sets the token
`MultiConnectParam.Builder` `withUri(java.lang.String uri)` Sets the uri

### Methods inherited from class io.milvus.param.ConnectParam.Builder

`secure, withClientRequestId`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### withHosts

    public MultiConnectParam.Builder withHosts(@NonNull
                                               @NonNull java.util.List<ServerAddress> hosts)

Sets the addresses.

Parameters:
  `hosts` - hosts serverAddresses
Returns:
  `Builder`

#### withQueryNodeSingleSearch

    public MultiConnectParam.Builder withQueryNodeSingleSearch(@NonNull
                                                               @NonNull QueryNodeSingleSearch queryNodeSingleSearch)

Sets single search for query node listener.

Parameters:
  `queryNodeSingleSearch` - query node single search for listener
Returns:
  `Builder`

#### withHost

    public MultiConnectParam.Builder withHost(@NonNull
                                              @NonNull java.lang.String host)

Sets the host name/address.

Overrides:
  `withHost` in class `ConnectParam.Builder`
Parameters:
  `host` - host name/address
Returns:
  `Builder`

#### withPort

    public MultiConnectParam.Builder withPort(int port)

Sets the connection port. Port value must be greater than zero and less than 65536.

Overrides:
  `withPort` in class `ConnectParam.Builder`
Parameters:
  `port` - port value
Returns:
  `Builder`

#### withDatabaseName

    public MultiConnectParam.Builder withDatabaseName(java.lang.String databaseName)

Sets the database name.

Overrides:
  `withDatabaseName` in class `ConnectParam.Builder`
Parameters:
  `databaseName` - databaseName
Returns:
  `Builder`

#### withUri

    public MultiConnectParam.Builder withUri(java.lang.String uri)

Sets the uri

Overrides:
  `withUri` in class `ConnectParam.Builder`
Parameters:
  `uri` - the uri of Milvus instance
Returns:
  `Builder`

#### withToken

    public MultiConnectParam.Builder withToken(java.lang.String token)

Sets the token

Overrides:
  `withToken` in class `ConnectParam.Builder`
Parameters:
  `token` - serving as the key for identification and authentication purposes.
Returns:
  `Builder`

#### withConnectTimeout

    public MultiConnectParam.Builder withConnectTimeout(long connectTimeout,
                                                        @NonNull
                                                        @NonNull java.util.concurrent.TimeUnit timeUnit)

Sets the connection timeout value of client channel. The timeout value must be greater than zero.

Overrides:
  `withConnectTimeout` in class `ConnectParam.Builder`
Parameters:
  `connectTimeout` - timeout value
  `timeUnit` - timeout unit
Returns:
  `Builder`

#### withKeepAliveTime

    public MultiConnectParam.Builder withKeepAliveTime(long keepAliveTime,
                                                       @NonNull
                                                       @NonNull java.util.concurrent.TimeUnit timeUnit)

Sets the keep-alive time value of client channel. The keep-alive value must be greater than zero.

Overrides:
  `withKeepAliveTime` in class `ConnectParam.Builder`
Parameters:
  `keepAliveTime` - keep-alive value
  `timeUnit` - keep-alive unit
Returns:
  `Builder`

#### withKeepAliveTimeout

    public MultiConnectParam.Builder withKeepAliveTimeout(long keepAliveTimeout,
                                                          @NonNull
                                                          @NonNull java.util.concurrent.TimeUnit timeUnit)

Sets the keep-alive timeout value of client channel. The timeout value must be greater than zero.

Overrides:
  `withKeepAliveTimeout` in class `ConnectParam.Builder`
Parameters:
  `keepAliveTimeout` - timeout value
  `timeUnit` - timeout unit
Returns:
  `Builder`

#### keepAliveWithoutCalls

    public MultiConnectParam.Builder keepAliveWithoutCalls(boolean enable)

Enables the keep-alive function for client channel.

Overrides:
  `keepAliveWithoutCalls` in class `ConnectParam.Builder`
Parameters:
  `enable` - true keep-alive
Returns:
  `Builder`

#### withIdleTimeout

    public MultiConnectParam.Builder withIdleTimeout(long idleTimeout,
                                                     @NonNull
                                                     @NonNull java.util.concurrent.TimeUnit timeUnit)

Sets the idle timeout value of client channel. The timeout value must be larger than zero.

Overrides:
  `withIdleTimeout` in class `ConnectParam.Builder`
Parameters:
  `idleTimeout` - timeout value
  `timeUnit` - timeout unit
Returns:
  `Builder`

#### withRpcDeadline

    public MultiConnectParam.Builder withRpcDeadline(long deadline,
                                                     @NonNull
                                                     @NonNull java.util.concurrent.TimeUnit timeUnit)

Set a deadline for how long you are willing to wait for a reply from the server. With a deadline setting, the client will wait when encounter fast RPC fail caused by network fluctuations. The deadline value must be larger than or equal to zero. Default value is 0, deadline is disabled.

Overrides:
  `withRpcDeadline` in class `ConnectParam.Builder`
Parameters:
  `deadline` - deadline value
  `timeUnit` - deadline unit
Returns:
  `Builder`

#### withAuthorization

    public MultiConnectParam.Builder withAuthorization(java.lang.String username,
                                                       java.lang.String password)

Sets the username and password for this connection

Overrides:
  `withAuthorization` in class `ConnectParam.Builder`
Parameters:
  `username` - current user
  `password` - password
Returns:
  `Builder`

#### withSecure

    public MultiConnectParam.Builder withSecure(boolean secure)

Sets secure the authorization for this connection, set to True to enable TLS

Overrides:
  `withSecure` in class `ConnectParam.Builder`
Parameters:
  `secure` - boolean
Returns:
  `Builder`

#### withAuthorization

    public MultiConnectParam.Builder withAuthorization(@NonNull
                                                       @NonNull java.lang.String authorization)

Sets the secure for this connection

Overrides:
  `withAuthorization` in class `ConnectParam.Builder`
Parameters:
  `authorization` - the authorization info that has included the encoded username and password info
Returns:
  `Builder`

#### withClientKeyPath

    public MultiConnectParam.Builder withClientKeyPath(@NonNull
                                                       @NonNull java.lang.String clientKeyPath)

Set the client.key path for tls two-way authentication, only takes effect when "secure" is True.

Overrides:
  `withClientKeyPath` in class `ConnectParam.Builder`
Parameters:
  `clientKeyPath` - path of client.key
Returns:
  `Builder`

#### withClientPemPath

    public MultiConnectParam.Builder withClientPemPath(@NonNull
                                                       @NonNull java.lang.String clientPemPath)

Set the client.pem path for tls two-way authentication, only takes effect when "secure" is True.

Overrides:
  `withClientPemPath` in class `ConnectParam.Builder`
Parameters:
  `clientPemPath` - path of client.pem
Returns:
  `Builder`

#### withCaPemPath

    public MultiConnectParam.Builder withCaPemPath(@NonNull
                                                   @NonNull java.lang.String caPemPath)

Set the ca.pem path for tls two-way authentication, only takes effect when "secure" is True.

Overrides:
  `withCaPemPath` in class `ConnectParam.Builder`
Parameters:
  `caPemPath` - path of ca.pem
Returns:
  `Builder`

#### withServerPemPath

    public MultiConnectParam.Builder withServerPemPath(@NonNull
                                                       @NonNull java.lang.String serverPemPath)

Set the server.pem path for tls two-way authentication, only takes effect when "secure" is True.

Overrides:
  `withServerPemPath` in class `ConnectParam.Builder`
Parameters:
  `serverPemPath` - path of server.pem
Returns:
  `Builder`

#### withServerName

    public MultiConnectParam.Builder withServerName(@NonNull
                                                    @NonNull java.lang.String serverName)

Set target name override for SSL host name checking, only takes effect when "secure" is True. Note: this value is passed to grpc.ssl_target_name_override

Overrides:
  `withServerName` in class `ConnectParam.Builder`
Parameters:
  `serverName` - path of server.pem
Returns:
  `Builder`

#### build

    public MultiConnectParam build()
                            throws ParamException

Verifies parameters and creates a new `MultiConnectParam` instance.

Overrides:
  `build` in class `ConnectParam.Builder`
Returns:
  `MultiConnectParam`
Throws:
  `ParamException`