Package io.milvus.param
Class ConnectParam.Builder
- java.lang.Object
-
- io.milvus.param.ConnectParam.Builder
-
- Enclosing class:
- ConnectParam
public static class ConnectParam.Builder extends java.lang.Object
Builder forConnectParam
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectParam
build()
Verifies parameters and creates a newConnectParam
instance.ConnectParam.Builder
keepAliveWithoutCalls(boolean enable)
Enables the keep-alive function for client channel.ConnectParam.Builder
secure(boolean enable)
Enables the secure for client channel.ConnectParam.Builder
withAuthorization(@NonNull java.lang.String authorization)
Sets the secure for this connectionConnectParam.Builder
withAuthorization(java.lang.String username, java.lang.String password)
Sets the username and password for this connectionConnectParam.Builder
withConnectTimeout(long connectTimeout, @NonNull java.util.concurrent.TimeUnit timeUnit)
Sets the connection timeout value of client channel.ConnectParam.Builder
withDatabaseName(@NonNull java.lang.String databaseName)
Sets the database name.ConnectParam.Builder
withHost(@NonNull java.lang.String host)
Sets the host name/address.ConnectParam.Builder
withIdleTimeout(long idleTimeout, @NonNull java.util.concurrent.TimeUnit timeUnit)
Sets the idle timeout value of client channel.ConnectParam.Builder
withKeepAliveTime(long keepAliveTime, @NonNull java.util.concurrent.TimeUnit timeUnit)
Sets the keep-alive time value of client channel.ConnectParam.Builder
withKeepAliveTimeout(long keepAliveTimeout, @NonNull java.util.concurrent.TimeUnit timeUnit)
Sets the keep-alive timeout value of client channel.ConnectParam.Builder
withPort(int port)
Sets the connection port.ConnectParam.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.ConnectParam.Builder
withSecure(boolean secure)
Sets secure the authorization for this connectionConnectParam.Builder
withToken(java.lang.String token)
Sets the tokenConnectParam.Builder
withUri(java.lang.String uri)
Sets the uri
-
-
-
Method Detail
-
withHost
public ConnectParam.Builder withHost(@NonNull @NonNull java.lang.String host)
Sets the host name/address.- Parameters:
host
- host name/address- Returns:
Builder
-
withPort
public ConnectParam.Builder withPort(int port)
Sets the connection port. Port value must be greater than zero and less than 65536.- Parameters:
port
- port value- Returns:
Builder
-
withDatabaseName
public ConnectParam.Builder withDatabaseName(@NonNull @NonNull java.lang.String databaseName)
Sets the database name.- Parameters:
databaseName
- databaseName- Returns:
Builder
-
withUri
public ConnectParam.Builder withUri(java.lang.String uri)
Sets the uri- Parameters:
uri
-- Returns:
Builder
-
withToken
public ConnectParam.Builder withToken(java.lang.String token)
Sets the token- Parameters:
token
-- Returns:
Builder
-
withConnectTimeout
public ConnectParam.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.- Parameters:
connectTimeout
- timeout valuetimeUnit
- timeout unit- Returns:
Builder
-
withKeepAliveTime
public ConnectParam.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.- Parameters:
keepAliveTime
- keep-alive valuetimeUnit
- keep-alive unit- Returns:
Builder
-
withKeepAliveTimeout
public ConnectParam.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.- Parameters:
keepAliveTimeout
- timeout valuetimeUnit
- timeout unit- Returns:
Builder
-
keepAliveWithoutCalls
public ConnectParam.Builder keepAliveWithoutCalls(boolean enable)
Enables the keep-alive function for client channel.- Parameters:
enable
- true keep-alive- Returns:
Builder
-
secure
public ConnectParam.Builder secure(boolean enable)
Enables the secure for client channel.- Parameters:
enable
- true keep-alive- Returns:
Builder
-
withIdleTimeout
public ConnectParam.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.- Parameters:
idleTimeout
- timeout valuetimeUnit
- timeout unit- Returns:
Builder
-
withRpcDeadline
public ConnectParam.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.- Parameters:
deadline
- deadline valuetimeUnit
- deadline unit- Returns:
Builder
-
withAuthorization
public ConnectParam.Builder withAuthorization(java.lang.String username, java.lang.String password)
Sets the username and password for this connection- Parameters:
username
- current userpassword
- password- Returns:
Builder
-
withSecure
public ConnectParam.Builder withSecure(boolean secure)
Sets secure the authorization for this connection- Parameters:
secure
- boolean- Returns:
Builder
-
withAuthorization
public ConnectParam.Builder withAuthorization(@NonNull @NonNull java.lang.String authorization)
Sets the secure for this connection- Parameters:
authorization
- the authorization info that has included the encoded username and password info- Returns:
Builder
-
build
public ConnectParam build() throws ParamException
Verifies parameters and creates a newConnectParam
instance.- Returns:
ConnectParam
- Throws:
ParamException
-
-