Skip to content

Commit dd7e8d6

Browse files
committed
Merge pull request #78 from datastax/83
83 - Fix: Use the C++ driver's default load balancing policy
2 parents 7035c89 + f46ebb7 commit dd7e8d6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ext/php_cassandra_types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ PHP_CASSANDRA_BEGIN_OBJECT_TYPE(execution_options)
230230
PHP_CASSANDRA_END_OBJECT_TYPE(execution_options)
231231

232232
typedef enum {
233-
LOAD_BALANCING_ROUND_ROBIN = 0,
233+
LOAD_BALANCING_DEFAULT = 0,
234+
LOAD_BALANCING_ROUND_ROBIN,
234235
LOAD_BALANCING_DC_AWARE_ROUND_ROBIN
235236
} cassandra_load_balancing;
236237

ext/src/Cassandra/Cluster/Builder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ php_cassandra_cluster_builder_properties(zval *object TSRMLS_DC)
10541054
PHP5TO7_ZVAL_STRING(PHP5TO7_ZVAL_MAYBE_P(contactPoints), self->contact_points);
10551055

10561056
PHP5TO7_ZVAL_MAYBE_MAKE(loadBalancingPolicy);
1057-
ZVAL_DOUBLE(PHP5TO7_ZVAL_MAYBE_P(loadBalancingPolicy), self->load_balancing_policy);
1057+
ZVAL_LONG(PHP5TO7_ZVAL_MAYBE_P(loadBalancingPolicy), self->load_balancing_policy);
10581058

10591059
PHP5TO7_ZVAL_MAYBE_MAKE(localDatacenter);
10601060
PHP5TO7_ZVAL_MAYBE_MAKE(hostPerRemoteDatacenter);
@@ -1295,7 +1295,7 @@ php_cassandra_cluster_builder_new(zend_class_entry *ce TSRMLS_DC)
12951295

12961296
self->contact_points = estrdup("127.0.0.1");
12971297
self->port = 9042;
1298-
self->load_balancing_policy = LOAD_BALANCING_ROUND_ROBIN;
1298+
self->load_balancing_policy = LOAD_BALANCING_DEFAULT;
12991299
self->local_dc = NULL;
13001300
self->used_hosts_per_remote_dc = 0;
13011301
self->allow_remote_dcs_for_local_cl = 0;

0 commit comments

Comments
 (0)