1 | <?php |
||
10 | class CassandraConnector extends Connector implements ConnectorInterface |
||
11 | { |
||
12 | const DEFAULT_PAGE_SIZE = 5000; |
||
13 | |||
14 | /** |
||
15 | * Cassandra Cluster Builder instance |
||
16 | * |
||
17 | * @var \Cassandra\Cluster\Builder |
||
18 | */ |
||
19 | protected $builder; |
||
20 | |||
21 | /** |
||
22 | * Establish a database connection. |
||
23 | * |
||
24 | * @param array $config |
||
25 | * |
||
26 | * @return \Cassandra\Cluster |
||
27 | */ |
||
28 | 48 | public function connect(array $config) |
|
38 | |||
39 | /** |
||
40 | * Set username and password to cluster connection. |
||
41 | * Set cluster contact points (IP addresses) |
||
42 | * Set connection communication port |
||
43 | * |
||
44 | * @param array $config |
||
45 | */ |
||
46 | 48 | protected function setConnectionOptions(array $config) |
|
59 | |||
60 | /** |
||
61 | * Parse contact points list from config |
||
62 | * |
||
63 | * @param array $config |
||
64 | * |
||
65 | * @return array |
||
66 | */ |
||
67 | 48 | protected function getContactPoints(array $config) |
|
81 | |||
82 | /** |
||
83 | * Parse communication port or set default |
||
84 | * |
||
85 | * @param array $config |
||
86 | * |
||
87 | * @return int |
||
88 | */ |
||
89 | 48 | protected function getPort(array $config) |
|
93 | |||
94 | /** |
||
95 | * Set default consistency level |
||
96 | * Set default timeouts to queries |
||
97 | * Set default response size to queries |
||
98 | * |
||
99 | * @param array $config |
||
100 | */ |
||
101 | 48 | protected function setDefaultQueryOptions(array $config) |
|
127 | |||
128 | } |