Skip to content

Commit aa7eb39

Browse files
stamhankar999mpenick
authored andcommitted
PHP-183 - Clean up SimpleStatement and ExecutionOption references in docs and tests
* Updated ExecutionOptions.yaml and Session.yaml to move execution option descriptions to a table in Session.execute's method description. * Cleaned up Session.executeGraph execution options to be in a table in the method description. * Update ExecutionOptions::__construct refs in Core.yaml to point to Session.execute().
1 parent ab5b07c commit aa7eb39

30 files changed

+612
-1319
lines changed

ext/src/Core.yaml

+13-12
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@ Cassandra:
2525
has been written on the Coordinator. Requests with this consistency level
2626
are not guranteed to make it to Replica nodes.
2727
28-
@see ExecutionOptions::__construct()
28+
@see Session::execute()
2929
CONSISTENCY_ONE:
3030
comment: |-
3131
Consistency level ONE guarantees that data has been written to at least
3232
one Replica node.
3333
34-
@see ExecutionOptions::__construct()
34+
@see Session::execute()
3535
CONSISTENCY_LOCAL_ONE:
3636
comment: |-
3737
Same as `CONSISTENCY_ONE`, but confined to the local data center. This
3838
consistency level works only with `NetworkTopologyStrategy` replication.
3939
40-
@see ExecutionOptions::__construct()
40+
@see Session::execute()
4141
CONSISTENCY_TWO:
4242
comment: |-
4343
Consistency level TWO guarantees that data has been written to at least
4444
two Replica nodes.
4545
46-
@see ExecutionOptions::__construct()
46+
@see Session::execute()
4747
CONSISTENCY_THREE:
4848
comment: |-
4949
Consistency level THREE guarantees that data has been written to at least
5050
three Replica nodes.
5151
52-
@see ExecutionOptions::__construct()
52+
@see Session::execute()
5353
CONSISTENCY_QUORUM:
5454
comment: |-
5555
Consistency level QUORUM guarantees that data has been written to at least
@@ -59,42 +59,43 @@ Cassandra:
5959
ceiling function and `RF` is the replication factor used. For example,
6060
for a replication factor of `5`, the majority is `ceil(5 / 2 + 1) = 3`.
6161
62-
@see ExecutionOptions::__construct()
62+
@see Session::execute()
6363
CONSISTENCY_LOCAL_QUORUM:
6464
comment: |-
6565
Same as `CONSISTENCY_QUORUM`, but confined to the local data center. This
6666
consistency level works only with `NetworkTopologyStrategy` replication.
6767
68-
@see ExecutionOptions::__construct()
68+
@see Session::execute()
6969
CONSISTENCY_EACH_QUORUM:
7070
comment: |-
7171
Consistency level EACH_QUORUM guarantees that data has been written to at
7272
least a majority Replica nodes in all datacenters. This consistency level
7373
works only with `NetworkTopologyStrategy` replication.
7474
75-
@see ExecutionOptions::__construct()
75+
@see Session::execute()
7676
CONSISTENCY_ALL:
7777
comment: |-
7878
Consistency level ALL guarantees that data has been written to all
7979
Replica nodes.
8080
81-
@see ExecutionOptions::__construct()
81+
@see Session::execute()
8282
CONSISTENCY_SERIAL:
8383
comment: |-
8484
This is a serial consistency level, it is used in conditional updates,
8585
e.g. (`CREATE|INSERT ... IF NOT EXISTS`), and should be specified as the
86-
`serial_consistency` option of the ExecutionOptions instance.
86+
`serial_consistency` execution option when invoking `session.execute`
87+
or `session.execute_async`.
8788
8889
Consistency level SERIAL, when set, ensures that a Paxos commit fails if
8990
any of the replicas is down.
9091
91-
@see ExecutionOptions::__construct()
92+
@see Session::execute()
9293
CONSISTENCY_LOCAL_SERIAL:
9394
comment: |-
9495
Same as `CONSISTENCY_SERIAL`, but confined to the local data center. This
9596
consistency level works only with `NetworkTopologyStrategy` replication.
9697
97-
@see ExecutionOptions::__construct()
98+
@see Session::execute()
9899
VERIFY_NONE:
99100
comment: |-
100101
Perform no verification of nodes when using SSL encryption.

ext/src/DefaultSession.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ DefaultSession:
3939
type: string
4040
options:
4141
comment: '{@inheritDoc}'
42-
type: ExecutionOptions
42+
type: array|ExecutionOptions|null
4343
return:
4444
comment: '{@inheritDoc}'
4545
type: PreparedStatement
@@ -51,7 +51,7 @@ DefaultSession:
5151
type: string
5252
options:
5353
comment: '{@inheritDoc}'
54-
type: ExecutionOptions
54+
type: array|ExecutionOptions|null
5555
return:
5656
comment: '{@inheritDoc}'
5757
type: FuturePreparedStatement

