Package com.databend.jdbc

# Class DatabendNodes

java.lang.Object
com.databend.jdbc.DatabendNodes

All Implemented Interfaces:
  `DatabendNodeRouter`

public class DatabendNodes extends Object implements DatabendNodeRouter

## Field Summary

Fields
Modifier and Type
Field
Description
`protected long`
`discoveryInterval`
`protected final AtomicInteger`
`index`
`protected final AtomicReference<Long>`
`lastDiscoveryTime`
`protected DatabendClientLoadBalancingPolicy`
`policy`

## Constructor Summary

Constructors
Constructor
Description
`DatabendNodes(List<URI> queryNodesUris, DatabendClientLoadBalancingPolicy policy, String UriPath, String UriQuery, String UriFragment, long discoveryInterval)`

## Method Summary

Modifier and Type
Method
Description
`void`
`discoverUris(okhttp3.OkHttpClient client, com.databend.client.ClientSettings settings)`
Discover all possible query uris through databend discovery api and update candidate node router list in need
`DatabendClientLoadBalancingPolicy`
`getPolicy()`
Get load balancing policy
`List<URI>`
`getUris()`
Gets a copy of all possible query uris
`boolean`
`needDiscovery()`
`List<URI>`
`parseURI(List<com.databend.client.DiscoveryNode> nodes)`
`URI`
`pickUri(String query_id)`
`void`
`setDiscoveryInterval(long discoveryInterval)`
`void`
`setSSL(boolean useSecureConnection, String sslmode)`
`String`
`toString()`
`void`
`updateNodes(List<URI> query_nodes_uris)`
`void`
`updatePolicy(DatabendClientLoadBalancingPolicy policy)`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### index

protected final AtomicInteger index

### lastDiscoveryTime

protected final AtomicReference<Long> lastDiscoveryTime

### discoveryInterval

protected long discoveryInterval

### policy

protected DatabendClientLoadBalancingPolicy policy

## Constructor Details

### DatabendNodes

public DatabendNodes(List<URI> queryNodesUris, DatabendClientLoadBalancingPolicy policy, String UriPath, String UriQuery, String UriFragment, long discoveryInterval)

## Method Details

### getUris

public List<URI> getUris()
Description copied from interface: `DatabendNodeRouter`
Gets a copy of all possible query uris

Specified by:
  `getUris` in interface `DatabendNodeRouter`
Returns:
  non-null uris

### setSSL

public void setSSL(boolean useSecureConnection, String sslmode)

### setDiscoveryInterval

public void setDiscoveryInterval(long discoveryInterval)

### updateNodes

public void updateNodes(List<URI> query_nodes_uris)

### updatePolicy

public void updatePolicy(DatabendClientLoadBalancingPolicy policy)

### getPolicy

public DatabendClientLoadBalancingPolicy getPolicy()
Description copied from interface: `DatabendNodeRouter`
Get load balancing policy

Specified by:
  `getPolicy` in interface `DatabendNodeRouter`

### discoverUris

public void discoverUris(okhttp3.OkHttpClient client, com.databend.client.ClientSettings settings) throws UnsupportedOperationException
Description copied from interface: `DatabendNodeRouter`
Discover all possible query uris through databend discovery api and update candidate node router list in need

Specified by:
  `discoverUris` in interface `DatabendNodeRouter`
Throws:
  `UnsupportedOperationException`

### needDiscovery

public boolean needDiscovery()

Specified by:
  `needDiscovery` in interface `DatabendNodeRouter`

### parseURI

public List<URI> parseURI(List<com.databend.client.DiscoveryNode> nodes) throws RuntimeException

Throws:
  `RuntimeException`

### pickUri

public URI pickUri(String query_id)

### toString

public String toString()

Overrides:
  `toString` in class `Object`