Package com.clickhouse.client
Class ClickHouseNode
java.lang.Object
com.clickhouse.client.ClickHouseNode
- All Implemented Interfaces:
Serializable,Function<ClickHouseNodeSelector,ClickHouseNode>
@Deprecated
public class ClickHouseNode
extends Object
implements Function<ClickHouseNodeSelector,ClickHouseNode>, Serializable
Deprecated.
This class depicts a ClickHouse server, essentially a combination of host,
port and protocol, for client to connect.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.Mutable and non-thread safe builder.static enumDeprecated.Node status. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClickHouseConfigDeprecated.protected final AtomicLongDeprecated.Last update time in milliseconds.protected final AtomicReference<ClickHouseNodeManager>Deprecated.static final StringDeprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClickHouseNode(ClickHouseNode.Builder builder) Deprecated.protectedClickHouseNode(String host, ClickHouseProtocol protocol, int port, ClickHouseCredentials credentials, Map<String, String> options, Set<String> tags) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.static ClickHouseNode.Builderbuilder()Deprecated.Gets builder for creating a new node, same asbuilder(null).static ClickHouseNode.Builderbuilder(ClickHouseNode base) Deprecated.Gets builder for creating a new node based on the given one.booleanDeprecated.Deprecated.Gets socket address to connect to this node.Deprecated.Gets base URI which is composed of protocol, host and port.Deprecated.Gets cluster name of the node.Deprecated.Gets configuration.Deprecated.Gets credentials for accessing this node.getCredentials(ClickHouseConfig config) Deprecated.Gets credentials for accessing this node.Deprecated.Gets database of the node.getDatabase(ClickHouseConfig config) Deprecated.Gets database of the node.getHost()Deprecated.Gets host of the node.Deprecated.Gets all options of the node.intgetPort()Deprecated.Gets port of the node.Deprecated.Gets protocol used by the node.getTags()Deprecated.Gets all tags of the node.Deprecated.Gets time zone of the node.getTimeZone(ClickHouseConfig config) Deprecated.Gets time zone of the node.Deprecated.Gets version of the node.getVersion(ClickHouseConfig config) Deprecated.Gets version of the node.intDeprecated.Gets weight of the node.inthashCode()Deprecated.booleanDeprecated.Checks if preferred database was specified or not.booleanDeprecated.Checks whether the node is managed by aClickHouseClusterroClickHouseNodes.booleanisSameEndpoint(ClickHouseNode node) Deprecated.Checks if the given node has same base URI as current one.booleanDeprecated.Checks whether the node is not managed by anyClickHouseClusterroClickHouseNodes.static ClickHouseNodeDeprecated.Creates a node object using given URI.static ClickHouseNodeof(String uri, ClickHouseNode template) Deprecated.Creates a node object using given URI and template.static ClickHouseNodeof(String host, ClickHouseProtocol protocol, int port, String database, String... tags) Deprecated.Creates a node object in one go.static ClickHouseNodeDeprecated.Creates a node object using given URI.static ClickHouseNodeof(URI uri, ClickHouseNode template) Deprecated.Creates a node object using given URI.protected ClickHouseNodeprobe()Deprecated.protected ClickHouseNodeDeprecated.Sets manager for this node.toString()Deprecated.toUri()Deprecated.Converts to URI, without credentials for security reason.Deprecated.Converts to URI, without credentials for security reason.voidupdate(ClickHouseNode.Status status) Deprecated.Updates status of the node.
-
Field Details
-
SCHEME_DELIMITER
Deprecated.- See Also:
-
lastUpdateTime
Deprecated.Last update time in milliseconds. -
config
Deprecated. -
manager
Deprecated.
-
-
Constructor Details
-
ClickHouseNode
Deprecated. -
ClickHouseNode
protected ClickHouseNode(String host, ClickHouseProtocol protocol, int port, ClickHouseCredentials credentials, Map<String, String> options, Set<String> tags) Deprecated.
-
-
Method Details
-
builder
Deprecated.Gets builder for creating a new node, same asbuilder(null).- Returns:
- builder for creating a new node
-
builder
Deprecated.Gets builder for creating a new node based on the given one.- Parameters:
base- template to start with- Returns:
- builder for creating a new node
-
of
public static ClickHouseNode of(String host, ClickHouseProtocol protocol, int port, String database, String... tags) Deprecated.Creates a node object in one go. Short version ofClickHouseNode.builder().host(host).port(protocol, port).database(database).tags(tags).build().- Parameters:
host- host name, null meansClickHouseDefaults.HOSTprotocol- protocol, null meansClickHouseDefaults.PROTOCOLport- port numberdatabase- database name, null meansClickHouseDefaults.DATABASEtags- tags for the node, null tag will be ignored- Returns:
- non-null node object
-
of
Deprecated.Creates a node object using given URI. Same asof(uri, ClickHouseProtocol.ANY).- Parameters:
uri- non-empty URI- Returns:
- non-null node object
-
of
Deprecated.Creates a node object using given URI. Same asof(uri, ClickHouseProtocol.ANY).- Parameters:
uri- non-empty URIoptions- default options- Returns:
- non-null node object
-
of
Deprecated.Creates a node object using given URI and template.- Parameters:
uri- non-empty URItemplate- optinal template used for creating the node- Returns:
- non-null node object
-
of
Deprecated.Creates a node object using given URI.- Parameters:
uri- non-null URI which contains scheme(protocol), host and optionally porttemplate- optinal template used for creating the node object- Returns:
- non-null node object
-
probe
Deprecated. -
setManager
Deprecated.Sets manager for this node.- Parameters:
m- node manager- Returns:
- this node
-
getAddress
Deprecated.Gets socket address to connect to this node.- Returns:
- socket address to connect to the node
-
getBaseUri
Deprecated.Gets base URI which is composed of protocol, host and port.- Returns:
- non-emtpy base URI
-
getConfig
Deprecated.Gets configuration.- Returns:
- non-null configuration
-
getCredentials
Deprecated.Gets credentials for accessing this node. UseClickHouseConfig.getDefaultCredentials()if this is not present.- Returns:
- credentials for accessing this node
-
getCredentials
Deprecated.Gets credentials for accessing this node. It first attempts to use credentials tied to the node, and then use default credentials from the given configuration.- Parameters:
config- non-null configuration for retrieving default credentials- Returns:
- credentials for accessing this node
-
getHost
Deprecated.Gets host of the node.- Returns:
- host of the node
-
getPort
public int getPort()Deprecated.Gets port of the node.- Returns:
- port of the node
-
getDatabase
Deprecated.Gets database of the node.- Returns:
- database of the node
-
getDatabase
Deprecated.Gets database of the node. WhenhasPreferredDatabase()isfalse, it will use database from the given configuration.- Parameters:
config- non-null configuration to get default database- Returns:
- database of the node
-
getOptions
Deprecated.Gets all options of the node.- Returns:
- options of the node
-
getTags
Deprecated.Gets all tags of the node.- Returns:
- tags of the node
-
getWeight
public int getWeight()Deprecated.Gets weight of the node.- Returns:
- weight of the node
-
getTimeZone
Deprecated.Gets time zone of the node.- Returns:
- time zone of the node
-
getTimeZone
Deprecated.Gets time zone of the node. When not defined, it will use server time zone from the given configuration.- Parameters:
config- non-null configuration to get server time zone- Returns:
- time zone of the node
-
getVersion
Deprecated.Gets version of the node.- Returns:
- version of the node
-
getVersion
Deprecated.Gets version of the node. When not defined, it will use server version from the given configuration.- Parameters:
config- non-null configuration to get server version- Returns:
- version of the node
-
getCluster
Deprecated.Gets cluster name of the node.- Returns:
- cluster name of node
-
getProtocol
Deprecated.Gets protocol used by the node.- Returns:
- protocol used by the node
-
hasPreferredDatabase
public boolean hasPreferredDatabase()Deprecated.Checks if preferred database was specified or not. When preferred database was not specified,getDatabase()will return default database.- Returns:
- true if preferred database was specified; false otherwise
-
isManaged
public boolean isManaged()Deprecated.Checks whether the node is managed by aClickHouseClusterroClickHouseNodes.- Returns:
- true if the node is managed; false otherwise
-
isStandalone
public boolean isStandalone()Deprecated.Checks whether the node is not managed by anyClickHouseClusterroClickHouseNodes.- Returns:
- true if the node is not managed; false otherwise
-
isSameEndpoint
Deprecated.Checks if the given node has same base URI as current one.- Parameters:
node- node to test- Returns:
- true if the nodes are same endpoint; false otherwise
-
update
Deprecated.Updates status of the node. This will only work when the node is managed(isManaged()returnstrue).- Parameters:
status- non-null node status
-
apply
Deprecated.- Specified by:
applyin interfaceFunction<ClickHouseNodeSelector,ClickHouseNode>
-
hashCode
public int hashCode()Deprecated. -
equals
Deprecated. -
toString
Deprecated. -
toUri
Deprecated.Converts to URI, without credentials for security reason.- Returns:
- non-null URI
-
toUri
Deprecated.Converts to URI, without credentials for security reason.- Parameters:
schemePrefix- optional prefix of scheme- Returns:
- non-null URI
-