ext/src/ExecutionOptions.yaml

+3-9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ ExecutionOptions:
33
comment: |-
44
Request execution options.
55
6+
@deprecated Use an array of options instead of creating an instance of this class.
7+
68
@see Session::execute()
79
@see Session::executeAsync()
810
@see Session::prepare()
@@ -12,15 +14,7 @@ ExecutionOptions:
1214
comment: |-
1315
Creates a new options object for execution.
1416
15-
* array['arguments'] array An array or positional or named arguments
16-
* array['consistency'] int One of Cassandra::CONSISTENCY_*
17-
* array['timeout'] int|null A number of seconds or null
18-
* array['page_size'] int A number of rows to include in result for paging
19-
* array['paging_state_token'] string A string token use to resume from the state of a previous result set
20-
* array['retry_policy'] RetryPolicy A retry policy that is used to handle server-side failures for this request
21-
* array['serial_consistency'] int Either Cassandra::CONSISTENCY_SERIAL or Cassandra::CONSISTENCY_LOCAL_SERIAL
22-
* array['timestamp'] int|string Either an integer or integer string timestamp that represents the number
23-
of microseconds since the epoch.
17+
@see Session::execute() for valid execution options
2418
2519
@throws Exception\InvalidArgumentException
2620
params:

ext/src/Session.yaml

+28-9
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,28 @@ Session:
77
@see Cluster::connectAsync()
88
methods:
99
execute:
10-
comment: |
10+
comment: |-
1111
Execute a query.
1212
13+
Available execution options:
14+
| Option Name | Option **Type** | Option Details |
15+
|--------------------|-----------------|----------------------------------------------------------------------------------------------------------|
16+
| arguments | array | An array or positional or named arguments |
17+
| consistency | int | A consistency constant e.g Dse::CONSISTENCY_ONE, Dse::CONSISTENCY_QUORUM, etc. |
18+
| timeout | int | A number of rows to include in result for paging |
19+
| paging_state_token | string | A string token use to resume from the state of a previous result set |
20+
| retry_policy | RetryPolicy | A retry policy that is used to handle server-side failures for this request |
21+
| serial_consistency | int | Either Dse::CONSISTENCY_SERIAL or Dse::CONSISTENCY_LOCAL_SERIAL |
22+
| timestamp | int\|string | Either an integer or integer string timestamp that represents the number of microseconds since the epoch |
23+
| execute_as | string | User to execute statement as |
24+
1325
@throws Exception
1426
params:
1527
statement:
1628
comment: string or statement to be executed.
1729
type: string|Statement
1830
options:
19-
comment: execution options (optional)
31+
comment: Options to control execution of the query.
2032
type: array|ExecutionOptions|null
2133
return:
2234
comment: A collection of rows.
@@ -25,12 +37,14 @@ Session:
2537
comment: |-
2638
Execute a query asynchronously. This method returns immediately, but
2739
the query continues execution in the background.
40+
41+
@see Session::execute() for valid execution options
2842
params:
2943
statement:
3044
comment: string or statement to be executed.
3145
type: string|Statement
3246
options:
33-
comment: execution options (optional)
47+
comment: Options to control execution of the query.
3448
type: array|ExecutionOptions|null
3549
return:
3650
comment: A future that can be used to retrieve the result.
@@ -40,26 +54,31 @@ Session:
4054
Prepare a query for execution.
4155
4256
@throws Exception
57+
58+
@see Session::execute() for valid execution options
4359
params:
4460
cql:
4561
comment: The query to be prepared.
4662
type: string
4763
options:
48-
comment: Options to control preparing the query.
49-
type: ExecutionOptions
64+
comment: |
65+
Options to control preparing the query.
66+
type: array|ExecutionOptions|null
5067
return:
51-
comment: |
52-
A prepared statement that can be bound with parameters and executed.
68+
comment: A prepared statement that can be bound with parameters and executed.
5369
type: PreparedStatement
5470
prepareAsync:
55-
comment: Asynchronously prepare a query for execution.
71+
comment: |
72+
Asynchronously prepare a query for execution.
73+
74+
@see Session::execute() for valid execution options
5675
params:
5776
cql:
5877
comment: The query to be prepared.
5978
type: string
6079
options:
6180
comment: Options to control preparing the query.
62-
type: ExecutionOptions
81+
type: array|ExecutionOptions|null
6382
return:
6483
comment: A future that can be used to retrieve the prepared statement.
6584
type: FuturePreparedStatement

0 commit comments

Comments
 (0)