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
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
withConnectTimeout(long connectTimeout, @NonNull java.util.concurrent.TimeUnit timeUnit)
Sets the connection timeout value of client channel.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
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
-
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
-
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
-
build
public ConnectParam build() throws ParamException
Verifies parameters and creates a newConnectParam
instance.- Returns:
ConnectParam
- Throws:
ParamException
-
-