forked from JetBrains/phpstorm-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcassandra.php
8117 lines (7199 loc) · 267 KB
/
cassandra.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Helper autocomplete for php cassandra extension.
* Compiled using the https://github.com/datastax/php-driver/blob/master/ext/doc/generate_doc.sh
*
* @see https://github.com/datastax/php-driver/tree/master/ext/doc
*
* @author Vasyl Sovyak <soulshockers@gmail.com>
* @link https://github.com/soulshockers/cassandra-phpdoc
*/
/**
* Copyright 2019 DataStax, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace {
/**
* The main entry point to the PHP Driver for Apache Cassandra.
*
* Use Cassandra::cluster() to build a cluster instance.
* Use Cassandra::ssl() to build SSL options instance.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/
*/
final class Cassandra
{
/**
* Consistency level ANY means the request is fulfilled as soon as the data
* has been written on the Coordinator. Requests with this consistency level
* are not guranteed to make it to Replica nodes.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_ANY
*/
const CONSISTENCY_ANY = 0;
/**
* Consistency level ONE guarantees that data has been written to at least
* one Replica node.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_ONE
*/
const CONSISTENCY_ONE = 1;
/**
* Consistency level TWO guarantees that data has been written to at least
* two Replica nodes.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_TWO
*/
const CONSISTENCY_TWO = 2;
/**
* Consistency level THREE guarantees that data has been written to at least
* three Replica nodes.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_THREE
*/
const CONSISTENCY_THREE = 3;
/**
* Consistency level QUORUM guarantees that data has been written to at least
* the majority of Replica nodes. How many nodes exactly are a majority
* depends on the replication factor of a given keyspace and is calculated
* using the formula `ceil(RF / 2 + 1)`, where `ceil` is a mathematical
* ceiling function and `RF` is the replication factor used. For example,
* for a replication factor of `5`, the majority is `ceil(5 / 2 + 1) = 3`.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_QUORUM
*/
const CONSISTENCY_QUORUM = 4;
/**
* Consistency level ALL guarantees that data has been written to all
* Replica nodes.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_ALL
*/
const CONSISTENCY_ALL = 5;
/**
* Same as `CONSISTENCY_QUORUM`, but confined to the local data center. This
* consistency level works only with `NetworkTopologyStrategy` replication.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_LOCAL_QUORUM
*/
const CONSISTENCY_LOCAL_QUORUM = 6;
/**
* Consistency level EACH_QUORUM guarantees that data has been written to at
* least a majority Replica nodes in all datacenters. This consistency level
* works only with `NetworkTopologyStrategy` replication.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_EACH_QUORUM
*/
const CONSISTENCY_EACH_QUORUM = 7;
/**
* This is a serial consistency level, it is used in conditional updates,
* e.g. (`CREATE|INSERT ... IF NOT EXISTS`), and should be specified as the
* `serial_consistency` execution option when invoking `session.execute`
* or `session.execute_async`.
*
* Consistency level SERIAL, when set, ensures that a Paxos commit fails if
* any of the replicas is down.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_SERIAL
*/
const CONSISTENCY_SERIAL = 8;
/**
* Same as `CONSISTENCY_SERIAL`, but confined to the local data center. This
* consistency level works only with `NetworkTopologyStrategy` replication.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_LOCAL_SERIAL
*/
const CONSISTENCY_LOCAL_SERIAL = 9;
/**
* Same as `CONSISTENCY_ONE`, but confined to the local data center. This
* consistency level works only with `NetworkTopologyStrategy` replication.
*
* @see \Cassandra\Session::execute()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CONSISTENCY_LOCAL_ONE
*/
const CONSISTENCY_LOCAL_ONE = 10;
/**
* Perform no verification of nodes when using SSL encryption.
*
* @see \Cassandra\SSLOptions\Builder::withVerifyFlags()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-VERIFY_NONE
*/
const VERIFY_NONE = 0;
/**
* Verify presence and validity of SSL certificates.
*
* @see \Cassandra\SSLOptions\Builder::withVerifyFlags()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-VERIFY_PEER_CERT
*/
const VERIFY_PEER_CERT = 1;
/**
* Verify that the IP address matches the SSL certificate’s common name or
* one of its subject alternative names. This implies the certificate is
* also present.
*
* @see \Cassandra\SSLOptions\Builder::withVerifyFlags()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-VERIFY_PEER_IDENTITY
*/
const VERIFY_PEER_IDENTITY = 2;
/**
* @see \Cassandra\BatchStatement::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-BATCH_LOGGED
*/
const BATCH_LOGGED = 0;
/**
* @see \Cassandra\BatchStatement::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-BATCH_UNLOGGED
*/
const BATCH_UNLOGGED = 1;
/**
* @see \Cassandra\BatchStatement::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-BATCH_COUNTER
*/
const BATCH_COUNTER = 2;
/**
* Used to disable logging.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-LOG_DISABLED
*/
const LOG_DISABLED = 0;
/**
* Allow critical level logging.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-LOG_CRITICAL
*/
const LOG_CRITICAL = 1;
/**
* Allow error level logging.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-LOG_ERROR
*/
const LOG_ERROR = 2;
/**
* Allow warning level logging.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-LOG_WARN
*/
const LOG_WARN = 3;
/**
* Allow info level logging.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-LOG_INFO
*/
const LOG_INFO = 4;
/**
* Allow debug level logging.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-LOG_DEBUG
*/
const LOG_DEBUG = 5;
/**
* Allow trace level logging.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-LOG_TRACE
*/
const LOG_TRACE = 6;
/**
* When using a map, collection or set of type text, all of its elements
* must be strings.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_TEXT
*/
const TYPE_TEXT = 'text';
/**
* When using a map, collection or set of type ascii, all of its elements
* must be strings.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_ASCII
*/
const TYPE_ASCII = 'ascii';
/**
* When using a map, collection or set of type varchar, all of its elements
* must be strings.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_VARCHAR
*/
const TYPE_VARCHAR = 'varchar';
/**
* When using a map, collection or set of type bigint, all of its elements
* must be instances of Bigint.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_BIGINT
*/
const TYPE_BIGINT = 'bigint';
/**
* When using a map, collection or set of type smallint, all of its elements
* must be instances of Inet.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_SMALLINT
*/
const TYPE_SMALLINT = 'smallint';
/**
* When using a map, collection or set of type tinyint, all of its elements
* must be instances of Inet.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_TINYINT
*/
const TYPE_TINYINT = 'tinyint';
/**
* When using a map, collection or set of type blob, all of its elements
* must be instances of Blob.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_BLOB
*/
const TYPE_BLOB = 'blob';
/**
* When using a map, collection or set of type bool, all of its elements
* must be boolean.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_BOOLEAN
*/
const TYPE_BOOLEAN = 'boolean';
/**
* When using a map, collection or set of type counter, all of its elements
* must be instances of Bigint.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_COUNTER
*/
const TYPE_COUNTER = 'counter';
/**
* When using a map, collection or set of type decimal, all of its elements
* must be instances of Decimal.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_DECIMAL
*/
const TYPE_DECIMAL = 'decimal';
/**
* When using a map, collection or set of type double, all of its elements
* must be doubles.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_DOUBLE
*/
const TYPE_DOUBLE = 'double';
/**
* When using a map, collection or set of type float, all of its elements
* must be instances of Float.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_FLOAT
*/
const TYPE_FLOAT = 'float';
/**
* When using a map, collection or set of type int, all of its elements
* must be ints.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_INT
*/
const TYPE_INT = 'int';
/**
* When using a map, collection or set of type timestamp, all of its elements
* must be instances of Timestamp.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_TIMESTAMP
*/
const TYPE_TIMESTAMP = 'timestamp';
/**
* When using a map, collection or set of type uuid, all of its elements
* must be instances of Uuid.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_UUID
*/
const TYPE_UUID = 'uuid';
/**
* When using a map, collection or set of type varint, all of its elements
* must be instances of Varint.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_VARINT
*/
const TYPE_VARINT = 'varint';
/**
* When using a map, collection or set of type timeuuid, all of its elements
* must be instances of Timeuuid.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_TIMEUUID
*/
const TYPE_TIMEUUID = 'timeuuid';
/**
* When using a map, collection or set of type inet, all of its elements
* must be instances of Inet.
*
* @see Set::__construct()
* @see Collection::__construct()
* @see Map::__construct()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-TYPE_INET
*/
const TYPE_INET = 'inet';
/**
* The current version of the extension.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-VERSION
*/
const VERSION = '1.3.2';
/**
* The version of the cpp-driver the extension is compiled against.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#constant-CPP_DRIVER_VERSION
*/
const CPP_DRIVER_VERSION = '2.13.0';
/**
* Creates a new cluster builder for constructing a Cluster object.
*
* @return \Cassandra\Cluster\Builder A cluster builder object with default settings
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#method-cluster
*/
public static function cluster()
{
}
/**
* Creates a new ssl builder for constructing a SSLOptions object.
*
* @return \Cassandra\SSLOptions\Builder A SSL options builder with default settings
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/class.Cassandra/#method-ssl
*/
public static function ssl()
{
}
}
}
/**
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/
*/
namespace Cassandra {
/**
* A PHP representation of a column
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Column/
*/
interface Column
{
/**
* Returns the name of the column.
*
* @return string Name of the column or null
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Column/#method-name
*/
public function name();
/**
* Returns the type of the column.
*
* @return \Cassandra\Type Type of the column
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Column/#method-type
*/
public function type();
/**
* Returns whether the column is in descending or ascending order.
*
* @return bool Whether the column is stored in descending order.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Column/#method-isReversed
*/
public function isReversed();
/**
* Returns true for static columns.
*
* @return bool Whether the column is static
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Column/#method-isStatic
*/
public function isStatic();
/**
* Returns true for frozen columns.
*
* @return bool Whether the column is frozen
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Column/#method-isFrozen
*/
public function isFrozen();
/**
* Returns name of the index if defined.
*
* @return string Name of the index if defined or null
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Column/#method-indexName
*/
public function indexName();
/**
* Returns index options if present.
*
* @return string Index options if present or null
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Column/#method-indexOptions
*/
public function indexOptions();
}
/**
* A session is used to prepare and execute statements.
*
* @see \Cassandra\Cluster::connect()
* @see \Cassandra\Cluster::connectAsync()
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Session/
*/
interface Session
{
/**
* Execute a query.
*
* Available execution options:
* | Option Name | Option **Type** | Option Details |
* |--------------------|-----------------|----------------------------------------------------------------------------------------------------------|
* | arguments | array | An array or positional or named arguments |
* | consistency | int | A consistency constant e.g Dse::CONSISTENCY_ONE, Dse::CONSISTENCY_QUORUM, etc. |
* | timeout | int | A number of rows to include in result for paging |
* | paging_state_token | string | A string token use to resume from the state of a previous result set |
* | retry_policy | RetryPolicy | A retry policy that is used to handle server-side failures for this request |
* | serial_consistency | int | Either Dse::CONSISTENCY_SERIAL or Dse::CONSISTENCY_LOCAL_SERIAL |
* | timestamp | int\|string | Either an integer or integer string timestamp that represents the number of microseconds since the epoch |
* | execute_as | string | User to execute statement as |
*
* @param string|\Cassandra\Statement $statement string or statement to be executed.
* @param array|\Cassandra\ExecutionOptions|null $options Options to control execution of the query.
*
* @return \Cassandra\Rows A collection of rows.
* @throws \Cassandra\Exception
*
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Session/#method-execute
*/
public function execute($statement, $options);
/**
* Execute a query asynchronously. This method returns immediately, but
* the query continues execution in the background.
*
* @param string|\Cassandra\Statement $statement string or statement to be executed.
* @param array|\Cassandra\ExecutionOptions|null $options Options to control execution of the query.
*
* @return \Cassandra\FutureRows A future that can be used to retrieve the result.
*
* @see \Cassandra\Session::execute() for valid execution options
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Session/#method-executeAsync
*/
public function executeAsync($statement, $options);
/**
* Prepare a query for execution.
*
* @param string $cql The query to be prepared.
* @param array|\Cassandra\ExecutionOptions|null $options Options to control preparing the query.
*
* @return \Cassandra\PreparedStatement A prepared statement that can be bound with parameters and executed.
*
* @throws \Cassandra\Exception
*
* @see \Cassandra\Session::execute() for valid execution options
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Session/#method-prepare
*/
public function prepare($cql, $options);
/**
* Asynchronously prepare a query for execution.
*
* @param string $cql The query to be prepared.
* @param array|\Cassandra\ExecutionOptions|null $options Options to control preparing the query.
*
* @return \Cassandra\FuturePreparedStatement A future that can be used to retrieve the prepared statement.
*
* @see \Cassandra\Session::execute() for valid execution options
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Session/#method-prepareAsync
*/
public function prepareAsync($cql, $options);
/**
* Close the session and all its connections.
*
* @param double $timeout The amount of time in seconds to wait for the session to close.
*
* @return null Nothing.
* @throws \Cassandra\Exception
*
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Session/#method-close
*/
public function close($timeout);
/**
* Asynchronously close the session and all its connections.
*
* @return \Cassandra\FutureClose A future that can be waited on.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Session/#method-closeAsync
*/
public function closeAsync();
/**
* Get performance and diagnostic metrics.
*
* @return array Performance/Diagnostic metrics.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Session/#method-metrics
*/
public function metrics();
/**
* Get a snapshot of the cluster's current schema.
*
* @return \Cassandra\Schema A snapshot of the cluster's schema.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Session/#method-schema
*/
public function schema();
}
/**
* A PHP representation of a table
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/
*/
interface Table
{
/**
* Returns the name of this table
*
* @return string Name of the table
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-name
*/
public function name();
/**
* Return a table's option by name
*
* @param string $name The name of the option
*
* @return \Cassandra\Value Value of an option by name
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-option
*/
public function option($name);
/**
* Returns all the table's options
*
* @return array A dictionary of `string` and `Value` pairs of the table's options.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-options
*/
public function options();
/**
* Description of the table, if any
*
* @return string Table description or null
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-comment
*/
public function comment();
/**
* Returns read repair chance
*
* @return float Read repair chance
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-readRepairChance
*/
public function readRepairChance();
/**
* Returns local read repair chance
*
* @return float Local read repair chance
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-localReadRepairChance
*/
public function localReadRepairChance();
/**
* Returns GC grace seconds
*
* @return int GC grace seconds
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-gcGraceSeconds
*/
public function gcGraceSeconds();
/**
* Returns caching options
*
* @return string Caching options
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-caching
*/
public function caching();
/**
* Returns bloom filter FP chance
*
* @return float Bloom filter FP chance
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-bloomFilterFPChance
*/
public function bloomFilterFPChance();
/**
* Returns memtable flush period in milliseconds
*
* @return int Memtable flush period in milliseconds
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-memtableFlushPeriodMs
*/
public function memtableFlushPeriodMs();
/**
* Returns default TTL.
*
* @return int Default TTL.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-defaultTTL
*/
public function defaultTTL();
/**
* Returns speculative retry.
*
* @return string Speculative retry.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-speculativeRetry
*/
public function speculativeRetry();
/**
* Returns index interval
*
* @return int Index interval
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-indexInterval
*/
public function indexInterval();
/**
* Returns compaction strategy class name
*
* @return string Compaction strategy class name
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-compactionStrategyClassName
*/
public function compactionStrategyClassName();
/**
* Returns compaction strategy options
*
* @return \Cassandra\Map Compaction strategy options
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-compactionStrategyOptions
*/
public function compactionStrategyOptions();
/**
* Returns compression parameters
*
* @return \Cassandra\Map Compression parameters
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-compressionParameters
*/
public function compressionParameters();
/**
* Returns whether or not the `populate_io_cache_on_flush` is true
*
* @return bool Value of `populate_io_cache_on_flush` or null
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-populateIOCacheOnFlush
*/
public function populateIOCacheOnFlush();
/**
* Returns whether or not the `replicate_on_write` is true
*
* @return bool Value of `replicate_on_write` or null
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-replicateOnWrite
*/
public function replicateOnWrite();
/**
* Returns the value of `max_index_interval`
*
* @return int Value of `max_index_interval` or null
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-maxIndexInterval
*/
public function maxIndexInterval();
/**
* Returns the value of `min_index_interval`
*
* @return int Value of `min_index_interval` or null
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-minIndexInterval
*/
public function minIndexInterval();
/**
* Returns column by name
*
* @param string $name Name of the column
*
* @return \Cassandra\Column Column instance
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-column
*/
public function column($name);
/**
* Returns all columns in this table
*
* @return array A list of Column instances
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-columns
*/
public function columns();
/**
* Returns the partition key columns of the table
*
* @return array A list of of Column instances
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-partitionKey
*/
public function partitionKey();
/**
* Returns both the partition and clustering key columns of the table
*
* @return array A list of of Column instances
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-primaryKey
*/
public function primaryKey();
/**
* Returns the clustering key columns of the table
*
* @return array A list of of Column instances
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-clusteringKey
*/
public function clusteringKey();
/**
* @return array A list of cluster column orders ('asc' and 'desc')
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-clusteringOrder
*/
public function clusteringOrder();
}
/**
* Interface for retry policies.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.RetryPolicy/
*/
interface RetryPolicy
{
}
/**
* Interface for timestamp generators.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.TimestampGenerator/
*/
interface TimestampGenerator
{
}
/**
* An interface implemented by all exceptions thrown by the PHP Driver.
* Makes it easy to catch all driver-related exceptions using
* `catch (Exception $e)`.
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Exception/
*/
interface Exception
{
}
/**
* A PHP representation of a function
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Function/
*/
interface Function_
{
/**
* Returns the full name of the function
*
* @return string Full name of the function including name and types
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Function/#method-name
*/
public function name();
/**
* Returns the simple name of the function
*
* @return string Simple name of the function
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Function/#method-simpleName
*/
public function simpleName();
/**
* Returns the arguments of the function
*
* @return array Arguments of the function
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Function/#method-arguments
*/
public function arguments();
/**
* Returns the return type of the function
*
* @return \Cassandra\Type Return type of the function
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Function/#method-returnType
*/
public function returnType();
/**
* Returns the signature of the function
*
* @return string Signature of the function (same as name())
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Function/#method-signature
*/
public function signature();
/**
* Returns the lanuage of the function
*
* @return string Language used by the function
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Function/#method-language
*/
public function language();
/**
* Returns the body of the function
*
* @return string Body of the function
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Function/#method-body
*/
public function body();
/**
* Determines if a function is called when the value is null.
*
* @return bool Returns whether the function is called when the input columns are null
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Function/#method-isCalledOnNullInput
*/
public function isCalledOnNullInput();
}
/**
* A PHP representation of the CQL `uuid` datatype
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.UuidInterface/
*/
interface UuidInterface
{
/**
* Returns this uuid as string.
*
* @return string uuid as string
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.UuidInterface/#method-uuid
*/
public function uuid();
/**
* Returns the version of this uuid.
*
* @return int version of this uuid
* @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.UuidInterface/#method-version
*/
public function version();