Package io.milvus.client
Class ConnectParam.Builder
- java.lang.Object
-
- io.milvus.client.ConnectParam.Builder
-
- Enclosing class:
- ConnectParam
public static class ConnectParam.Builder extends java.lang.Object
Builder forConnectParam
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectParam
build()
ConnectParam.Builder
keepAliveWithoutCalls(boolean enable)
Optional.ConnectParam.Builder
withConnectTimeout(long connectTimeout, java.util.concurrent.TimeUnit timeUnit)
Optional.ConnectParam.Builder
withHost(java.lang.String host)
Optional.ConnectParam.Builder
withIdleTimeout(long idleTimeout, java.util.concurrent.TimeUnit timeUnit)
Optional.ConnectParam.Builder
withKeepAliveTime(long keepAliveTime, java.util.concurrent.TimeUnit timeUnit)
Optional.ConnectParam.Builder
withKeepAliveTimeout(long keepAliveTimeout, java.util.concurrent.TimeUnit timeUnit)
Optional.ConnectParam.Builder
withPort(int port)
Optional.
-
-
-
Method Detail
-
withHost
public ConnectParam.Builder withHost(@Nonnull java.lang.String host)
Optional. Defaults to "localhost".- Parameters:
host
- server host- Returns:
Builder
-
withPort
public ConnectParam.Builder withPort(int port) throws java.lang.IllegalArgumentException
Optional. Defaults to "19530".- Parameters:
port
- server port- Returns:
Builder
- Throws:
java.lang.IllegalArgumentException
-
withConnectTimeout
public ConnectParam.Builder withConnectTimeout(long connectTimeout, @Nonnull java.util.concurrent.TimeUnit timeUnit) throws java.lang.IllegalArgumentException
Optional. Defaults to 10 seconds.- Parameters:
connectTimeout
- Timeout for client to establish a connection to server- Returns:
Builder
- Throws:
java.lang.IllegalArgumentException
-
withKeepAliveTime
public ConnectParam.Builder withKeepAliveTime(long keepAliveTime, @Nonnull java.util.concurrent.TimeUnit timeUnit) throws java.lang.IllegalArgumentException
Optional. Sets the time without read activity before sending a keepalive ping. An unreasonably small value might be increased, and Long.MAX_VALUE nano seconds or an unreasonably large value will disable keepalive. Defaults to infinite.- Returns:
Builder
- Throws:
java.lang.IllegalArgumentException
- See Also:
- GRPC keepAliveTime Javadoc
-
withKeepAliveTimeout
public ConnectParam.Builder withKeepAliveTimeout(long keepAliveTimeout, @Nonnull java.util.concurrent.TimeUnit timeUnit) throws java.lang.IllegalArgumentException
Optional. Sets the time waiting for read activity after sending a keepalive ping. If the time expires without any read activity on the connection, the connection is considered dead. An unreasonably small value might be increased. Defaults to 20 seconds.This value should be at least multiple times the RTT to allow for lost packets.
- Returns:
Builder
- Throws:
java.lang.IllegalArgumentException
- See Also:
- GRPC keepAliveTimeout Javadoc
-
keepAliveWithoutCalls
public ConnectParam.Builder keepAliveWithoutCalls(boolean enable)
Optional. Sets whether keepalive will be performed when there are no outstanding RPC on a connection. Defaults to false.- Returns:
Builder
- See Also:
- GRPC keepAliveWithoutCalls Javadoc
-
withIdleTimeout
public ConnectParam.Builder withIdleTimeout(long idleTimeout, java.util.concurrent.TimeUnit timeUnit) throws java.lang.IllegalArgumentException
Optional. Set the duration without ongoing RPCs before going to idle mode. A new RPC would take the channel out of idle mode. Defaults to 24 hour.- Returns:
Builder
- Throws:
java.lang.IllegalArgumentException
- See Also:
- GRPC idleTimeout Javadoc
-
build
public ConnectParam build()
-
-