@@ -74,6 +74,7 @@ public abstract class InternalArangoDBBuilder {
74
74
private static final String PROPERTY_KEY_MAX_CONNECTIONS = "arangodb.connections.max" ;
75
75
private static final String PROPERTY_KEY_CONNECTION_TTL = "arangodb.connections.ttl" ;
76
76
private static final String PROPERTY_KEY_ACQUIRE_HOST_LIST = "arangodb.acquireHostList" ;
77
+ private static final String PROPERTY_KEY_ACQUIRE_HOST_LIST_INTERVAL = "arangodb.acquireHostList.interval" ;
77
78
private static final String PROPERTY_KEY_LOAD_BALANCING_STRATEGY = "arangodb.loadBalancingStrategy" ;
78
79
private static final String DEFAULT_PROPERTY_FILE = "/arangodb.properties" ;
79
80
@@ -92,9 +93,12 @@ public abstract class InternalArangoDBBuilder {
92
93
protected ArangoSerializer serializer ;
93
94
protected ArangoDeserializer deserializer ;
94
95
protected Boolean acquireHostList ;
96
+ protected Integer acquireHostListInterval ;
95
97
protected LoadBalancingStrategy loadBalancingStrategy ;
96
98
protected ArangoSerialization customSerializer ;
97
99
100
+
101
+
98
102
public InternalArangoDBBuilder () {
99
103
super ();
100
104
vpackBuilder = new VPack .Builder ();
@@ -133,6 +137,7 @@ protected void loadProperties(final Properties properties) {
133
137
maxConnections = loadMaxConnections (properties , maxConnections );
134
138
connectionTtl = loadConnectionTtl (properties , connectionTtl );
135
139
acquireHostList = loadAcquireHostList (properties , acquireHostList );
140
+ acquireHostListInterval = loadAcquireHostListInterval (properties , acquireHostListInterval );
136
141
loadBalancingStrategy = loadLoadBalancingStrategy (properties , loadBalancingStrategy );
137
142
}
138
143
@@ -196,7 +201,7 @@ protected HostResolver createHostResolver(final Collection<Host> hosts, final in
196
201
197
202
if (acquireHostList ) {
198
203
LOGGER .debug ("acquireHostList -> Use ExtendedHostResolver" );
199
- return new ExtendedHostResolver (new ArrayList <Host >(hosts ), maxConnections , connectionFactory );
204
+ return new ExtendedHostResolver (new ArrayList <Host >(hosts ), maxConnections , connectionFactory , acquireHostListInterval );
200
205
} else {
201
206
LOGGER .debug ("Use SimpleHostResolver" );
202
207
return new SimpleHostResolver (new ArrayList <Host >(hosts ));
@@ -295,6 +300,11 @@ private static Boolean loadAcquireHostList(final Properties properties, final Bo
295
300
ArangoDefaults .DEFAULT_ACQUIRE_HOST_LIST ));
296
301
}
297
302
303
+ private static int loadAcquireHostListInterval (final Properties properties , final Integer currentValue ) {
304
+ return Integer .parseInt (getProperty (properties , PROPERTY_KEY_ACQUIRE_HOST_LIST_INTERVAL , currentValue ,
305
+ ArangoDefaults .DEFAULT_ACQUIRE_HOST_LIST_INTERVAL ));
306
+ }
307
+
298
308
private static LoadBalancingStrategy loadLoadBalancingStrategy (
299
309
final Properties properties ,
300
310
final LoadBalancingStrategy currentValue ) {
0 commit comments