From c3784b3d0b3fa1c437f33108cb5c97b3099f3256 Mon Sep 17 00:00:00 2001 From: Tom Kay Date: Mon, 2 Mar 2015 11:45:05 +0000 Subject: [PATCH] bump to latest thrift version refactor unnecessary fully qualified class names --- refactor.php | 27 + src/cassandra/Cassandra.php | 8591 +++++++---------------------------- src/cassandra/Types.php | 4469 +++--------------- update.sh | 4 +- 4 files changed, 2304 insertions(+), 10787 deletions(-) create mode 100644 refactor.php diff --git a/refactor.php b/refactor.php new file mode 100644 index 0000000..40be806 --- /dev/null +++ b/refactor.php @@ -0,0 +1,27 @@ +predicate for a particular key, * ColumnFamily and optionally SuperColumn. * * @param string $key - * @param \cassandra\ColumnParent $column_parent - * @param \cassandra\SlicePredicate $predicate + * @param ColumnParent $column_parent + * @param SlicePredicate $predicate * @param int $consistency_level * @return int - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function get_count($key, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level); + public function get_count($key, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level); /** * Performs a get_slice for column_parent and predicate for the given keys in parallel. * * @param string[] $keys - * @param \cassandra\ColumnParent $column_parent - * @param \cassandra\SlicePredicate $predicate + * @param ColumnParent $column_parent + * @param SlicePredicate $predicate * @param int $consistency_level * @return array - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function multiget_slice(array $keys, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level); + public function multiget_slice(array $keys, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level); /** * Perform a get_count in parallel on the given list keys. The return value maps keys to the count found. * * @param string[] $keys - * @param \cassandra\ColumnParent $column_parent - * @param \cassandra\SlicePredicate $predicate + * @param ColumnParent $column_parent + * @param SlicePredicate $predicate * @param int $consistency_level * @return array - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function multiget_count(array $keys, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level); + public function multiget_count(array $keys, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level); /** * returns a subset of columns for a contiguous range of keys. * - * @param \cassandra\ColumnParent $column_parent - * @param \cassandra\SlicePredicate $predicate - * @param \cassandra\KeyRange $range + * @param ColumnParent $column_parent + * @param SlicePredicate $predicate + * @param KeyRange $range * @param int $consistency_level - * @return \cassandra\KeySlice[] - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @return KeySlice[] + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function get_range_slices(\cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, \cassandra\KeyRange $range, $consistency_level); + public function get_range_slices(ColumnParent $column_parent, SlicePredicate $predicate, KeyRange $range, $consistency_level); /** * returns a range of columns, wrapping to the next rows if necessary to collect max_results. * * @param string $column_family - * @param \cassandra\KeyRange $range + * @param KeyRange $range * @param string $start_column * @param int $consistency_level - * @return \cassandra\KeySlice[] - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @return KeySlice[] + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function get_paged_slice($column_family, \cassandra\KeyRange $range, $start_column, $consistency_level); + public function get_paged_slice($column_family, KeyRange $range, $start_column, $consistency_level); /** * Returns the subset of columns specified in SlicePredicate for the rows matching the IndexClause * @deprecated use get_range_slices instead with range.row_filter specified * - * @param \cassandra\ColumnParent $column_parent - * @param \cassandra\IndexClause $index_clause - * @param \cassandra\SlicePredicate $column_predicate + * @param ColumnParent $column_parent + * @param IndexClause $index_clause + * @param SlicePredicate $column_predicate * @param int $consistency_level - * @return \cassandra\KeySlice[] - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @return KeySlice[] + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function get_indexed_slices(\cassandra\ColumnParent $column_parent, \cassandra\IndexClause $index_clause, \cassandra\SlicePredicate $column_predicate, $consistency_level); + public function get_indexed_slices(ColumnParent $column_parent, IndexClause $index_clause, SlicePredicate $column_predicate, $consistency_level); /** * Insert a Column at the given column_parent.column_family and optional column_parent.super_column. * * @param string $key - * @param \cassandra\ColumnParent $column_parent - * @param \cassandra\Column $column + * @param ColumnParent $column_parent + * @param Column $column * @param int $consistency_level - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function insert($key, \cassandra\ColumnParent $column_parent, \cassandra\Column $column, $consistency_level); + public function insert($key, ColumnParent $column_parent, Column $column, $consistency_level); /** * Increment or decrement a counter. * * @param string $key - * @param \cassandra\ColumnParent $column_parent - * @param \cassandra\CounterColumn $column + * @param ColumnParent $column_parent + * @param CounterColumn $column * @param int $consistency_level - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function add($key, \cassandra\ColumnParent $column_parent, \cassandra\CounterColumn $column, $consistency_level); + public function add($key, ColumnParent $column_parent, CounterColumn $column, $consistency_level); /** * Atomic compare and set. * @@ -191,14 +191,14 @@ public function add($key, \cassandra\ColumnParent $column_parent, \cassandra\Cou * * @param string $key * @param string $column_family - * @param \cassandra\Column[] $expected - * @param \cassandra\Column[] $updates + * @param Column[] $expected + * @param Column[] $updates * @param int $serial_consistency_level * @param int $commit_consistency_level - * @return \cassandra\CASResult - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @return CASResult + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ public function cas($key, $column_family, array $expected, array $updates, $serial_consistency_level, $commit_consistency_level); /** @@ -207,27 +207,27 @@ public function cas($key, $column_family, array $expected, array $updates, $seri * row by just specifying the ColumnFamily, or you can remove a SuperColumn or a single Column by specifying those levels too. * * @param string $key - * @param \cassandra\ColumnPath $column_path + * @param ColumnPath $column_path * @param int $timestamp * @param int $consistency_level - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function remove($key, \cassandra\ColumnPath $column_path, $timestamp, $consistency_level); + public function remove($key, ColumnPath $column_path, $timestamp, $consistency_level); /** * Remove a counter at the specified location. * Note that counters have limited support for deletes: if you remove a counter, you must wait to issue any following update * until the delete has reached all the nodes and all of them have been fully compacted. * * @param string $key - * @param \cassandra\ColumnPath $path + * @param ColumnPath $path * @param int $consistency_level - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function remove_counter($key, \cassandra\ColumnPath $path, $consistency_level); + public function remove_counter($key, ColumnPath $path, $consistency_level); /** * Mutate many columns or super columns for many row keys. See also: Mutation. * @@ -236,9 +236,9 @@ public function remove_counter($key, \cassandra\ColumnPath $path, $consistency_l * * @param array $mutation_map * @param int $consistency_level - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ public function batch_mutate(array $mutation_map, $consistency_level); /** @@ -249,9 +249,9 @@ public function batch_mutate(array $mutation_map, $consistency_level); * * @param array $mutation_map * @param int $consistency_level - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ public function atomic_batch_mutate(array $mutation_map, $consistency_level); /** @@ -263,35 +263,35 @@ public function atomic_batch_mutate(array $mutation_map, $consistency_level); * some hosts are down. * * @param string $cfname - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ public function truncate($cfname); /** * Select multiple slices of a key in a single RPC operation * - * @param \cassandra\MultiSliceRequest $request - * @return \cassandra\ColumnOrSuperColumn[] - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException + * @param MultiSliceRequest $request + * @return ColumnOrSuperColumn[] + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException */ - public function get_multi_slice(\cassandra\MultiSliceRequest $request); + public function get_multi_slice(MultiSliceRequest $request); /** * for each schema version present in the cluster, returns a list of nodes at that version. * hosts that do not respond will be under the key DatabaseDescriptor.INITIAL_VERSION. * the cluster is all on the same version if the size of the map is 1. * * @return array - * @throws \cassandra\InvalidRequestException + * @throws InvalidRequestException */ public function describe_schema_versions(); /** * list the defined keyspaces in this cluster * - * @return \cassandra\KsDef[] - * @throws \cassandra\InvalidRequestException + * @return KsDef[] + * @throws InvalidRequestException */ public function describe_keyspaces(); /** @@ -317,16 +317,16 @@ public function describe_version(); * order is neither important nor predictable. * * @param string $keyspace - * @return \cassandra\TokenRange[] - * @throws \cassandra\InvalidRequestException + * @return TokenRange[] + * @throws InvalidRequestException */ public function describe_ring($keyspace); /** * same as describe_ring, but considers only nodes in the local DC * * @param string $keyspace - * @return \cassandra\TokenRange[] - * @throws \cassandra\InvalidRequestException + * @return TokenRange[] + * @throws InvalidRequestException */ public function describe_local_ring($keyspace); /** @@ -335,7 +335,7 @@ public function describe_local_ring($keyspace); * https://issues.apache.org/jira/browse/CASSANDRA-4092 * * @return array - * @throws \cassandra\InvalidRequestException + * @throws InvalidRequestException */ public function describe_token_map(); /** @@ -354,9 +354,9 @@ public function describe_snitch(); * describe specified keyspace * * @param string $keyspace - * @return \cassandra\KsDef - * @throws \cassandra\NotFoundException - * @throws \cassandra\InvalidRequestException + * @return KsDef + * @throws NotFoundException + * @throws InvalidRequestException */ public function describe_keyspace($keyspace); /** @@ -371,7 +371,7 @@ public function describe_keyspace($keyspace); * @param string $end_token * @param int $keys_per_split * @return string[] - * @throws \cassandra\InvalidRequestException + * @throws InvalidRequestException */ public function describe_splits($cfName, $start_token, $end_token, $keys_per_split); /** @@ -386,74 +386,74 @@ public function trace_next_query(); * @param string $start_token * @param string $end_token * @param int $keys_per_split - * @return \cassandra\CfSplit[] - * @throws \cassandra\InvalidRequestException + * @return CfSplit[] + * @throws InvalidRequestException */ public function describe_splits_ex($cfName, $start_token, $end_token, $keys_per_split); /** * adds a column family. returns the new schema id. * - * @param \cassandra\CfDef $cf_def + * @param CfDef $cf_def * @return string - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\SchemaDisagreementException + * @throws InvalidRequestException + * @throws SchemaDisagreementException */ - public function system_add_column_family(\cassandra\CfDef $cf_def); + public function system_add_column_family(CfDef $cf_def); /** * drops a column family. returns the new schema id. * * @param string $column_family * @return string - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\SchemaDisagreementException + * @throws InvalidRequestException + * @throws SchemaDisagreementException */ public function system_drop_column_family($column_family); /** * adds a keyspace and any column families that are part of it. returns the new schema id. * - * @param \cassandra\KsDef $ks_def + * @param KsDef $ks_def * @return string - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\SchemaDisagreementException + * @throws InvalidRequestException + * @throws SchemaDisagreementException */ - public function system_add_keyspace(\cassandra\KsDef $ks_def); + public function system_add_keyspace(KsDef $ks_def); /** * drops a keyspace and any column families that are part of it. returns the new schema id. * * @param string $keyspace * @return string - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\SchemaDisagreementException + * @throws InvalidRequestException + * @throws SchemaDisagreementException */ public function system_drop_keyspace($keyspace); /** * updates properties of a keyspace. returns the new schema id. * - * @param \cassandra\KsDef $ks_def + * @param KsDef $ks_def * @return string - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\SchemaDisagreementException + * @throws InvalidRequestException + * @throws SchemaDisagreementException */ - public function system_update_keyspace(\cassandra\KsDef $ks_def); + public function system_update_keyspace(KsDef $ks_def); /** * updates properties of a column family. returns the new schema id. * - * @param \cassandra\CfDef $cf_def + * @param CfDef $cf_def * @return string - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\SchemaDisagreementException + * @throws InvalidRequestException + * @throws SchemaDisagreementException */ - public function system_update_column_family(\cassandra\CfDef $cf_def); + public function system_update_column_family(CfDef $cf_def); /** * @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead. * * @param string $query * @param int $compression - * @return \cassandra\CqlResult - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException - * @throws \cassandra\SchemaDisagreementException + * @return CqlResult + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException + * @throws SchemaDisagreementException */ public function execute_cql_query($query, $compression); /** @@ -463,11 +463,11 @@ public function execute_cql_query($query, $compression); * @param string $query * @param int $compression * @param int $consistency - * @return \cassandra\CqlResult - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException - * @throws \cassandra\SchemaDisagreementException + * @return CqlResult + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException + * @throws SchemaDisagreementException */ public function execute_cql3_query($query, $compression, $consistency); /** @@ -475,8 +475,8 @@ public function execute_cql3_query($query, $compression, $consistency); * * @param string $query * @param int $compression - * @return \cassandra\CqlPreparedResult - * @throws \cassandra\InvalidRequestException + * @return CqlPreparedResult + * @throws InvalidRequestException */ public function prepare_cql_query($query, $compression); /** @@ -487,8 +487,8 @@ public function prepare_cql_query($query, $compression); * * @param string $query * @param int $compression - * @return \cassandra\CqlPreparedResult - * @throws \cassandra\InvalidRequestException + * @return CqlPreparedResult + * @throws InvalidRequestException */ public function prepare_cql3_query($query, $compression); /** @@ -496,11 +496,11 @@ public function prepare_cql3_query($query, $compression); * * @param int $itemId * @param string[] $values - * @return \cassandra\CqlResult - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException - * @throws \cassandra\SchemaDisagreementException + * @return CqlResult + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException + * @throws SchemaDisagreementException */ public function execute_prepared_cql_query($itemId, array $values); /** @@ -510,23 +510,23 @@ public function execute_prepared_cql_query($itemId, array $values); * @param int $itemId * @param string[] $values * @param int $consistency - * @return \cassandra\CqlResult - * @throws \cassandra\InvalidRequestException - * @throws \cassandra\UnavailableException - * @throws \cassandra\TimedOutException - * @throws \cassandra\SchemaDisagreementException + * @return CqlResult + * @throws InvalidRequestException + * @throws UnavailableException + * @throws TimedOutException + * @throws SchemaDisagreementException */ public function execute_prepared_cql3_query($itemId, array $values, $consistency); /** * @deprecated This is now a no-op. Please use the CQL3 specific methods instead. * * @param string $version - * @throws \cassandra\InvalidRequestException + * @throws InvalidRequestException */ public function set_cql_version($version); } -class CassandraClient implements \cassandra\CassandraIf { +class CassandraClient implements CassandraIf { protected $input_ = null; protected $output_ = null; @@ -537,15 +537,15 @@ public function __construct($input, $output=null) { $this->output_ = $output ? $output : $input; } - public function login(\cassandra\AuthenticationRequest $auth_request) + public function login(AuthenticationRequest $auth_request) { $this->send_login($auth_request); $this->recv_login(); } - public function send_login(\cassandra\AuthenticationRequest $auth_request) + public function send_login(AuthenticationRequest $auth_request) { - $args = new \cassandra\Cassandra_login_args(); + $args = new Cassandra_login_args(); $args->auth_request = $auth_request; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -578,7 +578,7 @@ public function recv_login() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_login_result(); + $result = new Cassandra_login_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -599,7 +599,7 @@ public function set_keyspace($keyspace) public function send_set_keyspace($keyspace) { - $args = new \cassandra\Cassandra_set_keyspace_args(); + $args = new Cassandra_set_keyspace_args(); $args->keyspace = $keyspace; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -632,7 +632,7 @@ public function recv_set_keyspace() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_set_keyspace_result(); + $result = new Cassandra_set_keyspace_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -642,15 +642,15 @@ public function recv_set_keyspace() return; } - public function get($key, \cassandra\ColumnPath $column_path, $consistency_level) + public function get($key, ColumnPath $column_path, $consistency_level) { $this->send_get($key, $column_path, $consistency_level); return $this->recv_get(); } - public function send_get($key, \cassandra\ColumnPath $column_path, $consistency_level) + public function send_get($key, ColumnPath $column_path, $consistency_level) { - $args = new \cassandra\Cassandra_get_args(); + $args = new Cassandra_get_args(); $args->key = $key; $args->column_path = $column_path; $args->consistency_level = $consistency_level; @@ -685,7 +685,7 @@ public function recv_get() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_get_result(); + $result = new Cassandra_get_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -707,15 +707,15 @@ public function recv_get() throw new \Exception("get failed: unknown result"); } - public function get_slice($key, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level) + public function get_slice($key, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level) { $this->send_get_slice($key, $column_parent, $predicate, $consistency_level); return $this->recv_get_slice(); } - public function send_get_slice($key, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level) + public function send_get_slice($key, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level) { - $args = new \cassandra\Cassandra_get_slice_args(); + $args = new Cassandra_get_slice_args(); $args->key = $key; $args->column_parent = $column_parent; $args->predicate = $predicate; @@ -751,7 +751,7 @@ public function recv_get_slice() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_get_slice_result(); + $result = new Cassandra_get_slice_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -770,15 +770,15 @@ public function recv_get_slice() throw new \Exception("get_slice failed: unknown result"); } - public function get_count($key, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level) + public function get_count($key, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level) { $this->send_get_count($key, $column_parent, $predicate, $consistency_level); return $this->recv_get_count(); } - public function send_get_count($key, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level) + public function send_get_count($key, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level) { - $args = new \cassandra\Cassandra_get_count_args(); + $args = new Cassandra_get_count_args(); $args->key = $key; $args->column_parent = $column_parent; $args->predicate = $predicate; @@ -814,7 +814,7 @@ public function recv_get_count() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_get_count_result(); + $result = new Cassandra_get_count_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -833,15 +833,15 @@ public function recv_get_count() throw new \Exception("get_count failed: unknown result"); } - public function multiget_slice(array $keys, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level) + public function multiget_slice(array $keys, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level) { $this->send_multiget_slice($keys, $column_parent, $predicate, $consistency_level); return $this->recv_multiget_slice(); } - public function send_multiget_slice(array $keys, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level) + public function send_multiget_slice(array $keys, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level) { - $args = new \cassandra\Cassandra_multiget_slice_args(); + $args = new Cassandra_multiget_slice_args(); $args->keys = $keys; $args->column_parent = $column_parent; $args->predicate = $predicate; @@ -877,7 +877,7 @@ public function recv_multiget_slice() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_multiget_slice_result(); + $result = new Cassandra_multiget_slice_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -896,15 +896,15 @@ public function recv_multiget_slice() throw new \Exception("multiget_slice failed: unknown result"); } - public function multiget_count(array $keys, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level) + public function multiget_count(array $keys, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level) { $this->send_multiget_count($keys, $column_parent, $predicate, $consistency_level); return $this->recv_multiget_count(); } - public function send_multiget_count(array $keys, \cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, $consistency_level) + public function send_multiget_count(array $keys, ColumnParent $column_parent, SlicePredicate $predicate, $consistency_level) { - $args = new \cassandra\Cassandra_multiget_count_args(); + $args = new Cassandra_multiget_count_args(); $args->keys = $keys; $args->column_parent = $column_parent; $args->predicate = $predicate; @@ -940,7 +940,7 @@ public function recv_multiget_count() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_multiget_count_result(); + $result = new Cassandra_multiget_count_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -959,15 +959,15 @@ public function recv_multiget_count() throw new \Exception("multiget_count failed: unknown result"); } - public function get_range_slices(\cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, \cassandra\KeyRange $range, $consistency_level) + public function get_range_slices(ColumnParent $column_parent, SlicePredicate $predicate, KeyRange $range, $consistency_level) { $this->send_get_range_slices($column_parent, $predicate, $range, $consistency_level); return $this->recv_get_range_slices(); } - public function send_get_range_slices(\cassandra\ColumnParent $column_parent, \cassandra\SlicePredicate $predicate, \cassandra\KeyRange $range, $consistency_level) + public function send_get_range_slices(ColumnParent $column_parent, SlicePredicate $predicate, KeyRange $range, $consistency_level) { - $args = new \cassandra\Cassandra_get_range_slices_args(); + $args = new Cassandra_get_range_slices_args(); $args->column_parent = $column_parent; $args->predicate = $predicate; $args->range = $range; @@ -1003,7 +1003,7 @@ public function recv_get_range_slices() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_get_range_slices_result(); + $result = new Cassandra_get_range_slices_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1022,15 +1022,15 @@ public function recv_get_range_slices() throw new \Exception("get_range_slices failed: unknown result"); } - public function get_paged_slice($column_family, \cassandra\KeyRange $range, $start_column, $consistency_level) + public function get_paged_slice($column_family, KeyRange $range, $start_column, $consistency_level) { $this->send_get_paged_slice($column_family, $range, $start_column, $consistency_level); return $this->recv_get_paged_slice(); } - public function send_get_paged_slice($column_family, \cassandra\KeyRange $range, $start_column, $consistency_level) + public function send_get_paged_slice($column_family, KeyRange $range, $start_column, $consistency_level) { - $args = new \cassandra\Cassandra_get_paged_slice_args(); + $args = new Cassandra_get_paged_slice_args(); $args->column_family = $column_family; $args->range = $range; $args->start_column = $start_column; @@ -1066,7 +1066,7 @@ public function recv_get_paged_slice() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_get_paged_slice_result(); + $result = new Cassandra_get_paged_slice_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1085,15 +1085,15 @@ public function recv_get_paged_slice() throw new \Exception("get_paged_slice failed: unknown result"); } - public function get_indexed_slices(\cassandra\ColumnParent $column_parent, \cassandra\IndexClause $index_clause, \cassandra\SlicePredicate $column_predicate, $consistency_level) + public function get_indexed_slices(ColumnParent $column_parent, IndexClause $index_clause, SlicePredicate $column_predicate, $consistency_level) { $this->send_get_indexed_slices($column_parent, $index_clause, $column_predicate, $consistency_level); return $this->recv_get_indexed_slices(); } - public function send_get_indexed_slices(\cassandra\ColumnParent $column_parent, \cassandra\IndexClause $index_clause, \cassandra\SlicePredicate $column_predicate, $consistency_level) + public function send_get_indexed_slices(ColumnParent $column_parent, IndexClause $index_clause, SlicePredicate $column_predicate, $consistency_level) { - $args = new \cassandra\Cassandra_get_indexed_slices_args(); + $args = new Cassandra_get_indexed_slices_args(); $args->column_parent = $column_parent; $args->index_clause = $index_clause; $args->column_predicate = $column_predicate; @@ -1129,7 +1129,7 @@ public function recv_get_indexed_slices() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_get_indexed_slices_result(); + $result = new Cassandra_get_indexed_slices_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1148,15 +1148,15 @@ public function recv_get_indexed_slices() throw new \Exception("get_indexed_slices failed: unknown result"); } - public function insert($key, \cassandra\ColumnParent $column_parent, \cassandra\Column $column, $consistency_level) + public function insert($key, ColumnParent $column_parent, Column $column, $consistency_level) { $this->send_insert($key, $column_parent, $column, $consistency_level); $this->recv_insert(); } - public function send_insert($key, \cassandra\ColumnParent $column_parent, \cassandra\Column $column, $consistency_level) + public function send_insert($key, ColumnParent $column_parent, Column $column, $consistency_level) { - $args = new \cassandra\Cassandra_insert_args(); + $args = new Cassandra_insert_args(); $args->key = $key; $args->column_parent = $column_parent; $args->column = $column; @@ -1192,7 +1192,7 @@ public function recv_insert() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_insert_result(); + $result = new Cassandra_insert_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1208,15 +1208,15 @@ public function recv_insert() return; } - public function add($key, \cassandra\ColumnParent $column_parent, \cassandra\CounterColumn $column, $consistency_level) + public function add($key, ColumnParent $column_parent, CounterColumn $column, $consistency_level) { $this->send_add($key, $column_parent, $column, $consistency_level); $this->recv_add(); } - public function send_add($key, \cassandra\ColumnParent $column_parent, \cassandra\CounterColumn $column, $consistency_level) + public function send_add($key, ColumnParent $column_parent, CounterColumn $column, $consistency_level) { - $args = new \cassandra\Cassandra_add_args(); + $args = new Cassandra_add_args(); $args->key = $key; $args->column_parent = $column_parent; $args->column = $column; @@ -1252,7 +1252,7 @@ public function recv_add() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_add_result(); + $result = new Cassandra_add_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1276,7 +1276,7 @@ public function cas($key, $column_family, array $expected, array $updates, $seri public function send_cas($key, $column_family, array $expected, array $updates, $serial_consistency_level, $commit_consistency_level) { - $args = new \cassandra\Cassandra_cas_args(); + $args = new Cassandra_cas_args(); $args->key = $key; $args->column_family = $column_family; $args->expected = $expected; @@ -1314,7 +1314,7 @@ public function recv_cas() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_cas_result(); + $result = new Cassandra_cas_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1333,15 +1333,15 @@ public function recv_cas() throw new \Exception("cas failed: unknown result"); } - public function remove($key, \cassandra\ColumnPath $column_path, $timestamp, $consistency_level) + public function remove($key, ColumnPath $column_path, $timestamp, $consistency_level) { $this->send_remove($key, $column_path, $timestamp, $consistency_level); $this->recv_remove(); } - public function send_remove($key, \cassandra\ColumnPath $column_path, $timestamp, $consistency_level) + public function send_remove($key, ColumnPath $column_path, $timestamp, $consistency_level) { - $args = new \cassandra\Cassandra_remove_args(); + $args = new Cassandra_remove_args(); $args->key = $key; $args->column_path = $column_path; $args->timestamp = $timestamp; @@ -1377,7 +1377,7 @@ public function recv_remove() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_remove_result(); + $result = new Cassandra_remove_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1393,15 +1393,15 @@ public function recv_remove() return; } - public function remove_counter($key, \cassandra\ColumnPath $path, $consistency_level) + public function remove_counter($key, ColumnPath $path, $consistency_level) { $this->send_remove_counter($key, $path, $consistency_level); $this->recv_remove_counter(); } - public function send_remove_counter($key, \cassandra\ColumnPath $path, $consistency_level) + public function send_remove_counter($key, ColumnPath $path, $consistency_level) { - $args = new \cassandra\Cassandra_remove_counter_args(); + $args = new Cassandra_remove_counter_args(); $args->key = $key; $args->path = $path; $args->consistency_level = $consistency_level; @@ -1436,7 +1436,7 @@ public function recv_remove_counter() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_remove_counter_result(); + $result = new Cassandra_remove_counter_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1460,7 +1460,7 @@ public function batch_mutate(array $mutation_map, $consistency_level) public function send_batch_mutate(array $mutation_map, $consistency_level) { - $args = new \cassandra\Cassandra_batch_mutate_args(); + $args = new Cassandra_batch_mutate_args(); $args->mutation_map = $mutation_map; $args->consistency_level = $consistency_level; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); @@ -1494,7 +1494,7 @@ public function recv_batch_mutate() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_batch_mutate_result(); + $result = new Cassandra_batch_mutate_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1518,7 +1518,7 @@ public function atomic_batch_mutate(array $mutation_map, $consistency_level) public function send_atomic_batch_mutate(array $mutation_map, $consistency_level) { - $args = new \cassandra\Cassandra_atomic_batch_mutate_args(); + $args = new Cassandra_atomic_batch_mutate_args(); $args->mutation_map = $mutation_map; $args->consistency_level = $consistency_level; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); @@ -1552,7 +1552,7 @@ public function recv_atomic_batch_mutate() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_atomic_batch_mutate_result(); + $result = new Cassandra_atomic_batch_mutate_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1576,7 +1576,7 @@ public function truncate($cfname) public function send_truncate($cfname) { - $args = new \cassandra\Cassandra_truncate_args(); + $args = new Cassandra_truncate_args(); $args->cfname = $cfname; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -1609,7 +1609,7 @@ public function recv_truncate() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_truncate_result(); + $result = new Cassandra_truncate_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1625,15 +1625,15 @@ public function recv_truncate() return; } - public function get_multi_slice(\cassandra\MultiSliceRequest $request) + public function get_multi_slice(MultiSliceRequest $request) { $this->send_get_multi_slice($request); return $this->recv_get_multi_slice(); } - public function send_get_multi_slice(\cassandra\MultiSliceRequest $request) + public function send_get_multi_slice(MultiSliceRequest $request) { - $args = new \cassandra\Cassandra_get_multi_slice_args(); + $args = new Cassandra_get_multi_slice_args(); $args->request = $request; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -1666,7 +1666,7 @@ public function recv_get_multi_slice() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_get_multi_slice_result(); + $result = new Cassandra_get_multi_slice_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1693,7 +1693,7 @@ public function describe_schema_versions() public function send_describe_schema_versions() { - $args = new \cassandra\Cassandra_describe_schema_versions_args(); + $args = new Cassandra_describe_schema_versions_args(); $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -1725,7 +1725,7 @@ public function recv_describe_schema_versions() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_schema_versions_result(); + $result = new Cassandra_describe_schema_versions_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1746,7 +1746,7 @@ public function describe_keyspaces() public function send_describe_keyspaces() { - $args = new \cassandra\Cassandra_describe_keyspaces_args(); + $args = new Cassandra_describe_keyspaces_args(); $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -1778,7 +1778,7 @@ public function recv_describe_keyspaces() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_keyspaces_result(); + $result = new Cassandra_describe_keyspaces_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1799,7 +1799,7 @@ public function describe_cluster_name() public function send_describe_cluster_name() { - $args = new \cassandra\Cassandra_describe_cluster_name_args(); + $args = new Cassandra_describe_cluster_name_args(); $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -1831,7 +1831,7 @@ public function recv_describe_cluster_name() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_cluster_name_result(); + $result = new Cassandra_describe_cluster_name_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1849,7 +1849,7 @@ public function describe_version() public function send_describe_version() { - $args = new \cassandra\Cassandra_describe_version_args(); + $args = new Cassandra_describe_version_args(); $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -1881,7 +1881,7 @@ public function recv_describe_version() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_version_result(); + $result = new Cassandra_describe_version_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1899,7 +1899,7 @@ public function describe_ring($keyspace) public function send_describe_ring($keyspace) { - $args = new \cassandra\Cassandra_describe_ring_args(); + $args = new Cassandra_describe_ring_args(); $args->keyspace = $keyspace; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -1932,7 +1932,7 @@ public function recv_describe_ring() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_ring_result(); + $result = new Cassandra_describe_ring_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -1953,7 +1953,7 @@ public function describe_local_ring($keyspace) public function send_describe_local_ring($keyspace) { - $args = new \cassandra\Cassandra_describe_local_ring_args(); + $args = new Cassandra_describe_local_ring_args(); $args->keyspace = $keyspace; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -1986,7 +1986,7 @@ public function recv_describe_local_ring() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_local_ring_result(); + $result = new Cassandra_describe_local_ring_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2007,7 +2007,7 @@ public function describe_token_map() public function send_describe_token_map() { - $args = new \cassandra\Cassandra_describe_token_map_args(); + $args = new Cassandra_describe_token_map_args(); $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -2039,7 +2039,7 @@ public function recv_describe_token_map() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_token_map_result(); + $result = new Cassandra_describe_token_map_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2060,7 +2060,7 @@ public function describe_partitioner() public function send_describe_partitioner() { - $args = new \cassandra\Cassandra_describe_partitioner_args(); + $args = new Cassandra_describe_partitioner_args(); $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -2092,7 +2092,7 @@ public function recv_describe_partitioner() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_partitioner_result(); + $result = new Cassandra_describe_partitioner_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2110,7 +2110,7 @@ public function describe_snitch() public function send_describe_snitch() { - $args = new \cassandra\Cassandra_describe_snitch_args(); + $args = new Cassandra_describe_snitch_args(); $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -2142,7 +2142,7 @@ public function recv_describe_snitch() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_snitch_result(); + $result = new Cassandra_describe_snitch_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2160,7 +2160,7 @@ public function describe_keyspace($keyspace) public function send_describe_keyspace($keyspace) { - $args = new \cassandra\Cassandra_describe_keyspace_args(); + $args = new Cassandra_describe_keyspace_args(); $args->keyspace = $keyspace; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -2193,7 +2193,7 @@ public function recv_describe_keyspace() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_keyspace_result(); + $result = new Cassandra_describe_keyspace_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2217,7 +2217,7 @@ public function describe_splits($cfName, $start_token, $end_token, $keys_per_spl public function send_describe_splits($cfName, $start_token, $end_token, $keys_per_split) { - $args = new \cassandra\Cassandra_describe_splits_args(); + $args = new Cassandra_describe_splits_args(); $args->cfName = $cfName; $args->start_token = $start_token; $args->end_token = $end_token; @@ -2253,7 +2253,7 @@ public function recv_describe_splits() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_splits_result(); + $result = new Cassandra_describe_splits_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2274,7 +2274,7 @@ public function trace_next_query() public function send_trace_next_query() { - $args = new \cassandra\Cassandra_trace_next_query_args(); + $args = new Cassandra_trace_next_query_args(); $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -2306,7 +2306,7 @@ public function recv_trace_next_query() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_trace_next_query_result(); + $result = new Cassandra_trace_next_query_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2324,7 +2324,7 @@ public function describe_splits_ex($cfName, $start_token, $end_token, $keys_per_ public function send_describe_splits_ex($cfName, $start_token, $end_token, $keys_per_split) { - $args = new \cassandra\Cassandra_describe_splits_ex_args(); + $args = new Cassandra_describe_splits_ex_args(); $args->cfName = $cfName; $args->start_token = $start_token; $args->end_token = $end_token; @@ -2360,7 +2360,7 @@ public function recv_describe_splits_ex() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_describe_splits_ex_result(); + $result = new Cassandra_describe_splits_ex_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2373,15 +2373,15 @@ public function recv_describe_splits_ex() throw new \Exception("describe_splits_ex failed: unknown result"); } - public function system_add_column_family(\cassandra\CfDef $cf_def) + public function system_add_column_family(CfDef $cf_def) { $this->send_system_add_column_family($cf_def); return $this->recv_system_add_column_family(); } - public function send_system_add_column_family(\cassandra\CfDef $cf_def) + public function send_system_add_column_family(CfDef $cf_def) { - $args = new \cassandra\Cassandra_system_add_column_family_args(); + $args = new Cassandra_system_add_column_family_args(); $args->cf_def = $cf_def; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -2414,7 +2414,7 @@ public function recv_system_add_column_family() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_system_add_column_family_result(); + $result = new Cassandra_system_add_column_family_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2438,7 +2438,7 @@ public function system_drop_column_family($column_family) public function send_system_drop_column_family($column_family) { - $args = new \cassandra\Cassandra_system_drop_column_family_args(); + $args = new Cassandra_system_drop_column_family_args(); $args->column_family = $column_family; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -2471,7 +2471,7 @@ public function recv_system_drop_column_family() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_system_drop_column_family_result(); + $result = new Cassandra_system_drop_column_family_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2487,15 +2487,15 @@ public function recv_system_drop_column_family() throw new \Exception("system_drop_column_family failed: unknown result"); } - public function system_add_keyspace(\cassandra\KsDef $ks_def) + public function system_add_keyspace(KsDef $ks_def) { $this->send_system_add_keyspace($ks_def); return $this->recv_system_add_keyspace(); } - public function send_system_add_keyspace(\cassandra\KsDef $ks_def) + public function send_system_add_keyspace(KsDef $ks_def) { - $args = new \cassandra\Cassandra_system_add_keyspace_args(); + $args = new Cassandra_system_add_keyspace_args(); $args->ks_def = $ks_def; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -2528,7 +2528,7 @@ public function recv_system_add_keyspace() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_system_add_keyspace_result(); + $result = new Cassandra_system_add_keyspace_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2552,7 +2552,7 @@ public function system_drop_keyspace($keyspace) public function send_system_drop_keyspace($keyspace) { - $args = new \cassandra\Cassandra_system_drop_keyspace_args(); + $args = new Cassandra_system_drop_keyspace_args(); $args->keyspace = $keyspace; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -2585,7 +2585,7 @@ public function recv_system_drop_keyspace() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_system_drop_keyspace_result(); + $result = new Cassandra_system_drop_keyspace_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2601,15 +2601,15 @@ public function recv_system_drop_keyspace() throw new \Exception("system_drop_keyspace failed: unknown result"); } - public function system_update_keyspace(\cassandra\KsDef $ks_def) + public function system_update_keyspace(KsDef $ks_def) { $this->send_system_update_keyspace($ks_def); return $this->recv_system_update_keyspace(); } - public function send_system_update_keyspace(\cassandra\KsDef $ks_def) + public function send_system_update_keyspace(KsDef $ks_def) { - $args = new \cassandra\Cassandra_system_update_keyspace_args(); + $args = new Cassandra_system_update_keyspace_args(); $args->ks_def = $ks_def; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -2642,7 +2642,7 @@ public function recv_system_update_keyspace() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_system_update_keyspace_result(); + $result = new Cassandra_system_update_keyspace_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2658,15 +2658,15 @@ public function recv_system_update_keyspace() throw new \Exception("system_update_keyspace failed: unknown result"); } - public function system_update_column_family(\cassandra\CfDef $cf_def) + public function system_update_column_family(CfDef $cf_def) { $this->send_system_update_column_family($cf_def); return $this->recv_system_update_column_family(); } - public function send_system_update_column_family(\cassandra\CfDef $cf_def) + public function send_system_update_column_family(CfDef $cf_def) { - $args = new \cassandra\Cassandra_system_update_column_family_args(); + $args = new Cassandra_system_update_column_family_args(); $args->cf_def = $cf_def; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -2699,7 +2699,7 @@ public function recv_system_update_column_family() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_system_update_column_family_result(); + $result = new Cassandra_system_update_column_family_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2723,7 +2723,7 @@ public function execute_cql_query($query, $compression) public function send_execute_cql_query($query, $compression) { - $args = new \cassandra\Cassandra_execute_cql_query_args(); + $args = new Cassandra_execute_cql_query_args(); $args->query = $query; $args->compression = $compression; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); @@ -2757,7 +2757,7 @@ public function recv_execute_cql_query() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_execute_cql_query_result(); + $result = new Cassandra_execute_cql_query_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2787,7 +2787,7 @@ public function execute_cql3_query($query, $compression, $consistency) public function send_execute_cql3_query($query, $compression, $consistency) { - $args = new \cassandra\Cassandra_execute_cql3_query_args(); + $args = new Cassandra_execute_cql3_query_args(); $args->query = $query; $args->compression = $compression; $args->consistency = $consistency; @@ -2822,7 +2822,7 @@ public function recv_execute_cql3_query() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_execute_cql3_query_result(); + $result = new Cassandra_execute_cql3_query_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2852,7 +2852,7 @@ public function prepare_cql_query($query, $compression) public function send_prepare_cql_query($query, $compression) { - $args = new \cassandra\Cassandra_prepare_cql_query_args(); + $args = new Cassandra_prepare_cql_query_args(); $args->query = $query; $args->compression = $compression; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); @@ -2886,7 +2886,7 @@ public function recv_prepare_cql_query() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_prepare_cql_query_result(); + $result = new Cassandra_prepare_cql_query_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2907,7 +2907,7 @@ public function prepare_cql3_query($query, $compression) public function send_prepare_cql3_query($query, $compression) { - $args = new \cassandra\Cassandra_prepare_cql3_query_args(); + $args = new Cassandra_prepare_cql3_query_args(); $args->query = $query; $args->compression = $compression; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); @@ -2941,7 +2941,7 @@ public function recv_prepare_cql3_query() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_prepare_cql3_query_result(); + $result = new Cassandra_prepare_cql3_query_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -2962,7 +2962,7 @@ public function execute_prepared_cql_query($itemId, array $values) public function send_execute_prepared_cql_query($itemId, array $values) { - $args = new \cassandra\Cassandra_execute_prepared_cql_query_args(); + $args = new Cassandra_execute_prepared_cql_query_args(); $args->itemId = $itemId; $args->values = $values; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); @@ -2996,7 +2996,7 @@ public function recv_execute_prepared_cql_query() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_execute_prepared_cql_query_result(); + $result = new Cassandra_execute_prepared_cql_query_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -3026,7 +3026,7 @@ public function execute_prepared_cql3_query($itemId, array $values, $consistency public function send_execute_prepared_cql3_query($itemId, array $values, $consistency) { - $args = new \cassandra\Cassandra_execute_prepared_cql3_query_args(); + $args = new Cassandra_execute_prepared_cql3_query_args(); $args->itemId = $itemId; $args->values = $values; $args->consistency = $consistency; @@ -3061,7 +3061,7 @@ public function recv_execute_prepared_cql3_query() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_execute_prepared_cql3_query_result(); + $result = new Cassandra_execute_prepared_cql3_query_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -3091,7 +3091,7 @@ public function set_cql_version($version) public function send_set_cql_version($version) { - $args = new \cassandra\Cassandra_set_cql_version_args(); + $args = new Cassandra_set_cql_version_args(); $args->version = $version; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) @@ -3124,7 +3124,7 @@ public function recv_set_cql_version() $this->input_->readMessageEnd(); throw $x; } - $result = new \cassandra\Cassandra_set_cql_version_result(); + $result = new Cassandra_set_cql_version_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } @@ -3138,11 +3138,11 @@ public function recv_set_cql_version() // HELPER FUNCTIONS AND STRUCTURES -class Cassandra_login_args { +class Cassandra_login_args extends TBase { static $_TSPEC; /** - * @var \cassandra\AuthenticationRequest + * @var AuthenticationRequest */ public $auth_request = null; @@ -3157,9 +3157,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['auth_request'])) { - $this->auth_request = $vals['auth_request']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3169,64 +3167,39 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->auth_request = new \cassandra\AuthenticationRequest(); - $xfer += $this->auth_request->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_login_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_login_args'); - if ($this->auth_request !== null) { - if (!is_object($this->auth_request)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('auth_request', TType::STRUCT, 1); - $xfer += $this->auth_request->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_login_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->auth_request === null) { + throw new TProtocolException('Required field Cassandra_login_args.auth_request is unset!'); + } + } + + private function _validateForWrite() { + if ($this->auth_request === null) { + throw new TProtocolException('Required field Cassandra_login_args.auth_request is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_login_result { +class Cassandra_login_result extends TBase { static $_TSPEC; /** - * @var \cassandra\AuthenticationException + * @var AuthenticationException */ public $authnx = null; /** - * @var \cassandra\AuthorizationException + * @var AuthorizationException */ public $authzx = null; @@ -3246,12 +3219,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['authnx'])) { - $this->authnx = $vals['authnx']; - } - if (isset($vals['authzx'])) { - $this->authzx = $vals['authzx']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3261,66 +3229,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->authnx = new \cassandra\AuthenticationException(); - $xfer += $this->authnx->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->authzx = new \cassandra\AuthorizationException(); - $xfer += $this->authzx->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_login_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_login_result'); - if ($this->authnx !== null) { - $xfer += $output->writeFieldBegin('authnx', TType::STRUCT, 1); - $xfer += $this->authnx->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->authzx !== null) { - $xfer += $output->writeFieldBegin('authzx', TType::STRUCT, 2); - $xfer += $this->authzx->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_login_result', self::$_TSPEC, $output); } } -class Cassandra_set_keyspace_args { +class Cassandra_set_keyspace_args extends TBase { static $_TSPEC; /** @@ -3338,9 +3256,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['keyspace'])) { - $this->keyspace = $vals['keyspace']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3350,56 +3266,35 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->keyspace); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_set_keyspace_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_set_keyspace_args'); - if ($this->keyspace !== null) { - $xfer += $output->writeFieldBegin('keyspace', TType::STRING, 1); - $xfer += $output->writeString($this->keyspace); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_set_keyspace_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field Cassandra_set_keyspace_args.keyspace is unset!'); + } + } + + private function _validateForWrite() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field Cassandra_set_keyspace_args.keyspace is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_set_keyspace_result { +class Cassandra_set_keyspace_result extends TBase { static $_TSPEC; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -3414,9 +3309,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3426,53 +3319,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_set_keyspace_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_set_keyspace_result'); - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_set_keyspace_result', self::$_TSPEC, $output); } } -class Cassandra_get_args { +class Cassandra_get_args extends TBase { static $_TSPEC; /** @@ -3480,7 +3336,7 @@ class Cassandra_get_args { */ public $key = null; /** - * @var \cassandra\ColumnPath + * @var ColumnPath */ public $column_path = null; /** @@ -3507,15 +3363,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['column_path'])) { - $this->column_path = $vals['column_path']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3525,100 +3373,63 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->column_path = new \cassandra\ColumnPath(); - $xfer += $this->column_path->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_get_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_args'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_path !== null) { - if (!is_object($this->column_path)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_path', TType::STRUCT, 2); - $xfer += $this->column_path->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_get_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_get_args.key is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 3); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->column_path === null) { + throw new TProtocolException('Required field Cassandra_get_args.column_path is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_get_args.key is unset!'); + } + if ($this->column_path === null) { + throw new TProtocolException('Required field Cassandra_get_args.column_path is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_get_result { +class Cassandra_get_result extends TBase { static $_TSPEC; /** - * @var \cassandra\ColumnOrSuperColumn + * @var ColumnOrSuperColumn */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\NotFoundException + * @var NotFoundException */ public $nfe = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -3653,21 +3464,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['nfe'])) { - $this->nfe = $vals['nfe']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3677,108 +3474,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRUCT) { - $this->success = new \cassandra\ColumnOrSuperColumn(); - $xfer += $this->success->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->nfe = new \cassandra\NotFoundException(); - $xfer += $this->nfe->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_get_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_result'); - if ($this->success !== null) { - if (!is_object($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); - $xfer += $this->success->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->nfe !== null) { - $xfer += $output->writeFieldBegin('nfe', TType::STRUCT, 2); - $xfer += $this->nfe->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 3); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 4); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_get_result', self::$_TSPEC, $output); } } -class Cassandra_get_slice_args { +class Cassandra_get_slice_args extends TBase { static $_TSPEC; /** @@ -3786,11 +3491,11 @@ class Cassandra_get_slice_args { */ public $key = null; /** - * @var \cassandra\ColumnParent + * @var ColumnParent */ public $column_parent = null; /** - * @var \cassandra\SlicePredicate + * @var SlicePredicate */ public $predicate = null; /** @@ -3822,18 +3527,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['column_parent'])) { - $this->column_parent = $vals['column_parent']; - } - if (isset($vals['predicate'])) { - $this->predicate = $vals['predicate']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3843,112 +3537,65 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->column_parent = new \cassandra\ColumnParent(); - $xfer += $this->column_parent->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->predicate = new \cassandra\SlicePredicate(); - $xfer += $this->predicate->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_get_slice_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_slice_args'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_parent !== null) { - if (!is_object($this->column_parent)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_parent', TType::STRUCT, 2); - $xfer += $this->column_parent->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_get_slice_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_get_slice_args.key is unset!'); } - if ($this->predicate !== null) { - if (!is_object($this->predicate)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('predicate', TType::STRUCT, 3); - $xfer += $this->predicate->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_get_slice_args.column_parent is unset!'); + } + if ($this->predicate === null) { + throw new TProtocolException('Required field Cassandra_get_slice_args.predicate is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_slice_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_get_slice_args.key is unset!'); + } + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_get_slice_args.column_parent is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 4); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->predicate === null) { + throw new TProtocolException('Required field Cassandra_get_slice_args.predicate is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_slice_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_get_slice_result { +class Cassandra_get_slice_result extends TBase { static $_TSPEC; /** - * @var \cassandra\ColumnOrSuperColumn[] + * @var ColumnOrSuperColumn[] */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -3982,18 +3629,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -4003,114 +3639,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::LST) { - $this->success = array(); - $_size198 = 0; - $_etype201 = 0; - $xfer += $input->readListBegin($_etype201, $_size198); - for ($_i202 = 0; $_i202 < $_size198; ++$_i202) - { - $elem203 = null; - $elem203 = new \cassandra\ColumnOrSuperColumn(); - $xfer += $elem203->read($input); - $this->success []= $elem203; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_get_slice_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_slice_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::LST, 0); - { - $output->writeListBegin(TType::STRUCT, count($this->success)); - { - foreach ($this->success as $iter204) - { - $xfer += $iter204->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_get_slice_result', self::$_TSPEC, $output); } } -class Cassandra_get_count_args { +class Cassandra_get_count_args extends TBase { static $_TSPEC; /** @@ -4118,11 +3656,11 @@ class Cassandra_get_count_args { */ public $key = null; /** - * @var \cassandra\ColumnParent + * @var ColumnParent */ public $column_parent = null; /** - * @var \cassandra\SlicePredicate + * @var SlicePredicate */ public $predicate = null; /** @@ -4154,18 +3692,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['column_parent'])) { - $this->column_parent = $vals['column_parent']; - } - if (isset($vals['predicate'])) { - $this->predicate = $vals['predicate']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -4175,96 +3702,49 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->column_parent = new \cassandra\ColumnParent(); - $xfer += $this->column_parent->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->predicate = new \cassandra\SlicePredicate(); - $xfer += $this->predicate->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_get_count_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_count_args'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_parent !== null) { - if (!is_object($this->column_parent)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_parent', TType::STRUCT, 2); - $xfer += $this->column_parent->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_get_count_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_get_count_args.key is unset!'); } - if ($this->predicate !== null) { - if (!is_object($this->predicate)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('predicate', TType::STRUCT, 3); - $xfer += $this->predicate->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_get_count_args.column_parent is unset!'); + } + if ($this->predicate === null) { + throw new TProtocolException('Required field Cassandra_get_count_args.predicate is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_count_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_get_count_args.key is unset!'); + } + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_get_count_args.column_parent is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 4); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->predicate === null) { + throw new TProtocolException('Required field Cassandra_get_count_args.predicate is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_count_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_get_count_result { +class Cassandra_get_count_result extends TBase { static $_TSPEC; /** @@ -4272,15 +3752,15 @@ class Cassandra_get_count_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -4309,18 +3789,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -4330,91 +3799,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_get_count_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_count_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::I32, 0); - $xfer += $output->writeI32($this->success); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_get_count_result', self::$_TSPEC, $output); } } -class Cassandra_multiget_slice_args { +class Cassandra_multiget_slice_args extends TBase { static $_TSPEC; /** @@ -4422,11 +3816,11 @@ class Cassandra_multiget_slice_args { */ public $keys = null; /** - * @var \cassandra\ColumnParent + * @var ColumnParent */ public $column_parent = null; /** - * @var \cassandra\SlicePredicate + * @var SlicePredicate */ public $predicate = null; /** @@ -4462,18 +3856,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['keys'])) { - $this->keys = $vals['keys']; - } - if (isset($vals['column_parent'])) { - $this->column_parent = $vals['column_parent']; - } - if (isset($vals['predicate'])) { - $this->predicate = $vals['predicate']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -4483,118 +3866,49 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::LST) { - $this->keys = array(); - $_size205 = 0; - $_etype208 = 0; - $xfer += $input->readListBegin($_etype208, $_size205); - for ($_i209 = 0; $_i209 < $_size205; ++$_i209) - { - $elem210 = null; - $xfer += $input->readString($elem210); - $this->keys []= $elem210; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->column_parent = new \cassandra\ColumnParent(); - $xfer += $this->column_parent->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->predicate = new \cassandra\SlicePredicate(); - $xfer += $this->predicate->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_multiget_slice_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_multiget_slice_args'); - if ($this->keys !== null) { - if (!is_array($this->keys)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('keys', TType::LST, 1); - { - $output->writeListBegin(TType::STRING, count($this->keys)); - { - foreach ($this->keys as $iter211) - { - $xfer += $output->writeString($iter211); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_multiget_slice_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->keys === null) { + throw new TProtocolException('Required field Cassandra_multiget_slice_args.keys is unset!'); } - if ($this->column_parent !== null) { - if (!is_object($this->column_parent)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_parent', TType::STRUCT, 2); - $xfer += $this->column_parent->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_multiget_slice_args.column_parent is unset!'); } - if ($this->predicate !== null) { - if (!is_object($this->predicate)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('predicate', TType::STRUCT, 3); - $xfer += $this->predicate->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->predicate === null) { + throw new TProtocolException('Required field Cassandra_multiget_slice_args.predicate is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 4); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_multiget_slice_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->keys === null) { + throw new TProtocolException('Required field Cassandra_multiget_slice_args.keys is unset!'); + } + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_multiget_slice_args.column_parent is unset!'); + } + if ($this->predicate === null) { + throw new TProtocolException('Required field Cassandra_multiget_slice_args.predicate is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_multiget_slice_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_multiget_slice_result { +class Cassandra_multiget_slice_result extends TBase { static $_TSPEC; /** @@ -4602,15 +3916,15 @@ class Cassandra_multiget_slice_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -4652,18 +3966,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -4673,137 +3976,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::MAP) { - $this->success = array(); - $_size212 = 0; - $_ktype213 = 0; - $_vtype214 = 0; - $xfer += $input->readMapBegin($_ktype213, $_vtype214, $_size212); - for ($_i216 = 0; $_i216 < $_size212; ++$_i216) - { - $key217 = ''; - $val218 = array(); - $xfer += $input->readString($key217); - $val218 = array(); - $_size219 = 0; - $_etype222 = 0; - $xfer += $input->readListBegin($_etype222, $_size219); - for ($_i223 = 0; $_i223 < $_size219; ++$_i223) - { - $elem224 = null; - $elem224 = new \cassandra\ColumnOrSuperColumn(); - $xfer += $elem224->read($input); - $val218 []= $elem224; - } - $xfer += $input->readListEnd(); - $this->success[$key217] = $val218; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_multiget_slice_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_multiget_slice_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::MAP, 0); - { - $output->writeMapBegin(TType::STRING, TType::LST, count($this->success)); - { - foreach ($this->success as $kiter225 => $viter226) - { - $xfer += $output->writeString($kiter225); - { - $output->writeListBegin(TType::STRUCT, count($viter226)); - { - foreach ($viter226 as $iter227) - { - $xfer += $iter227->write($output); - } - } - $output->writeListEnd(); - } - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_multiget_slice_result', self::$_TSPEC, $output); } } -class Cassandra_multiget_count_args { +class Cassandra_multiget_count_args extends TBase { static $_TSPEC; /** @@ -4811,11 +3993,11 @@ class Cassandra_multiget_count_args { */ public $keys = null; /** - * @var \cassandra\ColumnParent + * @var ColumnParent */ public $column_parent = null; /** - * @var \cassandra\SlicePredicate + * @var SlicePredicate */ public $predicate = null; /** @@ -4851,18 +4033,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['keys'])) { - $this->keys = $vals['keys']; - } - if (isset($vals['column_parent'])) { - $this->column_parent = $vals['column_parent']; - } - if (isset($vals['predicate'])) { - $this->predicate = $vals['predicate']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -4872,118 +4043,49 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::LST) { - $this->keys = array(); - $_size228 = 0; - $_etype231 = 0; - $xfer += $input->readListBegin($_etype231, $_size228); - for ($_i232 = 0; $_i232 < $_size228; ++$_i232) - { - $elem233 = null; - $xfer += $input->readString($elem233); - $this->keys []= $elem233; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->column_parent = new \cassandra\ColumnParent(); - $xfer += $this->column_parent->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->predicate = new \cassandra\SlicePredicate(); - $xfer += $this->predicate->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_multiget_count_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_multiget_count_args'); - if ($this->keys !== null) { - if (!is_array($this->keys)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('keys', TType::LST, 1); - { - $output->writeListBegin(TType::STRING, count($this->keys)); - { - foreach ($this->keys as $iter234) - { - $xfer += $output->writeString($iter234); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_multiget_count_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->keys === null) { + throw new TProtocolException('Required field Cassandra_multiget_count_args.keys is unset!'); } - if ($this->column_parent !== null) { - if (!is_object($this->column_parent)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_parent', TType::STRUCT, 2); - $xfer += $this->column_parent->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_multiget_count_args.column_parent is unset!'); } - if ($this->predicate !== null) { - if (!is_object($this->predicate)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('predicate', TType::STRUCT, 3); - $xfer += $this->predicate->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->predicate === null) { + throw new TProtocolException('Required field Cassandra_multiget_count_args.predicate is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_multiget_count_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->keys === null) { + throw new TProtocolException('Required field Cassandra_multiget_count_args.keys is unset!'); + } + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_multiget_count_args.column_parent is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 4); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->predicate === null) { + throw new TProtocolException('Required field Cassandra_multiget_count_args.predicate is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_multiget_count_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_multiget_count_result { +class Cassandra_multiget_count_result extends TBase { static $_TSPEC; /** @@ -4991,15 +4093,15 @@ class Cassandra_multiget_count_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -5036,18 +4138,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5057,129 +4148,28 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::MAP) { - $this->success = array(); - $_size235 = 0; - $_ktype236 = 0; - $_vtype237 = 0; - $xfer += $input->readMapBegin($_ktype236, $_vtype237, $_size235); - for ($_i239 = 0; $_i239 < $_size235; ++$_i239) - { - $key240 = ''; - $val241 = 0; - $xfer += $input->readString($key240); - $xfer += $input->readI32($val241); - $this->success[$key240] = $val241; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_multiget_count_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_multiget_count_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::MAP, 0); - { - $output->writeMapBegin(TType::STRING, TType::I32, count($this->success)); - { - foreach ($this->success as $kiter242 => $viter243) - { - $xfer += $output->writeString($kiter242); - $xfer += $output->writeI32($viter243); - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_multiget_count_result', self::$_TSPEC, $output); } } -class Cassandra_get_range_slices_args { +class Cassandra_get_range_slices_args extends TBase { static $_TSPEC; /** - * @var \cassandra\ColumnParent + * @var ColumnParent */ public $column_parent = null; /** - * @var \cassandra\SlicePredicate + * @var SlicePredicate */ public $predicate = null; /** - * @var \cassandra\KeyRange + * @var KeyRange */ public $range = null; /** @@ -5212,18 +4202,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['column_parent'])) { - $this->column_parent = $vals['column_parent']; - } - if (isset($vals['predicate'])) { - $this->predicate = $vals['predicate']; - } - if (isset($vals['range'])) { - $this->range = $vals['range']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5233,116 +4212,65 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->column_parent = new \cassandra\ColumnParent(); - $xfer += $this->column_parent->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->predicate = new \cassandra\SlicePredicate(); - $xfer += $this->predicate->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->range = new \cassandra\KeyRange(); - $xfer += $this->range->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_get_range_slices_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_range_slices_args'); - if ($this->column_parent !== null) { - if (!is_object($this->column_parent)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_parent', TType::STRUCT, 1); - $xfer += $this->column_parent->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_get_range_slices_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_get_range_slices_args.column_parent is unset!'); } - if ($this->predicate !== null) { - if (!is_object($this->predicate)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('predicate', TType::STRUCT, 2); - $xfer += $this->predicate->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->predicate === null) { + throw new TProtocolException('Required field Cassandra_get_range_slices_args.predicate is unset!'); } - if ($this->range !== null) { - if (!is_object($this->range)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('range', TType::STRUCT, 3); - $xfer += $this->range->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->range === null) { + throw new TProtocolException('Required field Cassandra_get_range_slices_args.range is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 4); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_range_slices_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_get_range_slices_args.column_parent is unset!'); + } + if ($this->predicate === null) { + throw new TProtocolException('Required field Cassandra_get_range_slices_args.predicate is unset!'); + } + if ($this->range === null) { + throw new TProtocolException('Required field Cassandra_get_range_slices_args.range is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_range_slices_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_get_range_slices_result { +class Cassandra_get_range_slices_result extends TBase { static $_TSPEC; /** - * @var \cassandra\KeySlice[] + * @var KeySlice[] */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -5376,18 +4304,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5397,114 +4314,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::LST) { - $this->success = array(); - $_size244 = 0; - $_etype247 = 0; - $xfer += $input->readListBegin($_etype247, $_size244); - for ($_i248 = 0; $_i248 < $_size244; ++$_i248) - { - $elem249 = null; - $elem249 = new \cassandra\KeySlice(); - $xfer += $elem249->read($input); - $this->success []= $elem249; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_get_range_slices_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_range_slices_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::LST, 0); - { - $output->writeListBegin(TType::STRUCT, count($this->success)); - { - foreach ($this->success as $iter250) - { - $xfer += $iter250->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_get_range_slices_result', self::$_TSPEC, $output); } } -class Cassandra_get_paged_slice_args { +class Cassandra_get_paged_slice_args extends TBase { static $_TSPEC; /** @@ -5512,7 +4331,7 @@ class Cassandra_get_paged_slice_args { */ public $column_family = null; /** - * @var \cassandra\KeyRange + * @var KeyRange */ public $range = null; /** @@ -5547,18 +4366,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['column_family'])) { - $this->column_family = $vals['column_family']; - } - if (isset($vals['range'])) { - $this->range = $vals['range']; - } - if (isset($vals['start_column'])) { - $this->start_column = $vals['start_column']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5568,108 +4376,65 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->column_family); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->range = new \cassandra\KeyRange(); - $xfer += $this->range->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->start_column); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_get_paged_slice_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_paged_slice_args'); - if ($this->column_family !== null) { - $xfer += $output->writeFieldBegin('column_family', TType::STRING, 1); - $xfer += $output->writeString($this->column_family); - $xfer += $output->writeFieldEnd(); - } - if ($this->range !== null) { - if (!is_object($this->range)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('range', TType::STRUCT, 2); - $xfer += $this->range->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_get_paged_slice_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->column_family === null) { + throw new TProtocolException('Required field Cassandra_get_paged_slice_args.column_family is unset!'); + } + if ($this->range === null) { + throw new TProtocolException('Required field Cassandra_get_paged_slice_args.range is unset!'); } - if ($this->start_column !== null) { - $xfer += $output->writeFieldBegin('start_column', TType::STRING, 3); - $xfer += $output->writeString($this->start_column); - $xfer += $output->writeFieldEnd(); + if ($this->start_column === null) { + throw new TProtocolException('Required field Cassandra_get_paged_slice_args.start_column is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 4); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_paged_slice_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->column_family === null) { + throw new TProtocolException('Required field Cassandra_get_paged_slice_args.column_family is unset!'); + } + if ($this->range === null) { + throw new TProtocolException('Required field Cassandra_get_paged_slice_args.range is unset!'); + } + if ($this->start_column === null) { + throw new TProtocolException('Required field Cassandra_get_paged_slice_args.start_column is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_paged_slice_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_get_paged_slice_result { +class Cassandra_get_paged_slice_result extends TBase { static $_TSPEC; /** - * @var \cassandra\KeySlice[] + * @var KeySlice[] */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -5703,18 +4468,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5724,126 +4478,28 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::LST) { - $this->success = array(); - $_size251 = 0; - $_etype254 = 0; - $xfer += $input->readListBegin($_etype254, $_size251); - for ($_i255 = 0; $_i255 < $_size251; ++$_i255) - { - $elem256 = null; - $elem256 = new \cassandra\KeySlice(); - $xfer += $elem256->read($input); - $this->success []= $elem256; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_get_paged_slice_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_paged_slice_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::LST, 0); - { - $output->writeListBegin(TType::STRUCT, count($this->success)); - { - foreach ($this->success as $iter257) - { - $xfer += $iter257->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_get_paged_slice_result', self::$_TSPEC, $output); } } -class Cassandra_get_indexed_slices_args { +class Cassandra_get_indexed_slices_args extends TBase { static $_TSPEC; /** - * @var \cassandra\ColumnParent + * @var ColumnParent */ public $column_parent = null; /** - * @var \cassandra\IndexClause + * @var IndexClause */ public $index_clause = null; /** - * @var \cassandra\SlicePredicate + * @var SlicePredicate */ public $column_predicate = null; /** @@ -5876,18 +4532,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['column_parent'])) { - $this->column_parent = $vals['column_parent']; - } - if (isset($vals['index_clause'])) { - $this->index_clause = $vals['index_clause']; - } - if (isset($vals['column_predicate'])) { - $this->column_predicate = $vals['column_predicate']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5897,116 +4542,65 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->column_parent = new \cassandra\ColumnParent(); - $xfer += $this->column_parent->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->index_clause = new \cassandra\IndexClause(); - $xfer += $this->index_clause->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->column_predicate = new \cassandra\SlicePredicate(); - $xfer += $this->column_predicate->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_get_indexed_slices_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_indexed_slices_args'); - if ($this->column_parent !== null) { - if (!is_object($this->column_parent)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_parent', TType::STRUCT, 1); - $xfer += $this->column_parent->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_get_indexed_slices_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_get_indexed_slices_args.column_parent is unset!'); } - if ($this->index_clause !== null) { - if (!is_object($this->index_clause)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('index_clause', TType::STRUCT, 2); - $xfer += $this->index_clause->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->index_clause === null) { + throw new TProtocolException('Required field Cassandra_get_indexed_slices_args.index_clause is unset!'); } - if ($this->column_predicate !== null) { - if (!is_object($this->column_predicate)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_predicate', TType::STRUCT, 3); - $xfer += $this->column_predicate->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->column_predicate === null) { + throw new TProtocolException('Required field Cassandra_get_indexed_slices_args.column_predicate is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 4); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_indexed_slices_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_get_indexed_slices_args.column_parent is unset!'); + } + if ($this->index_clause === null) { + throw new TProtocolException('Required field Cassandra_get_indexed_slices_args.index_clause is unset!'); + } + if ($this->column_predicate === null) { + throw new TProtocolException('Required field Cassandra_get_indexed_slices_args.column_predicate is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_get_indexed_slices_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_get_indexed_slices_result { +class Cassandra_get_indexed_slices_result extends TBase { static $_TSPEC; /** - * @var \cassandra\KeySlice[] + * @var KeySlice[] */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -6039,19 +4633,8 @@ public function __construct($vals=null) { ), ); } - if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + if (is_array($vals)) { + parent::__construct(self::$_TSPEC, $vals); } } @@ -6061,114 +4644,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::LST) { - $this->success = array(); - $_size258 = 0; - $_etype261 = 0; - $xfer += $input->readListBegin($_etype261, $_size258); - for ($_i262 = 0; $_i262 < $_size258; ++$_i262) - { - $elem263 = null; - $elem263 = new \cassandra\KeySlice(); - $xfer += $elem263->read($input); - $this->success []= $elem263; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_get_indexed_slices_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_indexed_slices_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::LST, 0); - { - $output->writeListBegin(TType::STRUCT, count($this->success)); - { - foreach ($this->success as $iter264) - { - $xfer += $iter264->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_get_indexed_slices_result', self::$_TSPEC, $output); } } -class Cassandra_insert_args { +class Cassandra_insert_args extends TBase { static $_TSPEC; /** @@ -6176,11 +4661,11 @@ class Cassandra_insert_args { */ public $key = null; /** - * @var \cassandra\ColumnParent + * @var ColumnParent */ public $column_parent = null; /** - * @var \cassandra\Column + * @var Column */ public $column = null; /** @@ -6212,18 +4697,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['column_parent'])) { - $this->column_parent = $vals['column_parent']; - } - if (isset($vals['column'])) { - $this->column = $vals['column']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -6233,108 +4707,61 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->column_parent = new \cassandra\ColumnParent(); - $xfer += $this->column_parent->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->column = new \cassandra\Column(); - $xfer += $this->column->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_insert_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_insert_args'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_parent !== null) { - if (!is_object($this->column_parent)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_parent', TType::STRUCT, 2); - $xfer += $this->column_parent->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_insert_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_insert_args.key is unset!'); } - if ($this->column !== null) { - if (!is_object($this->column)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column', TType::STRUCT, 3); - $xfer += $this->column->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_insert_args.column_parent is unset!'); + } + if ($this->column === null) { + throw new TProtocolException('Required field Cassandra_insert_args.column is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 4); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_insert_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_insert_args.key is unset!'); + } + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_insert_args.column_parent is unset!'); + } + if ($this->column === null) { + throw new TProtocolException('Required field Cassandra_insert_args.column is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_insert_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_insert_result { +class Cassandra_insert_result extends TBase { static $_TSPEC; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -6359,15 +4786,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -6377,79 +4796,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_insert_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_insert_result'); - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_insert_result', self::$_TSPEC, $output); } } -class Cassandra_add_args { +class Cassandra_add_args extends TBase { static $_TSPEC; /** @@ -6457,11 +4813,11 @@ class Cassandra_add_args { */ public $key = null; /** - * @var \cassandra\ColumnParent + * @var ColumnParent */ public $column_parent = null; /** - * @var \cassandra\CounterColumn + * @var CounterColumn */ public $column = null; /** @@ -6493,18 +4849,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['column_parent'])) { - $this->column_parent = $vals['column_parent']; - } - if (isset($vals['column'])) { - $this->column = $vals['column']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -6514,108 +4859,61 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->column_parent = new \cassandra\ColumnParent(); - $xfer += $this->column_parent->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->column = new \cassandra\CounterColumn(); - $xfer += $this->column->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_add_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_add_args'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_parent !== null) { - if (!is_object($this->column_parent)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_parent', TType::STRUCT, 2); - $xfer += $this->column_parent->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_add_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_add_args.key is unset!'); } - if ($this->column !== null) { - if (!is_object($this->column)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column', TType::STRUCT, 3); - $xfer += $this->column->write($output); - $xfer += $output->writeFieldEnd(); + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_add_args.column_parent is unset!'); + } + if ($this->column === null) { + throw new TProtocolException('Required field Cassandra_add_args.column is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_add_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_add_args.key is unset!'); + } + if ($this->column_parent === null) { + throw new TProtocolException('Required field Cassandra_add_args.column_parent is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 4); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->column === null) { + throw new TProtocolException('Required field Cassandra_add_args.column is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_add_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_add_result { +class Cassandra_add_result extends TBase { static $_TSPEC; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -6640,15 +4938,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -6658,79 +4948,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_add_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_add_result'); - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_add_result', self::$_TSPEC, $output); } } -class Cassandra_cas_args { +class Cassandra_cas_args extends TBase { static $_TSPEC; /** @@ -6742,11 +4969,11 @@ class Cassandra_cas_args { */ public $column_family = null; /** - * @var \cassandra\Column[] + * @var Column[] */ public $expected = null; /** - * @var \cassandra\Column[] + * @var Column[] */ public $updates = null; /** @@ -6798,24 +5025,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['column_family'])) { - $this->column_family = $vals['column_family']; - } - if (isset($vals['expected'])) { - $this->expected = $vals['expected']; - } - if (isset($vals['updates'])) { - $this->updates = $vals['updates']; - } - if (isset($vals['serial_consistency_level'])) { - $this->serial_consistency_level = $vals['serial_consistency_level']; - } - if (isset($vals['commit_consistency_level'])) { - $this->commit_consistency_level = $vals['commit_consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -6825,174 +5035,71 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->column_family); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::LST) { - $this->expected = array(); - $_size265 = 0; - $_etype268 = 0; - $xfer += $input->readListBegin($_etype268, $_size265); - for ($_i269 = 0; $_i269 < $_size265; ++$_i269) - { - $elem270 = null; - $elem270 = new \cassandra\Column(); - $xfer += $elem270->read($input); - $this->expected []= $elem270; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::LST) { - $this->updates = array(); - $_size271 = 0; - $_etype274 = 0; - $xfer += $input->readListBegin($_etype274, $_size271); - for ($_i275 = 0; $_i275 < $_size271; ++$_i275) - { - $elem276 = null; - $elem276 = new \cassandra\Column(); - $xfer += $elem276->read($input); - $this->updates []= $elem276; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 5: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->serial_consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - case 6: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->commit_consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_cas_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_cas_args'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_family !== null) { - $xfer += $output->writeFieldBegin('column_family', TType::STRING, 2); - $xfer += $output->writeString($this->column_family); - $xfer += $output->writeFieldEnd(); - } - if ($this->expected !== null) { - if (!is_array($this->expected)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('expected', TType::LST, 3); - { - $output->writeListBegin(TType::STRUCT, count($this->expected)); - { - foreach ($this->expected as $iter277) - { - $xfer += $iter277->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_cas_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_cas_args.key is unset!'); } - if ($this->updates !== null) { - if (!is_array($this->updates)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('updates', TType::LST, 4); - { - $output->writeListBegin(TType::STRUCT, count($this->updates)); - { - foreach ($this->updates as $iter278) - { - $xfer += $iter278->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); + if ($this->column_family === null) { + throw new TProtocolException('Required field Cassandra_cas_args.column_family is unset!'); + } + if ($this->serial_consistency_level === null) { + throw new TProtocolException('Required field Cassandra_cas_args.serial_consistency_level is unset!'); + } + if ($this->commit_consistency_level === null) { + throw new TProtocolException('Required field Cassandra_cas_args.commit_consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_cas_args.key is unset!'); + } + if ($this->column_family === null) { + throw new TProtocolException('Required field Cassandra_cas_args.column_family is unset!'); + } + if ($this->expected === null) { + throw new TProtocolException('Required field Cassandra_cas_args.expected is unset!'); } - if ($this->serial_consistency_level !== null) { - $xfer += $output->writeFieldBegin('serial_consistency_level', TType::I32, 5); - $xfer += $output->writeI32($this->serial_consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->updates === null) { + throw new TProtocolException('Required field Cassandra_cas_args.updates is unset!'); } - if ($this->commit_consistency_level !== null) { - $xfer += $output->writeFieldBegin('commit_consistency_level', TType::I32, 6); - $xfer += $output->writeI32($this->commit_consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->serial_consistency_level === null) { + throw new TProtocolException('Required field Cassandra_cas_args.serial_consistency_level is unset!'); + } + if ($this->commit_consistency_level === null) { + throw new TProtocolException('Required field Cassandra_cas_args.commit_consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_cas_result { +class Cassandra_cas_result extends TBase { static $_TSPEC; /** - * @var \cassandra\CASResult + * @var CASResult */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -7022,18 +5129,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -7043,95 +5139,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRUCT) { - $this->success = new \cassandra\CASResult(); - $xfer += $this->success->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_cas_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_cas_result'); - if ($this->success !== null) { - if (!is_object($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); - $xfer += $this->success->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_cas_result', self::$_TSPEC, $output); } } -class Cassandra_remove_args { +class Cassandra_remove_args extends TBase { static $_TSPEC; /** @@ -7139,7 +5156,7 @@ class Cassandra_remove_args { */ public $key = null; /** - * @var \cassandra\ColumnPath + * @var ColumnPath */ public $column_path = null; /** @@ -7174,18 +5191,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['column_path'])) { - $this->column_path = $vals['column_path']; - } - if (isset($vals['timestamp'])) { - $this->timestamp = $vals['timestamp']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -7195,104 +5201,58 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->column_path = new \cassandra\ColumnPath(); - $xfer += $this->column_path->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::I64) { - $xfer += $input->readI64($this->timestamp); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_remove_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_remove_args'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_path !== null) { - if (!is_object($this->column_path)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_path', TType::STRUCT, 2); - $xfer += $this->column_path->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_remove_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_remove_args.key is unset!'); + } + if ($this->column_path === null) { + throw new TProtocolException('Required field Cassandra_remove_args.column_path is unset!'); + } + if ($this->timestamp === null) { + throw new TProtocolException('Required field Cassandra_remove_args.timestamp is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_remove_args.key is unset!'); } - if ($this->timestamp !== null) { - $xfer += $output->writeFieldBegin('timestamp', TType::I64, 3); - $xfer += $output->writeI64($this->timestamp); - $xfer += $output->writeFieldEnd(); + if ($this->column_path === null) { + throw new TProtocolException('Required field Cassandra_remove_args.column_path is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 4); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->timestamp === null) { + throw new TProtocolException('Required field Cassandra_remove_args.timestamp is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_remove_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_remove_result { +class Cassandra_remove_result extends TBase { static $_TSPEC; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -7317,15 +5277,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -7335,79 +5287,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_remove_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_remove_result'); - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_remove_result', self::$_TSPEC, $output); } } -class Cassandra_remove_counter_args { +class Cassandra_remove_counter_args extends TBase { static $_TSPEC; /** @@ -7415,7 +5304,7 @@ class Cassandra_remove_counter_args { */ public $key = null; /** - * @var \cassandra\ColumnPath + * @var ColumnPath */ public $path = null; /** @@ -7442,15 +5331,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['path'])) { - $this->path = $vals['path']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -7460,92 +5341,55 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->path = new \cassandra\ColumnPath(); - $xfer += $this->path->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_remove_counter_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_remove_counter_args'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->path !== null) { - if (!is_object($this->path)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('path', TType::STRUCT, 2); - $xfer += $this->path->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_remove_counter_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_remove_counter_args.key is unset!'); + } + if ($this->path === null) { + throw new TProtocolException('Required field Cassandra_remove_counter_args.path is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 3); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_remove_counter_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field Cassandra_remove_counter_args.key is unset!'); + } + if ($this->path === null) { + throw new TProtocolException('Required field Cassandra_remove_counter_args.path is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_remove_counter_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_remove_counter_result { +class Cassandra_remove_counter_result extends TBase { static $_TSPEC; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -7570,15 +5414,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -7588,79 +5424,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_remove_counter_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_remove_counter_result'); - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_remove_counter_result', self::$_TSPEC, $output); } } -class Cassandra_batch_mutate_args { +class Cassandra_batch_mutate_args extends TBase { static $_TSPEC; /** @@ -7707,12 +5480,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['mutation_map'])) { - $this->mutation_map = $vals['mutation_map']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -7722,145 +5490,49 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::MAP) { - $this->mutation_map = array(); - $_size279 = 0; - $_ktype280 = 0; - $_vtype281 = 0; - $xfer += $input->readMapBegin($_ktype280, $_vtype281, $_size279); - for ($_i283 = 0; $_i283 < $_size279; ++$_i283) - { - $key284 = ''; - $val285 = array(); - $xfer += $input->readString($key284); - $val285 = array(); - $_size286 = 0; - $_ktype287 = 0; - $_vtype288 = 0; - $xfer += $input->readMapBegin($_ktype287, $_vtype288, $_size286); - for ($_i290 = 0; $_i290 < $_size286; ++$_i290) - { - $key291 = ''; - $val292 = array(); - $xfer += $input->readString($key291); - $val292 = array(); - $_size293 = 0; - $_etype296 = 0; - $xfer += $input->readListBegin($_etype296, $_size293); - for ($_i297 = 0; $_i297 < $_size293; ++$_i297) - { - $elem298 = null; - $elem298 = new \cassandra\Mutation(); - $xfer += $elem298->read($input); - $val292 []= $elem298; - } - $xfer += $input->readListEnd(); - $val285[$key291] = $val292; - } - $xfer += $input->readMapEnd(); - $this->mutation_map[$key284] = $val285; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_batch_mutate_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_batch_mutate_args'); - if ($this->mutation_map !== null) { - if (!is_array($this->mutation_map)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('mutation_map', TType::MAP, 1); - { - $output->writeMapBegin(TType::STRING, TType::MAP, count($this->mutation_map)); - { - foreach ($this->mutation_map as $kiter299 => $viter300) - { - $xfer += $output->writeString($kiter299); - { - $output->writeMapBegin(TType::STRING, TType::LST, count($viter300)); - { - foreach ($viter300 as $kiter301 => $viter302) - { - $xfer += $output->writeString($kiter301); - { - $output->writeListBegin(TType::STRUCT, count($viter302)); - { - foreach ($viter302 as $iter303) - { - $xfer += $iter303->write($output); - } - } - $output->writeListEnd(); - } - } - } - $output->writeMapEnd(); - } - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_batch_mutate_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->mutation_map === null) { + throw new TProtocolException('Required field Cassandra_batch_mutate_args.mutation_map is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_batch_mutate_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->mutation_map === null) { + throw new TProtocolException('Required field Cassandra_batch_mutate_args.mutation_map is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 2); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_batch_mutate_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_batch_mutate_result { +class Cassandra_batch_mutate_result extends TBase { static $_TSPEC; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -7885,15 +5557,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -7903,79 +5567,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_batch_mutate_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_batch_mutate_result'); - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_batch_mutate_result', self::$_TSPEC, $output); } } -class Cassandra_atomic_batch_mutate_args { +class Cassandra_atomic_batch_mutate_args extends TBase { static $_TSPEC; /** @@ -8022,12 +5623,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['mutation_map'])) { - $this->mutation_map = $vals['mutation_map']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -8037,145 +5633,49 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::MAP) { - $this->mutation_map = array(); - $_size304 = 0; - $_ktype305 = 0; - $_vtype306 = 0; - $xfer += $input->readMapBegin($_ktype305, $_vtype306, $_size304); - for ($_i308 = 0; $_i308 < $_size304; ++$_i308) - { - $key309 = ''; - $val310 = array(); - $xfer += $input->readString($key309); - $val310 = array(); - $_size311 = 0; - $_ktype312 = 0; - $_vtype313 = 0; - $xfer += $input->readMapBegin($_ktype312, $_vtype313, $_size311); - for ($_i315 = 0; $_i315 < $_size311; ++$_i315) - { - $key316 = ''; - $val317 = array(); - $xfer += $input->readString($key316); - $val317 = array(); - $_size318 = 0; - $_etype321 = 0; - $xfer += $input->readListBegin($_etype321, $_size318); - for ($_i322 = 0; $_i322 < $_size318; ++$_i322) - { - $elem323 = null; - $elem323 = new \cassandra\Mutation(); - $xfer += $elem323->read($input); - $val317 []= $elem323; - } - $xfer += $input->readListEnd(); - $val310[$key316] = $val317; - } - $xfer += $input->readMapEnd(); - $this->mutation_map[$key309] = $val310; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_atomic_batch_mutate_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_atomic_batch_mutate_args'); - if ($this->mutation_map !== null) { - if (!is_array($this->mutation_map)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('mutation_map', TType::MAP, 1); - { - $output->writeMapBegin(TType::STRING, TType::MAP, count($this->mutation_map)); - { - foreach ($this->mutation_map as $kiter324 => $viter325) - { - $xfer += $output->writeString($kiter324); - { - $output->writeMapBegin(TType::STRING, TType::LST, count($viter325)); - { - foreach ($viter325 as $kiter326 => $viter327) - { - $xfer += $output->writeString($kiter326); - { - $output->writeListBegin(TType::STRUCT, count($viter327)); - { - foreach ($viter327 as $iter328) - { - $xfer += $iter328->write($output); - } - } - $output->writeListEnd(); - } - } - } - $output->writeMapEnd(); - } - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_atomic_batch_mutate_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->mutation_map === null) { + throw new TProtocolException('Required field Cassandra_atomic_batch_mutate_args.mutation_map is unset!'); + } + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_atomic_batch_mutate_args.consistency_level is unset!'); + } + } + + private function _validateForWrite() { + if ($this->mutation_map === null) { + throw new TProtocolException('Required field Cassandra_atomic_batch_mutate_args.mutation_map is unset!'); } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 2); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); + if ($this->consistency_level === null) { + throw new TProtocolException('Required field Cassandra_atomic_batch_mutate_args.consistency_level is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_atomic_batch_mutate_result { +class Cassandra_atomic_batch_mutate_result extends TBase { static $_TSPEC; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -8200,15 +5700,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -8218,79 +5710,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_atomic_batch_mutate_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_atomic_batch_mutate_result'); - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_atomic_batch_mutate_result', self::$_TSPEC, $output); } } -class Cassandra_truncate_args { +class Cassandra_truncate_args extends TBase { static $_TSPEC; /** @@ -8308,9 +5737,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['cfname'])) { - $this->cfname = $vals['cfname']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -8320,64 +5747,43 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->cfname); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_truncate_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_truncate_args'); - if ($this->cfname !== null) { - $xfer += $output->writeFieldBegin('cfname', TType::STRING, 1); - $xfer += $output->writeString($this->cfname); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_truncate_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->cfname === null) { + throw new TProtocolException('Required field Cassandra_truncate_args.cfname is unset!'); + } + } + + private function _validateForWrite() { + if ($this->cfname === null) { + throw new TProtocolException('Required field Cassandra_truncate_args.cfname is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_truncate_result { +class Cassandra_truncate_result extends TBase { static $_TSPEC; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -8402,15 +5808,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -8420,83 +5818,20 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_truncate_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_truncate_result'); - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_truncate_result', self::$_TSPEC, $output); } } -class Cassandra_get_multi_slice_args { +class Cassandra_get_multi_slice_args extends TBase { static $_TSPEC; /** - * @var \cassandra\MultiSliceRequest + * @var MultiSliceRequest */ public $request = null; @@ -8511,9 +5846,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['request'])) { - $this->request = $vals['request']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -8523,72 +5856,47 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->request = new \cassandra\MultiSliceRequest(); - $xfer += $this->request->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_get_multi_slice_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_multi_slice_args'); - if ($this->request !== null) { - if (!is_object($this->request)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('request', TType::STRUCT, 1); - $xfer += $this->request->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_get_multi_slice_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->request === null) { + throw new TProtocolException('Required field Cassandra_get_multi_slice_args.request is unset!'); + } + } + + private function _validateForWrite() { + if ($this->request === null) { + throw new TProtocolException('Required field Cassandra_get_multi_slice_args.request is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_get_multi_slice_result { +class Cassandra_get_multi_slice_result extends TBase { static $_TSPEC; /** - * @var \cassandra\ColumnOrSuperColumn[] + * @var ColumnOrSuperColumn[] */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; @@ -8622,18 +5930,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -8642,115 +5939,17 @@ public function getName() { } public function read($input) - { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::LST) { - $this->success = array(); - $_size329 = 0; - $_etype332 = 0; - $xfer += $input->readListBegin($_etype332, $_size329); - for ($_i333 = 0; $_i333 < $_size329; ++$_i333) - { - $elem334 = null; - $elem334 = new \cassandra\ColumnOrSuperColumn(); - $xfer += $elem334->read($input); - $this->success []= $elem334; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; - } - - public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_get_multi_slice_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::LST, 0); - { - $output->writeListBegin(TType::STRUCT, count($this->success)); - { - foreach ($this->success as $iter335) - { - $xfer += $iter335->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + { + return $this->_read('Cassandra_get_multi_slice_result', self::$_TSPEC, $input); + } + + public function write($output) { + return $this->_write('Cassandra_get_multi_slice_result', self::$_TSPEC, $output); } } -class Cassandra_describe_schema_versions_args { +class Cassandra_describe_schema_versions_args extends TBase { static $_TSPEC; @@ -8767,40 +5966,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_schema_versions_args', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_schema_versions_args'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_schema_versions_args', self::$_TSPEC, $output); } } -class Cassandra_describe_schema_versions_result { +class Cassandra_describe_schema_versions_result extends TBase { static $_TSPEC; /** @@ -8808,7 +5983,7 @@ class Cassandra_describe_schema_versions_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -8839,12 +6014,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -8854,110 +6024,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::MAP) { - $this->success = array(); - $_size336 = 0; - $_ktype337 = 0; - $_vtype338 = 0; - $xfer += $input->readMapBegin($_ktype337, $_vtype338, $_size336); - for ($_i340 = 0; $_i340 < $_size336; ++$_i340) - { - $key341 = ''; - $val342 = array(); - $xfer += $input->readString($key341); - $val342 = array(); - $_size343 = 0; - $_etype346 = 0; - $xfer += $input->readListBegin($_etype346, $_size343); - for ($_i347 = 0; $_i347 < $_size343; ++$_i347) - { - $elem348 = null; - $xfer += $input->readString($elem348); - $val342 []= $elem348; - } - $xfer += $input->readListEnd(); - $this->success[$key341] = $val342; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_schema_versions_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_schema_versions_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::MAP, 0); - { - $output->writeMapBegin(TType::STRING, TType::LST, count($this->success)); - { - foreach ($this->success as $kiter349 => $viter350) - { - $xfer += $output->writeString($kiter349); - { - $output->writeListBegin(TType::STRING, count($viter350)); - { - foreach ($viter350 as $iter351) - { - $xfer += $output->writeString($iter351); - } - } - $output->writeListEnd(); - } - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_schema_versions_result', self::$_TSPEC, $output); } } -class Cassandra_describe_keyspaces_args { +class Cassandra_describe_keyspaces_args extends TBase { static $_TSPEC; @@ -8974,48 +6050,24 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_keyspaces_args', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_keyspaces_args'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_keyspaces_args', self::$_TSPEC, $output); } } -class Cassandra_describe_keyspaces_result { +class Cassandra_describe_keyspaces_result extends TBase { static $_TSPEC; /** - * @var \cassandra\KsDef[] + * @var KsDef[] */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -9039,12 +6091,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -9054,88 +6101,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::LST) { - $this->success = array(); - $_size352 = 0; - $_etype355 = 0; - $xfer += $input->readListBegin($_etype355, $_size352); - for ($_i356 = 0; $_i356 < $_size352; ++$_i356) - { - $elem357 = null; - $elem357 = new \cassandra\KsDef(); - $xfer += $elem357->read($input); - $this->success []= $elem357; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_keyspaces_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_keyspaces_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::LST, 0); - { - $output->writeListBegin(TType::STRUCT, count($this->success)); - { - foreach ($this->success as $iter358) - { - $xfer += $iter358->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_keyspaces_result', self::$_TSPEC, $output); } } -class Cassandra_describe_cluster_name_args { +class Cassandra_describe_cluster_name_args extends TBase { static $_TSPEC; @@ -9152,40 +6127,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_cluster_name_args', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_cluster_name_args'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_cluster_name_args', self::$_TSPEC, $output); } } -class Cassandra_describe_cluster_name_result { +class Cassandra_describe_cluster_name_result extends TBase { static $_TSPEC; /** @@ -9203,9 +6154,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -9215,52 +6164,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_cluster_name_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_cluster_name_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_cluster_name_result', self::$_TSPEC, $output); } } -class Cassandra_describe_version_args { +class Cassandra_describe_version_args extends TBase { static $_TSPEC; @@ -9277,40 +6190,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_version_args', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_version_args'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_version_args', self::$_TSPEC, $output); } } -class Cassandra_describe_version_result { +class Cassandra_describe_version_result extends TBase { static $_TSPEC; /** @@ -9328,9 +6217,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -9340,52 +6227,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_version_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_version_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_version_result', self::$_TSPEC, $output); } } -class Cassandra_describe_ring_args { +class Cassandra_describe_ring_args extends TBase { static $_TSPEC; /** @@ -9403,9 +6254,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['keyspace'])) { - $this->keyspace = $vals['keyspace']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -9415,60 +6264,39 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->keyspace); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_describe_ring_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_ring_args'); - if ($this->keyspace !== null) { - $xfer += $output->writeFieldBegin('keyspace', TType::STRING, 1); - $xfer += $output->writeString($this->keyspace); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_describe_ring_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field Cassandra_describe_ring_args.keyspace is unset!'); + } + } + + private function _validateForWrite() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field Cassandra_describe_ring_args.keyspace is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_describe_ring_result { +class Cassandra_describe_ring_result extends TBase { static $_TSPEC; /** - * @var \cassandra\TokenRange[] + * @var TokenRange[] */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -9492,12 +6320,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -9507,88 +6330,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::LST) { - $this->success = array(); - $_size359 = 0; - $_etype362 = 0; - $xfer += $input->readListBegin($_etype362, $_size359); - for ($_i363 = 0; $_i363 < $_size359; ++$_i363) - { - $elem364 = null; - $elem364 = new \cassandra\TokenRange(); - $xfer += $elem364->read($input); - $this->success []= $elem364; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_ring_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_ring_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::LST, 0); - { - $output->writeListBegin(TType::STRUCT, count($this->success)); - { - foreach ($this->success as $iter365) - { - $xfer += $iter365->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_ring_result', self::$_TSPEC, $output); } } -class Cassandra_describe_local_ring_args { +class Cassandra_describe_local_ring_args extends TBase { static $_TSPEC; /** @@ -9606,9 +6357,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['keyspace'])) { - $this->keyspace = $vals['keyspace']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -9618,60 +6367,39 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->keyspace); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_describe_local_ring_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_local_ring_args'); - if ($this->keyspace !== null) { - $xfer += $output->writeFieldBegin('keyspace', TType::STRING, 1); - $xfer += $output->writeString($this->keyspace); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_describe_local_ring_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field Cassandra_describe_local_ring_args.keyspace is unset!'); + } + } + + private function _validateForWrite() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field Cassandra_describe_local_ring_args.keyspace is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_describe_local_ring_result { +class Cassandra_describe_local_ring_result extends TBase { static $_TSPEC; /** - * @var \cassandra\TokenRange[] + * @var TokenRange[] */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -9695,12 +6423,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -9710,88 +6433,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::LST) { - $this->success = array(); - $_size366 = 0; - $_etype369 = 0; - $xfer += $input->readListBegin($_etype369, $_size366); - for ($_i370 = 0; $_i370 < $_size366; ++$_i370) - { - $elem371 = null; - $elem371 = new \cassandra\TokenRange(); - $xfer += $elem371->read($input); - $this->success []= $elem371; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_local_ring_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_local_ring_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::LST, 0); - { - $output->writeListBegin(TType::STRUCT, count($this->success)); - { - foreach ($this->success as $iter372) - { - $xfer += $iter372->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_local_ring_result', self::$_TSPEC, $output); } } -class Cassandra_describe_token_map_args { +class Cassandra_describe_token_map_args extends TBase { static $_TSPEC; @@ -9808,40 +6459,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_token_map_args', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_token_map_args'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_token_map_args', self::$_TSPEC, $output); } } -class Cassandra_describe_token_map_result { +class Cassandra_describe_token_map_result extends TBase { static $_TSPEC; /** @@ -9849,7 +6476,7 @@ class Cassandra_describe_token_map_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -9876,12 +6503,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -9891,91 +6513,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::MAP) { - $this->success = array(); - $_size373 = 0; - $_ktype374 = 0; - $_vtype375 = 0; - $xfer += $input->readMapBegin($_ktype374, $_vtype375, $_size373); - for ($_i377 = 0; $_i377 < $_size373; ++$_i377) - { - $key378 = ''; - $val379 = ''; - $xfer += $input->readString($key378); - $xfer += $input->readString($val379); - $this->success[$key378] = $val379; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_token_map_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_token_map_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::MAP, 0); - { - $output->writeMapBegin(TType::STRING, TType::STRING, count($this->success)); - { - foreach ($this->success as $kiter380 => $viter381) - { - $xfer += $output->writeString($kiter380); - $xfer += $output->writeString($viter381); - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_token_map_result', self::$_TSPEC, $output); } } -class Cassandra_describe_partitioner_args { +class Cassandra_describe_partitioner_args extends TBase { static $_TSPEC; @@ -9992,40 +6539,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_partitioner_args', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_partitioner_args'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_partitioner_args', self::$_TSPEC, $output); } } -class Cassandra_describe_partitioner_result { +class Cassandra_describe_partitioner_result extends TBase { static $_TSPEC; /** @@ -10043,9 +6566,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -10055,52 +6576,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_partitioner_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_partitioner_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_partitioner_result', self::$_TSPEC, $output); } } -class Cassandra_describe_snitch_args { +class Cassandra_describe_snitch_args extends TBase { static $_TSPEC; @@ -10117,40 +6602,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_snitch_args', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_snitch_args'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_snitch_args', self::$_TSPEC, $output); } } -class Cassandra_describe_snitch_result { +class Cassandra_describe_snitch_result extends TBase { static $_TSPEC; /** @@ -10168,9 +6629,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -10180,52 +6639,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_snitch_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_snitch_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_snitch_result', self::$_TSPEC, $output); } } -class Cassandra_describe_keyspace_args { +class Cassandra_describe_keyspace_args extends TBase { static $_TSPEC; /** @@ -10243,9 +6666,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['keyspace'])) { - $this->keyspace = $vals['keyspace']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -10255,64 +6676,43 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->keyspace); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_describe_keyspace_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_keyspace_args'); - if ($this->keyspace !== null) { - $xfer += $output->writeFieldBegin('keyspace', TType::STRING, 1); - $xfer += $output->writeString($this->keyspace); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_describe_keyspace_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field Cassandra_describe_keyspace_args.keyspace is unset!'); + } + } + + private function _validateForWrite() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field Cassandra_describe_keyspace_args.keyspace is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_describe_keyspace_result { +class Cassandra_describe_keyspace_result extends TBase { static $_TSPEC; /** - * @var \cassandra\KsDef + * @var KsDef */ public $success = null; /** - * @var \cassandra\NotFoundException + * @var NotFoundException */ public $nfe = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -10337,15 +6737,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['nfe'])) { - $this->nfe = $vals['nfe']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -10355,82 +6747,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRUCT) { - $this->success = new \cassandra\KsDef(); - $xfer += $this->success->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->nfe = new \cassandra\NotFoundException(); - $xfer += $this->nfe->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_keyspace_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_keyspace_result'); - if ($this->success !== null) { - if (!is_object($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); - $xfer += $this->success->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->nfe !== null) { - $xfer += $output->writeFieldBegin('nfe', TType::STRUCT, 1); - $xfer += $this->nfe->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 2); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_keyspace_result', self::$_TSPEC, $output); } } -class Cassandra_describe_splits_args { +class Cassandra_describe_splits_args extends TBase { static $_TSPEC; /** @@ -10472,18 +6798,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['cfName'])) { - $this->cfName = $vals['cfName']; - } - if (isset($vals['start_token'])) { - $this->start_token = $vals['start_token']; - } - if (isset($vals['end_token'])) { - $this->end_token = $vals['end_token']; - } - if (isset($vals['keys_per_split'])) { - $this->keys_per_split = $vals['keys_per_split']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -10493,88 +6808,49 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->cfName); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->start_token); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->end_token); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->keys_per_split); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_describe_splits_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_splits_args'); - if ($this->cfName !== null) { - $xfer += $output->writeFieldBegin('cfName', TType::STRING, 1); - $xfer += $output->writeString($this->cfName); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_describe_splits_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->cfName === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_args.cfName is unset!'); + } + if ($this->start_token === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_args.start_token is unset!'); + } + if ($this->end_token === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_args.end_token is unset!'); + } + if ($this->keys_per_split === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_args.keys_per_split is unset!'); } - if ($this->start_token !== null) { - $xfer += $output->writeFieldBegin('start_token', TType::STRING, 2); - $xfer += $output->writeString($this->start_token); - $xfer += $output->writeFieldEnd(); + } + + private function _validateForWrite() { + if ($this->cfName === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_args.cfName is unset!'); } - if ($this->end_token !== null) { - $xfer += $output->writeFieldBegin('end_token', TType::STRING, 3); - $xfer += $output->writeString($this->end_token); - $xfer += $output->writeFieldEnd(); + if ($this->start_token === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_args.start_token is unset!'); } - if ($this->keys_per_split !== null) { - $xfer += $output->writeFieldBegin('keys_per_split', TType::I32, 4); - $xfer += $output->writeI32($this->keys_per_split); - $xfer += $output->writeFieldEnd(); + if ($this->end_token === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_args.end_token is unset!'); + } + if ($this->keys_per_split === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_args.keys_per_split is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_describe_splits_result { +class Cassandra_describe_splits_result extends TBase { static $_TSPEC; /** @@ -10582,7 +6858,7 @@ class Cassandra_describe_splits_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -10605,12 +6881,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -10620,87 +6891,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::LST) { - $this->success = array(); - $_size382 = 0; - $_etype385 = 0; - $xfer += $input->readListBegin($_etype385, $_size382); - for ($_i386 = 0; $_i386 < $_size382; ++$_i386) - { - $elem387 = null; - $xfer += $input->readString($elem387); - $this->success []= $elem387; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_splits_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_splits_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::LST, 0); - { - $output->writeListBegin(TType::STRING, count($this->success)); - { - foreach ($this->success as $iter388) - { - $xfer += $output->writeString($iter388); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_splits_result', self::$_TSPEC, $output); } } -class Cassandra_trace_next_query_args { +class Cassandra_trace_next_query_args extends TBase { static $_TSPEC; @@ -10717,40 +6917,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_trace_next_query_args', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_trace_next_query_args'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_trace_next_query_args', self::$_TSPEC, $output); } } -class Cassandra_trace_next_query_result { +class Cassandra_trace_next_query_result extends TBase { static $_TSPEC; /** @@ -10768,9 +6944,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -10780,52 +6954,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_trace_next_query_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_trace_next_query_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_trace_next_query_result', self::$_TSPEC, $output); } } -class Cassandra_describe_splits_ex_args { +class Cassandra_describe_splits_ex_args extends TBase { static $_TSPEC; /** @@ -10867,18 +7005,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['cfName'])) { - $this->cfName = $vals['cfName']; - } - if (isset($vals['start_token'])) { - $this->start_token = $vals['start_token']; - } - if (isset($vals['end_token'])) { - $this->end_token = $vals['end_token']; - } - if (isset($vals['keys_per_split'])) { - $this->keys_per_split = $vals['keys_per_split']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -10888,96 +7015,57 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->cfName); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->start_token); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->end_token); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->keys_per_split); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_describe_splits_ex_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_splits_ex_args'); - if ($this->cfName !== null) { - $xfer += $output->writeFieldBegin('cfName', TType::STRING, 1); - $xfer += $output->writeString($this->cfName); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_describe_splits_ex_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->cfName === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_ex_args.cfName is unset!'); + } + if ($this->start_token === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_ex_args.start_token is unset!'); + } + if ($this->end_token === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_ex_args.end_token is unset!'); + } + if ($this->keys_per_split === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_ex_args.keys_per_split is unset!'); } - if ($this->start_token !== null) { - $xfer += $output->writeFieldBegin('start_token', TType::STRING, 2); - $xfer += $output->writeString($this->start_token); - $xfer += $output->writeFieldEnd(); + } + + private function _validateForWrite() { + if ($this->cfName === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_ex_args.cfName is unset!'); } - if ($this->end_token !== null) { - $xfer += $output->writeFieldBegin('end_token', TType::STRING, 3); - $xfer += $output->writeString($this->end_token); - $xfer += $output->writeFieldEnd(); + if ($this->start_token === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_ex_args.start_token is unset!'); } - if ($this->keys_per_split !== null) { - $xfer += $output->writeFieldBegin('keys_per_split', TType::I32, 4); - $xfer += $output->writeI32($this->keys_per_split); - $xfer += $output->writeFieldEnd(); + if ($this->end_token === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_ex_args.end_token is unset!'); + } + if ($this->keys_per_split === null) { + throw new TProtocolException('Required field Cassandra_describe_splits_ex_args.keys_per_split is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_describe_splits_ex_result { +class Cassandra_describe_splits_ex_result extends TBase { static $_TSPEC; /** - * @var \cassandra\CfSplit[] + * @var CfSplit[] */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -11001,12 +7089,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -11016,92 +7099,20 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::LST) { - $this->success = array(); - $_size389 = 0; - $_etype392 = 0; - $xfer += $input->readListBegin($_etype392, $_size389); - for ($_i393 = 0; $_i393 < $_size389; ++$_i393) - { - $elem394 = null; - $elem394 = new \cassandra\CfSplit(); - $xfer += $elem394->read($input); - $this->success []= $elem394; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_describe_splits_ex_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_describe_splits_ex_result'); - if ($this->success !== null) { - if (!is_array($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::LST, 0); - { - $output->writeListBegin(TType::STRUCT, count($this->success)); - { - foreach ($this->success as $iter395) - { - $xfer += $iter395->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_describe_splits_ex_result', self::$_TSPEC, $output); } } -class Cassandra_system_add_column_family_args { +class Cassandra_system_add_column_family_args extends TBase { static $_TSPEC; /** - * @var \cassandra\CfDef + * @var CfDef */ public $cf_def = null; @@ -11116,9 +7127,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['cf_def'])) { - $this->cf_def = $vals['cf_def']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -11128,56 +7137,31 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->cf_def = new \cassandra\CfDef(); - $xfer += $this->cf_def->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_system_add_column_family_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_add_column_family_args'); - if ($this->cf_def !== null) { - if (!is_object($this->cf_def)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('cf_def', TType::STRUCT, 1); - $xfer += $this->cf_def->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_system_add_column_family_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->cf_def === null) { + throw new TProtocolException('Required field Cassandra_system_add_column_family_args.cf_def is unset!'); + } + } + + private function _validateForWrite() { + if ($this->cf_def === null) { + throw new TProtocolException('Required field Cassandra_system_add_column_family_args.cf_def is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_system_add_column_family_result { +class Cassandra_system_add_column_family_result extends TBase { static $_TSPEC; /** @@ -11185,11 +7169,11 @@ class Cassandra_system_add_column_family_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\SchemaDisagreementException + * @var SchemaDisagreementException */ public $sde = null; @@ -11213,15 +7197,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['sde'])) { - $this->sde = $vals['sde']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -11231,78 +7207,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->sde = new \cassandra\SchemaDisagreementException(); - $xfer += $this->sde->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_system_add_column_family_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_add_column_family_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->sde !== null) { - $xfer += $output->writeFieldBegin('sde', TType::STRUCT, 2); - $xfer += $this->sde->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_system_add_column_family_result', self::$_TSPEC, $output); } } -class Cassandra_system_drop_column_family_args { +class Cassandra_system_drop_column_family_args extends TBase { static $_TSPEC; /** @@ -11320,9 +7234,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['column_family'])) { - $this->column_family = $vals['column_family']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -11332,52 +7244,31 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->column_family); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_system_drop_column_family_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_drop_column_family_args'); - if ($this->column_family !== null) { - $xfer += $output->writeFieldBegin('column_family', TType::STRING, 1); - $xfer += $output->writeString($this->column_family); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_system_drop_column_family_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->column_family === null) { + throw new TProtocolException('Required field Cassandra_system_drop_column_family_args.column_family is unset!'); + } + } + + private function _validateForWrite() { + if ($this->column_family === null) { + throw new TProtocolException('Required field Cassandra_system_drop_column_family_args.column_family is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_system_drop_column_family_result { +class Cassandra_system_drop_column_family_result extends TBase { static $_TSPEC; /** @@ -11385,11 +7276,11 @@ class Cassandra_system_drop_column_family_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\SchemaDisagreementException + * @var SchemaDisagreementException */ public $sde = null; @@ -11413,15 +7304,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['sde'])) { - $this->sde = $vals['sde']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -11431,82 +7314,20 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->sde = new \cassandra\SchemaDisagreementException(); - $xfer += $this->sde->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_system_drop_column_family_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_drop_column_family_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->sde !== null) { - $xfer += $output->writeFieldBegin('sde', TType::STRUCT, 2); - $xfer += $this->sde->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_system_drop_column_family_result', self::$_TSPEC, $output); } } -class Cassandra_system_add_keyspace_args { +class Cassandra_system_add_keyspace_args extends TBase { static $_TSPEC; /** - * @var \cassandra\KsDef + * @var KsDef */ public $ks_def = null; @@ -11521,9 +7342,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ks_def'])) { - $this->ks_def = $vals['ks_def']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -11531,58 +7350,33 @@ public function getName() { return 'Cassandra_system_add_keyspace_args'; } - public function read($input) - { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ks_def = new \cassandra\KsDef(); - $xfer += $this->ks_def->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); + public function read($input) + { + $tmp = $this->_read('Cassandra_system_add_keyspace_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; + } + + public function write($output) { + $this->_validateForWrite(); + return $this->_write('Cassandra_system_add_keyspace_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->ks_def === null) { + throw new TProtocolException('Required field Cassandra_system_add_keyspace_args.ks_def is unset!'); } - $xfer += $input->readStructEnd(); - return $xfer; } - public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_add_keyspace_args'); - if ($this->ks_def !== null) { - if (!is_object($this->ks_def)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('ks_def', TType::STRUCT, 1); - $xfer += $this->ks_def->write($output); - $xfer += $output->writeFieldEnd(); + private function _validateForWrite() { + if ($this->ks_def === null) { + throw new TProtocolException('Required field Cassandra_system_add_keyspace_args.ks_def is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_system_add_keyspace_result { +class Cassandra_system_add_keyspace_result extends TBase { static $_TSPEC; /** @@ -11590,11 +7384,11 @@ class Cassandra_system_add_keyspace_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\SchemaDisagreementException + * @var SchemaDisagreementException */ public $sde = null; @@ -11618,15 +7412,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['sde'])) { - $this->sde = $vals['sde']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -11636,78 +7422,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->sde = new \cassandra\SchemaDisagreementException(); - $xfer += $this->sde->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_system_add_keyspace_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_add_keyspace_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->sde !== null) { - $xfer += $output->writeFieldBegin('sde', TType::STRUCT, 2); - $xfer += $this->sde->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_system_add_keyspace_result', self::$_TSPEC, $output); } } -class Cassandra_system_drop_keyspace_args { +class Cassandra_system_drop_keyspace_args extends TBase { static $_TSPEC; /** @@ -11725,9 +7449,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['keyspace'])) { - $this->keyspace = $vals['keyspace']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -11737,52 +7459,31 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->keyspace); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_system_drop_keyspace_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_drop_keyspace_args'); - if ($this->keyspace !== null) { - $xfer += $output->writeFieldBegin('keyspace', TType::STRING, 1); - $xfer += $output->writeString($this->keyspace); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_system_drop_keyspace_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field Cassandra_system_drop_keyspace_args.keyspace is unset!'); + } + } + + private function _validateForWrite() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field Cassandra_system_drop_keyspace_args.keyspace is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_system_drop_keyspace_result { +class Cassandra_system_drop_keyspace_result extends TBase { static $_TSPEC; /** @@ -11790,11 +7491,11 @@ class Cassandra_system_drop_keyspace_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\SchemaDisagreementException + * @var SchemaDisagreementException */ public $sde = null; @@ -11818,15 +7519,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['sde'])) { - $this->sde = $vals['sde']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -11836,82 +7529,20 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->sde = new \cassandra\SchemaDisagreementException(); - $xfer += $this->sde->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_system_drop_keyspace_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_drop_keyspace_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->sde !== null) { - $xfer += $output->writeFieldBegin('sde', TType::STRUCT, 2); - $xfer += $this->sde->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_system_drop_keyspace_result', self::$_TSPEC, $output); } } -class Cassandra_system_update_keyspace_args { +class Cassandra_system_update_keyspace_args extends TBase { static $_TSPEC; /** - * @var \cassandra\KsDef + * @var KsDef */ public $ks_def = null; @@ -11926,9 +7557,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ks_def'])) { - $this->ks_def = $vals['ks_def']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -11938,56 +7567,31 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ks_def = new \cassandra\KsDef(); - $xfer += $this->ks_def->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_system_update_keyspace_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_update_keyspace_args'); - if ($this->ks_def !== null) { - if (!is_object($this->ks_def)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('ks_def', TType::STRUCT, 1); - $xfer += $this->ks_def->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_system_update_keyspace_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->ks_def === null) { + throw new TProtocolException('Required field Cassandra_system_update_keyspace_args.ks_def is unset!'); + } + } + + private function _validateForWrite() { + if ($this->ks_def === null) { + throw new TProtocolException('Required field Cassandra_system_update_keyspace_args.ks_def is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_system_update_keyspace_result { +class Cassandra_system_update_keyspace_result extends TBase { static $_TSPEC; /** @@ -11995,11 +7599,11 @@ class Cassandra_system_update_keyspace_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\SchemaDisagreementException + * @var SchemaDisagreementException */ public $sde = null; @@ -12023,15 +7627,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['sde'])) { - $this->sde = $vals['sde']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -12041,82 +7637,20 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->sde = new \cassandra\SchemaDisagreementException(); - $xfer += $this->sde->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_system_update_keyspace_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_update_keyspace_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->sde !== null) { - $xfer += $output->writeFieldBegin('sde', TType::STRUCT, 2); - $xfer += $this->sde->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_system_update_keyspace_result', self::$_TSPEC, $output); } } -class Cassandra_system_update_column_family_args { +class Cassandra_system_update_column_family_args extends TBase { static $_TSPEC; /** - * @var \cassandra\CfDef + * @var CfDef */ public $cf_def = null; @@ -12131,9 +7665,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['cf_def'])) { - $this->cf_def = $vals['cf_def']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -12143,56 +7675,31 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->cf_def = new \cassandra\CfDef(); - $xfer += $this->cf_def->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_system_update_column_family_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_update_column_family_args'); - if ($this->cf_def !== null) { - if (!is_object($this->cf_def)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('cf_def', TType::STRUCT, 1); - $xfer += $this->cf_def->write($output); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_system_update_column_family_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->cf_def === null) { + throw new TProtocolException('Required field Cassandra_system_update_column_family_args.cf_def is unset!'); + } + } + + private function _validateForWrite() { + if ($this->cf_def === null) { + throw new TProtocolException('Required field Cassandra_system_update_column_family_args.cf_def is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_system_update_column_family_result { +class Cassandra_system_update_column_family_result extends TBase { static $_TSPEC; /** @@ -12200,11 +7707,11 @@ class Cassandra_system_update_column_family_result { */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\SchemaDisagreementException + * @var SchemaDisagreementException */ public $sde = null; @@ -12228,15 +7735,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['sde'])) { - $this->sde = $vals['sde']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -12246,78 +7745,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->sde = new \cassandra\SchemaDisagreementException(); - $xfer += $this->sde->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_system_update_column_family_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_system_update_column_family_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::STRING, 0); - $xfer += $output->writeString($this->success); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->sde !== null) { - $xfer += $output->writeFieldBegin('sde', TType::STRUCT, 2); - $xfer += $this->sde->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_system_update_column_family_result', self::$_TSPEC, $output); } } -class Cassandra_execute_cql_query_args { +class Cassandra_execute_cql_query_args extends TBase { static $_TSPEC; /** @@ -12343,12 +7780,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['query'])) { - $this->query = $vals['query']; - } - if (isset($vals['compression'])) { - $this->compression = $vals['compression']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -12358,84 +7790,57 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->query); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->compression); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_execute_cql_query_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_execute_cql_query_args'); - if ($this->query !== null) { - $xfer += $output->writeFieldBegin('query', TType::STRING, 1); - $xfer += $output->writeString($this->query); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_execute_cql_query_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->query === null) { + throw new TProtocolException('Required field Cassandra_execute_cql_query_args.query is unset!'); + } + if ($this->compression === null) { + throw new TProtocolException('Required field Cassandra_execute_cql_query_args.compression is unset!'); + } + } + + private function _validateForWrite() { + if ($this->query === null) { + throw new TProtocolException('Required field Cassandra_execute_cql_query_args.query is unset!'); } - if ($this->compression !== null) { - $xfer += $output->writeFieldBegin('compression', TType::I32, 2); - $xfer += $output->writeI32($this->compression); - $xfer += $output->writeFieldEnd(); + if ($this->compression === null) { + throw new TProtocolException('Required field Cassandra_execute_cql_query_args.compression is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_execute_cql_query_result { +class Cassandra_execute_cql_query_result extends TBase { static $_TSPEC; /** - * @var \cassandra\CqlResult + * @var CqlResult */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; /** - * @var \cassandra\SchemaDisagreementException + * @var SchemaDisagreementException */ public $sde = null; @@ -12470,21 +7875,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } - if (isset($vals['sde'])) { - $this->sde = $vals['sde']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -12494,108 +7885,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRUCT) { - $this->success = new \cassandra\CqlResult(); - $xfer += $this->success->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRUCT) { - $this->sde = new \cassandra\SchemaDisagreementException(); - $xfer += $this->sde->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_execute_cql_query_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_execute_cql_query_result'); - if ($this->success !== null) { - if (!is_object($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); - $xfer += $this->success->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->sde !== null) { - $xfer += $output->writeFieldBegin('sde', TType::STRUCT, 4); - $xfer += $this->sde->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_execute_cql_query_result', self::$_TSPEC, $output); } } -class Cassandra_execute_cql3_query_args { +class Cassandra_execute_cql3_query_args extends TBase { static $_TSPEC; /** @@ -12629,15 +7928,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['query'])) { - $this->query = $vals['query']; - } - if (isset($vals['compression'])) { - $this->compression = $vals['compression']; - } - if (isset($vals['consistency'])) { - $this->consistency = $vals['consistency']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -12647,96 +7938,63 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->query); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->compression); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_execute_cql3_query_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_execute_cql3_query_args'); - if ($this->query !== null) { - $xfer += $output->writeFieldBegin('query', TType::STRING, 1); - $xfer += $output->writeString($this->query); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_execute_cql3_query_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->query === null) { + throw new TProtocolException('Required field Cassandra_execute_cql3_query_args.query is unset!'); + } + if ($this->compression === null) { + throw new TProtocolException('Required field Cassandra_execute_cql3_query_args.compression is unset!'); + } + if ($this->consistency === null) { + throw new TProtocolException('Required field Cassandra_execute_cql3_query_args.consistency is unset!'); + } + } + + private function _validateForWrite() { + if ($this->query === null) { + throw new TProtocolException('Required field Cassandra_execute_cql3_query_args.query is unset!'); } - if ($this->compression !== null) { - $xfer += $output->writeFieldBegin('compression', TType::I32, 2); - $xfer += $output->writeI32($this->compression); - $xfer += $output->writeFieldEnd(); + if ($this->compression === null) { + throw new TProtocolException('Required field Cassandra_execute_cql3_query_args.compression is unset!'); } - if ($this->consistency !== null) { - $xfer += $output->writeFieldBegin('consistency', TType::I32, 3); - $xfer += $output->writeI32($this->consistency); - $xfer += $output->writeFieldEnd(); + if ($this->consistency === null) { + throw new TProtocolException('Required field Cassandra_execute_cql3_query_args.consistency is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_execute_cql3_query_result { +class Cassandra_execute_cql3_query_result extends TBase { static $_TSPEC; /** - * @var \cassandra\CqlResult + * @var CqlResult */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; /** - * @var \cassandra\SchemaDisagreementException + * @var SchemaDisagreementException */ public $sde = null; @@ -12771,21 +8029,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } - if (isset($vals['sde'])) { - $this->sde = $vals['sde']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -12795,108 +8039,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRUCT) { - $this->success = new \cassandra\CqlResult(); - $xfer += $this->success->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRUCT) { - $this->sde = new \cassandra\SchemaDisagreementException(); - $xfer += $this->sde->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_execute_cql3_query_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_execute_cql3_query_result'); - if ($this->success !== null) { - if (!is_object($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); - $xfer += $this->success->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->sde !== null) { - $xfer += $output->writeFieldBegin('sde', TType::STRUCT, 4); - $xfer += $this->sde->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_execute_cql3_query_result', self::$_TSPEC, $output); } } -class Cassandra_prepare_cql_query_args { +class Cassandra_prepare_cql_query_args extends TBase { static $_TSPEC; /** @@ -12922,12 +8074,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['query'])) { - $this->query = $vals['query']; - } - if (isset($vals['compression'])) { - $this->compression = $vals['compression']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -12937,72 +8084,45 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->query); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->compression); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_prepare_cql_query_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_prepare_cql_query_args'); - if ($this->query !== null) { - $xfer += $output->writeFieldBegin('query', TType::STRING, 1); - $xfer += $output->writeString($this->query); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_prepare_cql_query_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->query === null) { + throw new TProtocolException('Required field Cassandra_prepare_cql_query_args.query is unset!'); + } + if ($this->compression === null) { + throw new TProtocolException('Required field Cassandra_prepare_cql_query_args.compression is unset!'); + } + } + + private function _validateForWrite() { + if ($this->query === null) { + throw new TProtocolException('Required field Cassandra_prepare_cql_query_args.query is unset!'); } - if ($this->compression !== null) { - $xfer += $output->writeFieldBegin('compression', TType::I32, 2); - $xfer += $output->writeI32($this->compression); - $xfer += $output->writeFieldEnd(); + if ($this->compression === null) { + throw new TProtocolException('Required field Cassandra_prepare_cql_query_args.compression is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_prepare_cql_query_result { +class Cassandra_prepare_cql_query_result extends TBase { static $_TSPEC; /** - * @var \cassandra\CqlPreparedResult + * @var CqlPreparedResult */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -13022,12 +8142,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -13037,69 +8152,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRUCT) { - $this->success = new \cassandra\CqlPreparedResult(); - $xfer += $this->success->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_prepare_cql_query_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_prepare_cql_query_result'); - if ($this->success !== null) { - if (!is_object($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); - $xfer += $this->success->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_prepare_cql_query_result', self::$_TSPEC, $output); } } -class Cassandra_prepare_cql3_query_args { +class Cassandra_prepare_cql3_query_args extends TBase { static $_TSPEC; /** @@ -13125,12 +8187,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['query'])) { - $this->query = $vals['query']; - } - if (isset($vals['compression'])) { - $this->compression = $vals['compression']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -13140,72 +8197,45 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->query); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->compression); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_prepare_cql3_query_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_prepare_cql3_query_args'); - if ($this->query !== null) { - $xfer += $output->writeFieldBegin('query', TType::STRING, 1); - $xfer += $output->writeString($this->query); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_prepare_cql3_query_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->query === null) { + throw new TProtocolException('Required field Cassandra_prepare_cql3_query_args.query is unset!'); + } + if ($this->compression === null) { + throw new TProtocolException('Required field Cassandra_prepare_cql3_query_args.compression is unset!'); + } + } + + private function _validateForWrite() { + if ($this->query === null) { + throw new TProtocolException('Required field Cassandra_prepare_cql3_query_args.query is unset!'); } - if ($this->compression !== null) { - $xfer += $output->writeFieldBegin('compression', TType::I32, 2); - $xfer += $output->writeI32($this->compression); - $xfer += $output->writeFieldEnd(); + if ($this->compression === null) { + throw new TProtocolException('Required field Cassandra_prepare_cql3_query_args.compression is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_prepare_cql3_query_result { +class Cassandra_prepare_cql3_query_result extends TBase { static $_TSPEC; /** - * @var \cassandra\CqlPreparedResult + * @var CqlPreparedResult */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -13225,12 +8255,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -13240,69 +8265,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRUCT) { - $this->success = new \cassandra\CqlPreparedResult(); - $xfer += $this->success->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_prepare_cql3_query_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_prepare_cql3_query_result'); - if ($this->success !== null) { - if (!is_object($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); - $xfer += $this->success->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_prepare_cql3_query_result', self::$_TSPEC, $output); } } -class Cassandra_execute_prepared_cql_query_args { +class Cassandra_execute_prepared_cql_query_args extends TBase { static $_TSPEC; /** @@ -13332,12 +8304,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['itemId'])) { - $this->itemId = $vals['itemId']; - } - if (isset($vals['values'])) { - $this->values = $vals['values']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -13347,106 +8314,57 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->itemId); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::LST) { - $this->values = array(); - $_size396 = 0; - $_etype399 = 0; - $xfer += $input->readListBegin($_etype399, $_size396); - for ($_i400 = 0; $_i400 < $_size396; ++$_i400) - { - $elem401 = null; - $xfer += $input->readString($elem401); - $this->values []= $elem401; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_execute_prepared_cql_query_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_execute_prepared_cql_query_args'); - if ($this->itemId !== null) { - $xfer += $output->writeFieldBegin('itemId', TType::I32, 1); - $xfer += $output->writeI32($this->itemId); - $xfer += $output->writeFieldEnd(); - } - if ($this->values !== null) { - if (!is_array($this->values)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('values', TType::LST, 2); - { - $output->writeListBegin(TType::STRING, count($this->values)); - { - foreach ($this->values as $iter402) - { - $xfer += $output->writeString($iter402); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_execute_prepared_cql_query_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->itemId === null) { + throw new TProtocolException('Required field Cassandra_execute_prepared_cql_query_args.itemId is unset!'); + } + if ($this->values === null) { + throw new TProtocolException('Required field Cassandra_execute_prepared_cql_query_args.values is unset!'); + } + } + + private function _validateForWrite() { + if ($this->itemId === null) { + throw new TProtocolException('Required field Cassandra_execute_prepared_cql_query_args.itemId is unset!'); + } + if ($this->values === null) { + throw new TProtocolException('Required field Cassandra_execute_prepared_cql_query_args.values is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_execute_prepared_cql_query_result { +class Cassandra_execute_prepared_cql_query_result extends TBase { static $_TSPEC; /** - * @var \cassandra\CqlResult + * @var CqlResult */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; /** - * @var \cassandra\SchemaDisagreementException + * @var SchemaDisagreementException */ public $sde = null; @@ -13481,21 +8399,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } - if (isset($vals['sde'])) { - $this->sde = $vals['sde']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -13505,108 +8409,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRUCT) { - $this->success = new \cassandra\CqlResult(); - $xfer += $this->success->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRUCT) { - $this->sde = new \cassandra\SchemaDisagreementException(); - $xfer += $this->sde->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_execute_prepared_cql_query_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_execute_prepared_cql_query_result'); - if ($this->success !== null) { - if (!is_object($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); - $xfer += $this->success->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->sde !== null) { - $xfer += $output->writeFieldBegin('sde', TType::STRUCT, 4); - $xfer += $this->sde->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_execute_prepared_cql_query_result', self::$_TSPEC, $output); } } -class Cassandra_execute_prepared_cql3_query_args { +class Cassandra_execute_prepared_cql3_query_args extends TBase { static $_TSPEC; /** @@ -13644,15 +8456,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['itemId'])) { - $this->itemId = $vals['itemId']; - } - if (isset($vals['values'])) { - $this->values = $vals['values']; - } - if (isset($vals['consistency'])) { - $this->consistency = $vals['consistency']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -13662,118 +8466,63 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->itemId); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::LST) { - $this->values = array(); - $_size403 = 0; - $_etype406 = 0; - $xfer += $input->readListBegin($_etype406, $_size403); - for ($_i407 = 0; $_i407 < $_size403; ++$_i407) - { - $elem408 = null; - $xfer += $input->readString($elem408); - $this->values []= $elem408; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_execute_prepared_cql3_query_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_execute_prepared_cql3_query_args'); - if ($this->itemId !== null) { - $xfer += $output->writeFieldBegin('itemId', TType::I32, 1); - $xfer += $output->writeI32($this->itemId); - $xfer += $output->writeFieldEnd(); - } - if ($this->values !== null) { - if (!is_array($this->values)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('values', TType::LST, 2); - { - $output->writeListBegin(TType::STRING, count($this->values)); - { - foreach ($this->values as $iter409) - { - $xfer += $output->writeString($iter409); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_execute_prepared_cql3_query_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->itemId === null) { + throw new TProtocolException('Required field Cassandra_execute_prepared_cql3_query_args.itemId is unset!'); + } + if ($this->values === null) { + throw new TProtocolException('Required field Cassandra_execute_prepared_cql3_query_args.values is unset!'); + } + if ($this->consistency === null) { + throw new TProtocolException('Required field Cassandra_execute_prepared_cql3_query_args.consistency is unset!'); + } + } + + private function _validateForWrite() { + if ($this->itemId === null) { + throw new TProtocolException('Required field Cassandra_execute_prepared_cql3_query_args.itemId is unset!'); + } + if ($this->values === null) { + throw new TProtocolException('Required field Cassandra_execute_prepared_cql3_query_args.values is unset!'); } - if ($this->consistency !== null) { - $xfer += $output->writeFieldBegin('consistency', TType::I32, 3); - $xfer += $output->writeI32($this->consistency); - $xfer += $output->writeFieldEnd(); + if ($this->consistency === null) { + throw new TProtocolException('Required field Cassandra_execute_prepared_cql3_query_args.consistency is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_execute_prepared_cql3_query_result { +class Cassandra_execute_prepared_cql3_query_result extends TBase { static $_TSPEC; /** - * @var \cassandra\CqlResult + * @var CqlResult */ public $success = null; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; /** - * @var \cassandra\UnavailableException + * @var UnavailableException */ public $ue = null; /** - * @var \cassandra\TimedOutException + * @var TimedOutException */ public $te = null; /** - * @var \cassandra\SchemaDisagreementException + * @var SchemaDisagreementException */ public $sde = null; @@ -13808,21 +8557,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } - if (isset($vals['ue'])) { - $this->ue = $vals['ue']; - } - if (isset($vals['te'])) { - $this->te = $vals['te']; - } - if (isset($vals['sde'])) { - $this->sde = $vals['sde']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -13832,108 +8567,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 0: - if ($ftype == TType::STRUCT) { - $this->success = new \cassandra\CqlResult(); - $xfer += $this->success->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->ue = new \cassandra\UnavailableException(); - $xfer += $this->ue->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->te = new \cassandra\TimedOutException(); - $xfer += $this->te->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRUCT) { - $this->sde = new \cassandra\SchemaDisagreementException(); - $xfer += $this->sde->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_execute_prepared_cql3_query_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_execute_prepared_cql3_query_result'); - if ($this->success !== null) { - if (!is_object($this->success)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); - $xfer += $this->success->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->ue !== null) { - $xfer += $output->writeFieldBegin('ue', TType::STRUCT, 2); - $xfer += $this->ue->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->te !== null) { - $xfer += $output->writeFieldBegin('te', TType::STRUCT, 3); - $xfer += $this->te->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->sde !== null) { - $xfer += $output->writeFieldBegin('sde', TType::STRUCT, 4); - $xfer += $this->sde->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_execute_prepared_cql3_query_result', self::$_TSPEC, $output); } } -class Cassandra_set_cql_version_args { +class Cassandra_set_cql_version_args extends TBase { static $_TSPEC; /** @@ -13951,9 +8594,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['version'])) { - $this->version = $vals['version']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -13963,56 +8604,35 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->version); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Cassandra_set_cql_version_args', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_set_cql_version_args'); - if ($this->version !== null) { - $xfer += $output->writeFieldBegin('version', TType::STRING, 1); - $xfer += $output->writeString($this->version); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Cassandra_set_cql_version_args', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->version === null) { + throw new TProtocolException('Required field Cassandra_set_cql_version_args.version is unset!'); + } + } + + private function _validateForWrite() { + if ($this->version === null) { + throw new TProtocolException('Required field Cassandra_set_cql_version_args.version is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class Cassandra_set_cql_version_result { +class Cassandra_set_cql_version_result extends TBase { static $_TSPEC; /** - * @var \cassandra\InvalidRequestException + * @var InvalidRequestException */ public $ire = null; @@ -14027,9 +8647,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['ire'])) { - $this->ire = $vals['ire']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -14039,48 +8657,11 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->ire = new \cassandra\InvalidRequestException(); - $xfer += $this->ire->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Cassandra_set_cql_version_result', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Cassandra_set_cql_version_result'); - if ($this->ire !== null) { - $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); - $xfer += $this->ire->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Cassandra_set_cql_version_result', self::$_TSPEC, $output); } } diff --git a/src/cassandra/Types.php b/src/cassandra/Types.php index 0c1f01b..8a53e0e 100644 --- a/src/cassandra/Types.php +++ b/src/cassandra/Types.php @@ -144,7 +144,7 @@ final class CqlResultType { * @param timestamp. The timestamp is used for conflict detection/resolution when two columns with same name need to be compared. * @param ttl. An optional, positive delay (in seconds) after which the column will be automatically deleted. */ -class Column { +class Column extends TBase { static $_TSPEC; /** @@ -186,18 +186,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['name'])) { - $this->name = $vals['name']; - } - if (isset($vals['value'])) { - $this->value = $vals['value']; - } - if (isset($vals['timestamp'])) { - $this->timestamp = $vals['timestamp']; - } - if (isset($vals['ttl'])) { - $this->ttl = $vals['ttl']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -207,83 +196,26 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->value); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::I64) { - $xfer += $input->readI64($this->timestamp); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->ttl); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('Column', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Column'); - if ($this->name !== null) { - $xfer += $output->writeFieldBegin('name', TType::STRING, 1); - $xfer += $output->writeString($this->name); - $xfer += $output->writeFieldEnd(); - } - if ($this->value !== null) { - $xfer += $output->writeFieldBegin('value', TType::STRING, 2); - $xfer += $output->writeString($this->value); - $xfer += $output->writeFieldEnd(); - } - if ($this->timestamp !== null) { - $xfer += $output->writeFieldBegin('timestamp', TType::I64, 3); - $xfer += $output->writeI64($this->timestamp); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('Column', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->name === null) { + throw new TProtocolException('Required field Column.name is unset!'); } - if ($this->ttl !== null) { - $xfer += $output->writeFieldBegin('ttl', TType::I32, 4); - $xfer += $output->writeI32($this->ttl); - $xfer += $output->writeFieldEnd(); + } + + private function _validateForWrite() { + if ($this->name === null) { + throw new TProtocolException('Required field Column.name is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } @@ -294,7 +226,7 @@ public function write($output) { * @param columns. A collection of standard Columns. The columns within a super column are defined in an adhoc manner. * Columns within a super column do not have to have matching structures (similarly named child columns). */ -class SuperColumn { +class SuperColumn extends TBase { static $_TSPEC; /** @@ -325,12 +257,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['name'])) { - $this->name = $vals['name']; - } - if (isset($vals['columns'])) { - $this->columns = $vals['columns']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -340,87 +267,37 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::LST) { - $this->columns = array(); - $_size0 = 0; - $_etype3 = 0; - $xfer += $input->readListBegin($_etype3, $_size0); - for ($_i4 = 0; $_i4 < $_size0; ++$_i4) - { - $elem5 = null; - $elem5 = new \cassandra\Column(); - $xfer += $elem5->read($input); - $this->columns []= $elem5; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('SuperColumn', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('SuperColumn'); - if ($this->name !== null) { - $xfer += $output->writeFieldBegin('name', TType::STRING, 1); - $xfer += $output->writeString($this->name); - $xfer += $output->writeFieldEnd(); - } - if ($this->columns !== null) { - if (!is_array($this->columns)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('columns', TType::LST, 2); - { - $output->writeListBegin(TType::STRUCT, count($this->columns)); - { - foreach ($this->columns as $iter6) - { - $xfer += $iter6->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('SuperColumn', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->name === null) { + throw new TProtocolException('Required field SuperColumn.name is unset!'); + } + if ($this->columns === null) { + throw new TProtocolException('Required field SuperColumn.columns is unset!'); + } + } + + private function _validateForWrite() { + if ($this->name === null) { + throw new TProtocolException('Required field SuperColumn.name is unset!'); + } + if ($this->columns === null) { + throw new TProtocolException('Required field SuperColumn.columns is unset!'); + } } } -class CounterColumn { +class CounterColumn extends TBase { static $_TSPEC; /** @@ -446,12 +323,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['name'])) { - $this->name = $vals['name']; - } - if (isset($vals['value'])) { - $this->value = $vals['value']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -461,64 +333,37 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::I64) { - $xfer += $input->readI64($this->value); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('CounterColumn', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('CounterColumn'); - if ($this->name !== null) { - $xfer += $output->writeFieldBegin('name', TType::STRING, 1); - $xfer += $output->writeString($this->name); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('CounterColumn', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->name === null) { + throw new TProtocolException('Required field CounterColumn.name is unset!'); + } + if ($this->value === null) { + throw new TProtocolException('Required field CounterColumn.value is unset!'); + } + } + + private function _validateForWrite() { + if ($this->name === null) { + throw new TProtocolException('Required field CounterColumn.name is unset!'); } - if ($this->value !== null) { - $xfer += $output->writeFieldBegin('value', TType::I64, 2); - $xfer += $output->writeI64($this->value); - $xfer += $output->writeFieldEnd(); + if ($this->value === null) { + throw new TProtocolException('Required field CounterColumn.value is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class CounterSuperColumn { +class CounterSuperColumn extends TBase { static $_TSPEC; /** @@ -549,12 +394,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['name'])) { - $this->name = $vals['name']; - } - if (isset($vals['columns'])) { - $this->columns = $vals['columns']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -564,82 +404,32 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::LST) { - $this->columns = array(); - $_size7 = 0; - $_etype10 = 0; - $xfer += $input->readListBegin($_etype10, $_size7); - for ($_i11 = 0; $_i11 < $_size7; ++$_i11) - { - $elem12 = null; - $elem12 = new \cassandra\CounterColumn(); - $xfer += $elem12->read($input); - $this->columns []= $elem12; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('CounterSuperColumn', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('CounterSuperColumn'); - if ($this->name !== null) { - $xfer += $output->writeFieldBegin('name', TType::STRING, 1); - $xfer += $output->writeString($this->name); - $xfer += $output->writeFieldEnd(); - } - if ($this->columns !== null) { - if (!is_array($this->columns)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('columns', TType::LST, 2); - { - $output->writeListBegin(TType::STRUCT, count($this->columns)); - { - foreach ($this->columns as $iter13) - { - $xfer += $iter13->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('CounterSuperColumn', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->name === null) { + throw new TProtocolException('Required field CounterSuperColumn.name is unset!'); + } + if ($this->columns === null) { + throw new TProtocolException('Required field CounterSuperColumn.columns is unset!'); + } + } + + private function _validateForWrite() { + if ($this->name === null) { + throw new TProtocolException('Required field CounterSuperColumn.name is unset!'); + } + if ($this->columns === null) { + throw new TProtocolException('Required field CounterSuperColumn.columns is unset!'); + } } } @@ -659,7 +449,7 @@ public function write($output) { * @param counter_column. The Counterolumn returned by get() or get_slice(). * @param counter_super_column. The CounterSuperColumn returned by get() or get_slice(). */ -class ColumnOrSuperColumn { +class ColumnOrSuperColumn extends TBase { static $_TSPEC; /** @@ -705,18 +495,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['column'])) { - $this->column = $vals['column']; - } - if (isset($vals['super_column'])) { - $this->super_column = $vals['super_column']; - } - if (isset($vals['counter_column'])) { - $this->counter_column = $vals['counter_column']; - } - if (isset($vals['counter_super_column'])) { - $this->counter_super_column = $vals['counter_super_column']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -726,99 +505,11 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->column = new \cassandra\Column(); - $xfer += $this->column->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->super_column = new \cassandra\SuperColumn(); - $xfer += $this->super_column->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->counter_column = new \cassandra\CounterColumn(); - $xfer += $this->counter_column->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRUCT) { - $this->counter_super_column = new \cassandra\CounterSuperColumn(); - $xfer += $this->counter_super_column->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('ColumnOrSuperColumn', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('ColumnOrSuperColumn'); - if ($this->column !== null) { - if (!is_object($this->column)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column', TType::STRUCT, 1); - $xfer += $this->column->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->super_column !== null) { - if (!is_object($this->super_column)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('super_column', TType::STRUCT, 2); - $xfer += $this->super_column->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->counter_column !== null) { - if (!is_object($this->counter_column)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('counter_column', TType::STRUCT, 3); - $xfer += $this->counter_column->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->counter_super_column !== null) { - if (!is_object($this->counter_super_column)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('counter_super_column', TType::STRUCT, 4); - $xfer += $this->counter_super_column->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('ColumnOrSuperColumn', self::$_TSPEC, $output); } } @@ -843,35 +534,11 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('NotFoundException', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('NotFoundException'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('NotFoundException', self::$_TSPEC, $output); } } @@ -898,9 +565,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['why'])) { - $this->why = $vals['why']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -910,47 +575,26 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->why); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('InvalidRequestException', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('InvalidRequestException'); - if ($this->why !== null) { - $xfer += $output->writeFieldBegin('why', TType::STRING, 1); - $xfer += $output->writeString($this->why); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('InvalidRequestException', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->why === null) { + throw new TProtocolException('Required field InvalidRequestException.why is unset!'); + } + } + + private function _validateForWrite() { + if ($this->why === null) { + throw new TProtocolException('Required field InvalidRequestException.why is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } @@ -975,35 +619,11 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('UnavailableException', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('UnavailableException'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('UnavailableException', self::$_TSPEC, $output); } } @@ -1056,15 +676,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['acknowledged_by'])) { - $this->acknowledged_by = $vals['acknowledged_by']; - } - if (isset($vals['acknowledged_by_batchlog'])) { - $this->acknowledged_by_batchlog = $vals['acknowledged_by_batchlog']; - } - if (isset($vals['paxos_in_progress'])) { - $this->paxos_in_progress = $vals['paxos_in_progress']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -1074,71 +686,11 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->acknowledged_by); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::BOOL) { - $xfer += $input->readBool($this->acknowledged_by_batchlog); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::BOOL) { - $xfer += $input->readBool($this->paxos_in_progress); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('TimedOutException', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('TimedOutException'); - if ($this->acknowledged_by !== null) { - $xfer += $output->writeFieldBegin('acknowledged_by', TType::I32, 1); - $xfer += $output->writeI32($this->acknowledged_by); - $xfer += $output->writeFieldEnd(); - } - if ($this->acknowledged_by_batchlog !== null) { - $xfer += $output->writeFieldBegin('acknowledged_by_batchlog', TType::BOOL, 2); - $xfer += $output->writeBool($this->acknowledged_by_batchlog); - $xfer += $output->writeFieldEnd(); - } - if ($this->paxos_in_progress !== null) { - $xfer += $output->writeFieldBegin('paxos_in_progress', TType::BOOL, 3); - $xfer += $output->writeBool($this->paxos_in_progress); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('TimedOutException', self::$_TSPEC, $output); } } @@ -1164,9 +716,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['why'])) { - $this->why = $vals['why']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -1176,47 +726,26 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->why); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('AuthenticationException', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('AuthenticationException'); - if ($this->why !== null) { - $xfer += $output->writeFieldBegin('why', TType::STRING, 1); - $xfer += $output->writeString($this->why); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('AuthenticationException', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->why === null) { + throw new TProtocolException('Required field AuthenticationException.why is unset!'); + } + } + + private function _validateForWrite() { + if ($this->why === null) { + throw new TProtocolException('Required field AuthenticationException.why is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } @@ -1242,9 +771,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['why'])) { - $this->why = $vals['why']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -1254,47 +781,26 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->why); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('AuthorizationException', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('AuthorizationException'); - if ($this->why !== null) { - $xfer += $output->writeFieldBegin('why', TType::STRING, 1); - $xfer += $output->writeString($this->why); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('AuthorizationException', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->why === null) { + throw new TProtocolException('Required field AuthorizationException.why is unset!'); + } + } + + private function _validateForWrite() { + if ($this->why === null) { + throw new TProtocolException('Required field AuthorizationException.why is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } @@ -1322,35 +828,11 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('SchemaDisagreementException', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('SchemaDisagreementException'); - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('SchemaDisagreementException', self::$_TSPEC, $output); } } @@ -1361,7 +843,7 @@ public function write($output) { * * See also ColumnPath */ -class ColumnParent { +class ColumnParent extends TBase { static $_TSPEC; /** @@ -1387,12 +869,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['column_family'])) { - $this->column_family = $vals['column_family']; - } - if (isset($vals['super_column'])) { - $this->super_column = $vals['super_column']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -1402,59 +879,26 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 3: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->column_family); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->super_column); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('ColumnParent', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('ColumnParent'); - if ($this->column_family !== null) { - $xfer += $output->writeFieldBegin('column_family', TType::STRING, 3); - $xfer += $output->writeString($this->column_family); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('ColumnParent', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->column_family === null) { + throw new TProtocolException('Required field ColumnParent.column_family is unset!'); } - if ($this->super_column !== null) { - $xfer += $output->writeFieldBegin('super_column', TType::STRING, 4); - $xfer += $output->writeString($this->super_column); - $xfer += $output->writeFieldEnd(); + } + + private function _validateForWrite() { + if ($this->column_family === null) { + throw new TProtocolException('Required field ColumnParent.column_family is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } @@ -1469,7 +913,7 @@ public function write($output) { * @param super_column. The super column name. * @param column. The column name. */ -class ColumnPath { +class ColumnPath extends TBase { static $_TSPEC; /** @@ -1503,15 +947,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['column_family'])) { - $this->column_family = $vals['column_family']; - } - if (isset($vals['super_column'])) { - $this->super_column = $vals['super_column']; - } - if (isset($vals['column'])) { - $this->column = $vals['column']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -1521,71 +957,26 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 3: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->column_family); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->super_column); - } else { - $xfer += $input->skip($ftype); - } - break; - case 5: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->column); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('ColumnPath', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('ColumnPath'); - if ($this->column_family !== null) { - $xfer += $output->writeFieldBegin('column_family', TType::STRING, 3); - $xfer += $output->writeString($this->column_family); - $xfer += $output->writeFieldEnd(); - } - if ($this->super_column !== null) { - $xfer += $output->writeFieldBegin('super_column', TType::STRING, 4); - $xfer += $output->writeString($this->super_column); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('ColumnPath', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->column_family === null) { + throw new TProtocolException('Required field ColumnPath.column_family is unset!'); } - if ($this->column !== null) { - $xfer += $output->writeFieldBegin('column', TType::STRING, 5); - $xfer += $output->writeString($this->column); - $xfer += $output->writeFieldEnd(); + } + + private function _validateForWrite() { + if ($this->column_family === null) { + throw new TProtocolException('Required field ColumnPath.column_family is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } @@ -1606,7 +997,7 @@ public function write($output) { * be better served by iterating through slices by passing the last value of one call in as the 'start' * of the next instead of increasing 'count' arbitrarily large. */ -class SliceRange { +class SliceRange extends TBase { static $_TSPEC; /** @@ -1648,18 +1039,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['start'])) { - $this->start = $vals['start']; - } - if (isset($vals['finish'])) { - $this->finish = $vals['finish']; - } - if (isset($vals['reversed'])) { - $this->reversed = $vals['reversed']; - } - if (isset($vals['count'])) { - $this->count = $vals['count']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -1669,83 +1049,44 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->start); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->finish); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::BOOL) { - $xfer += $input->readBool($this->reversed); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->count); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('SliceRange', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('SliceRange'); - if ($this->start !== null) { - $xfer += $output->writeFieldBegin('start', TType::STRING, 1); - $xfer += $output->writeString($this->start); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('SliceRange', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->start === null) { + throw new TProtocolException('Required field SliceRange.start is unset!'); } - if ($this->finish !== null) { - $xfer += $output->writeFieldBegin('finish', TType::STRING, 2); - $xfer += $output->writeString($this->finish); - $xfer += $output->writeFieldEnd(); + if ($this->finish === null) { + throw new TProtocolException('Required field SliceRange.finish is unset!'); } - if ($this->reversed !== null) { - $xfer += $output->writeFieldBegin('reversed', TType::BOOL, 3); - $xfer += $output->writeBool($this->reversed); - $xfer += $output->writeFieldEnd(); + if ($this->reversed === null) { + throw new TProtocolException('Required field SliceRange.reversed is unset!'); } - if ($this->count !== null) { - $xfer += $output->writeFieldBegin('count', TType::I32, 4); - $xfer += $output->writeI32($this->count); - $xfer += $output->writeFieldEnd(); + if ($this->count === null) { + throw new TProtocolException('Required field SliceRange.count is unset!'); + } + } + + private function _validateForWrite() { + if ($this->start === null) { + throw new TProtocolException('Required field SliceRange.start is unset!'); + } + if ($this->finish === null) { + throw new TProtocolException('Required field SliceRange.finish is unset!'); + } + if ($this->reversed === null) { + throw new TProtocolException('Required field SliceRange.reversed is unset!'); + } + if ($this->count === null) { + throw new TProtocolException('Required field SliceRange.count is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } @@ -1762,7 +1103,7 @@ public function write($output) { * and 'Jim' you can pass those column names as a list to fetch all three at once. * @param slice_range. A SliceRange describing how to range, order, and/or limit the slice. */ -class SlicePredicate { +class SlicePredicate extends TBase { static $_TSPEC; /** @@ -1793,12 +1134,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['column_names'])) { - $this->column_names = $vals['column_names']; - } - if (isset($vals['slice_range'])) { - $this->slice_range = $vals['slice_range']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -1808,90 +1144,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::LST) { - $this->column_names = array(); - $_size14 = 0; - $_etype17 = 0; - $xfer += $input->readListBegin($_etype17, $_size14); - for ($_i18 = 0; $_i18 < $_size14; ++$_i18) - { - $elem19 = null; - $xfer += $input->readString($elem19); - $this->column_names []= $elem19; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->slice_range = new \cassandra\SliceRange(); - $xfer += $this->slice_range->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('SlicePredicate', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('SlicePredicate'); - if ($this->column_names !== null) { - if (!is_array($this->column_names)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_names', TType::LST, 1); - { - $output->writeListBegin(TType::STRING, count($this->column_names)); - { - foreach ($this->column_names as $iter20) - { - $xfer += $output->writeString($iter20); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->slice_range !== null) { - if (!is_object($this->slice_range)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('slice_range', TType::STRUCT, 2); - $xfer += $this->slice_range->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('SlicePredicate', self::$_TSPEC, $output); } } -class IndexExpression { +class IndexExpression extends TBase { static $_TSPEC; /** @@ -1925,15 +1187,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['column_name'])) { - $this->column_name = $vals['column_name']; - } - if (isset($vals['op'])) { - $this->op = $vals['op']; - } - if (isset($vals['value'])) { - $this->value = $vals['value']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -1943,71 +1197,38 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->column_name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->op); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->value); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('IndexExpression', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('IndexExpression'); - if ($this->column_name !== null) { - $xfer += $output->writeFieldBegin('column_name', TType::STRING, 1); - $xfer += $output->writeString($this->column_name); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('IndexExpression', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->column_name === null) { + throw new TProtocolException('Required field IndexExpression.column_name is unset!'); + } + if ($this->op === null) { + throw new TProtocolException('Required field IndexExpression.op is unset!'); + } + if ($this->value === null) { + throw new TProtocolException('Required field IndexExpression.value is unset!'); + } + } + + private function _validateForWrite() { + if ($this->column_name === null) { + throw new TProtocolException('Required field IndexExpression.column_name is unset!'); } - if ($this->op !== null) { - $xfer += $output->writeFieldBegin('op', TType::I32, 2); - $xfer += $output->writeI32($this->op); - $xfer += $output->writeFieldEnd(); + if ($this->op === null) { + throw new TProtocolException('Required field IndexExpression.op is unset!'); } - if ($this->value !== null) { - $xfer += $output->writeFieldBegin('value', TType::STRING, 3); - $xfer += $output->writeString($this->value); - $xfer += $output->writeFieldEnd(); + if ($this->value === null) { + throw new TProtocolException('Required field IndexExpression.value is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } @@ -2015,7 +1236,7 @@ public function write($output) { /** * @deprecated use a KeyRange with row_filter in get_range_slices instead */ -class IndexClause { +class IndexClause extends TBase { static $_TSPEC; /** @@ -2054,15 +1275,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['expressions'])) { - $this->expressions = $vals['expressions']; - } - if (isset($vals['start_key'])) { - $this->start_key = $vals['start_key']; - } - if (isset($vals['count'])) { - $this->count = $vals['count']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -2072,94 +1285,38 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::LST) { - $this->expressions = array(); - $_size21 = 0; - $_etype24 = 0; - $xfer += $input->readListBegin($_etype24, $_size21); - for ($_i25 = 0; $_i25 < $_size21; ++$_i25) - { - $elem26 = null; - $elem26 = new \cassandra\IndexExpression(); - $xfer += $elem26->read($input); - $this->expressions []= $elem26; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->start_key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->count); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('IndexClause', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('IndexClause'); - if ($this->expressions !== null) { - if (!is_array($this->expressions)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('expressions', TType::LST, 1); - { - $output->writeListBegin(TType::STRUCT, count($this->expressions)); - { - foreach ($this->expressions as $iter27) - { - $xfer += $iter27->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->start_key !== null) { - $xfer += $output->writeFieldBegin('start_key', TType::STRING, 2); - $xfer += $output->writeString($this->start_key); - $xfer += $output->writeFieldEnd(); - } - if ($this->count !== null) { - $xfer += $output->writeFieldBegin('count', TType::I32, 3); - $xfer += $output->writeI32($this->count); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('IndexClause', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->expressions === null) { + throw new TProtocolException('Required field IndexClause.expressions is unset!'); + } + if ($this->start_key === null) { + throw new TProtocolException('Required field IndexClause.start_key is unset!'); + } + if ($this->count === null) { + throw new TProtocolException('Required field IndexClause.count is unset!'); + } + } + + private function _validateForWrite() { + if ($this->expressions === null) { + throw new TProtocolException('Required field IndexClause.expressions is unset!'); + } + if ($this->start_key === null) { + throw new TProtocolException('Required field IndexClause.start_key is unset!'); + } + if ($this->count === null) { + throw new TProtocolException('Required field IndexClause.count is unset!'); + } } } @@ -2172,7 +1329,7 @@ public function write($output) { * one-element range, but a range from tokenY to tokenY is the * full ring. */ -class KeyRange { +class KeyRange extends TBase { static $_TSPEC; /** @@ -2235,24 +1392,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['start_key'])) { - $this->start_key = $vals['start_key']; - } - if (isset($vals['end_key'])) { - $this->end_key = $vals['end_key']; - } - if (isset($vals['start_token'])) { - $this->start_token = $vals['start_token']; - } - if (isset($vals['end_token'])) { - $this->end_token = $vals['end_token']; - } - if (isset($vals['row_filter'])) { - $this->row_filter = $vals['row_filter']; - } - if (isset($vals['count'])) { - $this->count = $vals['count']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -2262,130 +1402,26 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->start_key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->end_key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->start_token); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->end_token); - } else { - $xfer += $input->skip($ftype); - } - break; - case 6: - if ($ftype == TType::LST) { - $this->row_filter = array(); - $_size28 = 0; - $_etype31 = 0; - $xfer += $input->readListBegin($_etype31, $_size28); - for ($_i32 = 0; $_i32 < $_size28; ++$_i32) - { - $elem33 = null; - $elem33 = new \cassandra\IndexExpression(); - $xfer += $elem33->read($input); - $this->row_filter []= $elem33; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 5: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->count); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('KeyRange', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('KeyRange'); - if ($this->start_key !== null) { - $xfer += $output->writeFieldBegin('start_key', TType::STRING, 1); - $xfer += $output->writeString($this->start_key); - $xfer += $output->writeFieldEnd(); - } - if ($this->end_key !== null) { - $xfer += $output->writeFieldBegin('end_key', TType::STRING, 2); - $xfer += $output->writeString($this->end_key); - $xfer += $output->writeFieldEnd(); - } - if ($this->start_token !== null) { - $xfer += $output->writeFieldBegin('start_token', TType::STRING, 3); - $xfer += $output->writeString($this->start_token); - $xfer += $output->writeFieldEnd(); - } - if ($this->end_token !== null) { - $xfer += $output->writeFieldBegin('end_token', TType::STRING, 4); - $xfer += $output->writeString($this->end_token); - $xfer += $output->writeFieldEnd(); - } - if ($this->count !== null) { - $xfer += $output->writeFieldBegin('count', TType::I32, 5); - $xfer += $output->writeI32($this->count); - $xfer += $output->writeFieldEnd(); - } - if ($this->row_filter !== null) { - if (!is_array($this->row_filter)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('row_filter', TType::LST, 6); - { - $output->writeListBegin(TType::STRUCT, count($this->row_filter)); - { - foreach ($this->row_filter as $iter34) - { - $xfer += $iter34->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('KeyRange', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->count === null) { + throw new TProtocolException('Required field KeyRange.count is unset!'); + } + } + + private function _validateForWrite() { + if ($this->count === null) { + throw new TProtocolException('Required field KeyRange.count is unset!'); + } } } @@ -2397,7 +1433,7 @@ public function write($output) { * @param columns. List of data represented by the key. Typically, the list is pared down to only the columns specified by * a SlicePredicate. */ -class KeySlice { +class KeySlice extends TBase { static $_TSPEC; /** @@ -2428,12 +1464,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['columns'])) { - $this->columns = $vals['columns']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -2443,87 +1474,37 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::LST) { - $this->columns = array(); - $_size35 = 0; - $_etype38 = 0; - $xfer += $input->readListBegin($_etype38, $_size35); - for ($_i39 = 0; $_i39 < $_size35; ++$_i39) - { - $elem40 = null; - $elem40 = new \cassandra\ColumnOrSuperColumn(); - $xfer += $elem40->read($input); - $this->columns []= $elem40; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('KeySlice', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('KeySlice'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->columns !== null) { - if (!is_array($this->columns)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('columns', TType::LST, 2); - { - $output->writeListBegin(TType::STRUCT, count($this->columns)); - { - foreach ($this->columns as $iter41) - { - $xfer += $iter41->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('KeySlice', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field KeySlice.key is unset!'); + } + if ($this->columns === null) { + throw new TProtocolException('Required field KeySlice.columns is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field KeySlice.key is unset!'); + } + if ($this->columns === null) { + throw new TProtocolException('Required field KeySlice.columns is unset!'); + } } } -class KeyCount { +class KeyCount extends TBase { static $_TSPEC; /** @@ -2549,12 +1530,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['count'])) { - $this->count = $vals['count']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -2564,59 +1540,32 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->count); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('KeyCount', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('KeyCount'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('KeyCount', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field KeyCount.key is unset!'); + } + if ($this->count === null) { + throw new TProtocolException('Required field KeyCount.count is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field KeyCount.key is unset!'); } - if ($this->count !== null) { - $xfer += $output->writeFieldBegin('count', TType::I32, 2); - $xfer += $output->writeI32($this->count); - $xfer += $output->writeFieldEnd(); + if ($this->count === null) { + throw new TProtocolException('Required field KeyCount.count is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } @@ -2624,7 +1573,7 @@ public function write($output) { /** * Note that the timestamp is only optional in case of counter deletion. */ -class Deletion { +class Deletion extends TBase { static $_TSPEC; /** @@ -2659,15 +1608,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['timestamp'])) { - $this->timestamp = $vals['timestamp']; - } - if (isset($vals['super_column'])) { - $this->super_column = $vals['super_column']; - } - if (isset($vals['predicate'])) { - $this->predicate = $vals['predicate']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -2677,75 +1618,11 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::I64) { - $xfer += $input->readI64($this->timestamp); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->super_column); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRUCT) { - $this->predicate = new \cassandra\SlicePredicate(); - $xfer += $this->predicate->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Deletion', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Deletion'); - if ($this->timestamp !== null) { - $xfer += $output->writeFieldBegin('timestamp', TType::I64, 1); - $xfer += $output->writeI64($this->timestamp); - $xfer += $output->writeFieldEnd(); - } - if ($this->super_column !== null) { - $xfer += $output->writeFieldBegin('super_column', TType::STRING, 2); - $xfer += $output->writeString($this->super_column); - $xfer += $output->writeFieldEnd(); - } - if ($this->predicate !== null) { - if (!is_object($this->predicate)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('predicate', TType::STRUCT, 3); - $xfer += $this->predicate->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Deletion', self::$_TSPEC, $output); } } @@ -2755,7 +1632,7 @@ public function write($output) { * @param column_or_supercolumn. An insert to a column or supercolumn (possibly counter column or supercolumn) * @param deletion. A deletion of a column or supercolumn */ -class Mutation { +class Mutation extends TBase { static $_TSPEC; /** @@ -2783,12 +1660,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['column_or_supercolumn'])) { - $this->column_or_supercolumn = $vals['column_or_supercolumn']; - } - if (isset($vals['deletion'])) { - $this->deletion = $vals['deletion']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -2798,72 +1670,16 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRUCT) { - $this->column_or_supercolumn = new \cassandra\ColumnOrSuperColumn(); - $xfer += $this->column_or_supercolumn->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->deletion = new \cassandra\Deletion(); - $xfer += $this->deletion->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('Mutation', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('Mutation'); - if ($this->column_or_supercolumn !== null) { - if (!is_object($this->column_or_supercolumn)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_or_supercolumn', TType::STRUCT, 1); - $xfer += $this->column_or_supercolumn->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->deletion !== null) { - if (!is_object($this->deletion)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('deletion', TType::STRUCT, 2); - $xfer += $this->deletion->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('Mutation', self::$_TSPEC, $output); } } -class EndpointDetails { +class EndpointDetails extends TBase { static $_TSPEC; /** @@ -2897,15 +1713,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['host'])) { - $this->host = $vals['host']; - } - if (isset($vals['datacenter'])) { - $this->datacenter = $vals['datacenter']; - } - if (isset($vals['rack'])) { - $this->rack = $vals['rack']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -2915,76 +1723,26 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->host); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->datacenter); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->rack); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('EndpointDetails', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('EndpointDetails'); - if ($this->host !== null) { - $xfer += $output->writeFieldBegin('host', TType::STRING, 1); - $xfer += $output->writeString($this->host); - $xfer += $output->writeFieldEnd(); - } - if ($this->datacenter !== null) { - $xfer += $output->writeFieldBegin('datacenter', TType::STRING, 2); - $xfer += $output->writeString($this->datacenter); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('EndpointDetails', self::$_TSPEC, $output); + } + + private function _validateForWrite() { + if ($this->host === null) { + throw new TProtocolException('Required field EndpointDetails.host is unset!'); } - if ($this->rack !== null) { - $xfer += $output->writeFieldBegin('rack', TType::STRING, 3); - $xfer += $output->writeString($this->rack); - $xfer += $output->writeFieldEnd(); + if ($this->datacenter === null) { + throw new TProtocolException('Required field EndpointDetails.datacenter is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } -class CASResult { +class CASResult extends TBase { static $_TSPEC; /** @@ -3015,12 +1773,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } - if (isset($vals['current_values'])) { - $this->current_values = $vals['current_values']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3030,82 +1783,26 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::BOOL) { - $xfer += $input->readBool($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::LST) { - $this->current_values = array(); - $_size42 = 0; - $_etype45 = 0; - $xfer += $input->readListBegin($_etype45, $_size42); - for ($_i46 = 0; $_i46 < $_size42; ++$_i46) - { - $elem47 = null; - $elem47 = new \cassandra\Column(); - $xfer += $elem47->read($input); - $this->current_values []= $elem47; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('CASResult', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('CASResult'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::BOOL, 1); - $xfer += $output->writeBool($this->success); - $xfer += $output->writeFieldEnd(); - } - if ($this->current_values !== null) { - if (!is_array($this->current_values)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('current_values', TType::LST, 2); - { - $output->writeListBegin(TType::STRUCT, count($this->current_values)); - { - foreach ($this->current_values as $iter48) - { - $xfer += $iter48->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('CASResult', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->success === null) { + throw new TProtocolException('Required field CASResult.success is unset!'); + } + } + + private function _validateForWrite() { + if ($this->success === null) { + throw new TProtocolException('Required field CASResult.success is unset!'); + } } } @@ -3118,7 +1815,7 @@ public function write($output) { * @param endpoints The endpoints responsible for the range (listed by their configured listen_address) * @param rpc_endpoints The endpoints responsible for the range (listed by their configured rpc_address) */ -class TokenRange { +class TokenRange extends TBase { static $_TSPEC; /** @@ -3181,21 +1878,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['start_token'])) { - $this->start_token = $vals['start_token']; - } - if (isset($vals['end_token'])) { - $this->end_token = $vals['end_token']; - } - if (isset($vals['endpoints'])) { - $this->endpoints = $vals['endpoints']; - } - if (isset($vals['rpc_endpoints'])) { - $this->rpc_endpoints = $vals['rpc_endpoints']; - } - if (isset($vals['endpoint_details'])) { - $this->endpoint_details = $vals['endpoint_details']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3205,162 +1888,38 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->start_token); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->end_token); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::LST) { - $this->endpoints = array(); - $_size49 = 0; - $_etype52 = 0; - $xfer += $input->readListBegin($_etype52, $_size49); - for ($_i53 = 0; $_i53 < $_size49; ++$_i53) - { - $elem54 = null; - $xfer += $input->readString($elem54); - $this->endpoints []= $elem54; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::LST) { - $this->rpc_endpoints = array(); - $_size55 = 0; - $_etype58 = 0; - $xfer += $input->readListBegin($_etype58, $_size55); - for ($_i59 = 0; $_i59 < $_size55; ++$_i59) - { - $elem60 = null; - $xfer += $input->readString($elem60); - $this->rpc_endpoints []= $elem60; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 5: - if ($ftype == TType::LST) { - $this->endpoint_details = array(); - $_size61 = 0; - $_etype64 = 0; - $xfer += $input->readListBegin($_etype64, $_size61); - for ($_i65 = 0; $_i65 < $_size61; ++$_i65) - { - $elem66 = null; - $elem66 = new \cassandra\EndpointDetails(); - $xfer += $elem66->read($input); - $this->endpoint_details []= $elem66; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('TokenRange', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('TokenRange'); - if ($this->start_token !== null) { - $xfer += $output->writeFieldBegin('start_token', TType::STRING, 1); - $xfer += $output->writeString($this->start_token); - $xfer += $output->writeFieldEnd(); - } - if ($this->end_token !== null) { - $xfer += $output->writeFieldBegin('end_token', TType::STRING, 2); - $xfer += $output->writeString($this->end_token); - $xfer += $output->writeFieldEnd(); - } - if ($this->endpoints !== null) { - if (!is_array($this->endpoints)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('endpoints', TType::LST, 3); - { - $output->writeListBegin(TType::STRING, count($this->endpoints)); - { - foreach ($this->endpoints as $iter67) - { - $xfer += $output->writeString($iter67); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->rpc_endpoints !== null) { - if (!is_array($this->rpc_endpoints)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('rpc_endpoints', TType::LST, 4); - { - $output->writeListBegin(TType::STRING, count($this->rpc_endpoints)); - { - foreach ($this->rpc_endpoints as $iter68) - { - $xfer += $output->writeString($iter68); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->endpoint_details !== null) { - if (!is_array($this->endpoint_details)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('endpoint_details', TType::LST, 5); - { - $output->writeListBegin(TType::STRUCT, count($this->endpoint_details)); - { - foreach ($this->endpoint_details as $iter69) - { - $xfer += $iter69->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('TokenRange', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->start_token === null) { + throw new TProtocolException('Required field TokenRange.start_token is unset!'); + } + if ($this->end_token === null) { + throw new TProtocolException('Required field TokenRange.end_token is unset!'); + } + if ($this->endpoints === null) { + throw new TProtocolException('Required field TokenRange.endpoints is unset!'); + } + } + + private function _validateForWrite() { + if ($this->start_token === null) { + throw new TProtocolException('Required field TokenRange.start_token is unset!'); + } + if ($this->end_token === null) { + throw new TProtocolException('Required field TokenRange.end_token is unset!'); + } + if ($this->endpoints === null) { + throw new TProtocolException('Required field TokenRange.endpoints is unset!'); + } } } @@ -3368,7 +1927,7 @@ public function write($output) { /** * Authentication requests can contain any data, dependent on the IAuthenticator used */ -class AuthenticationRequest { +class AuthenticationRequest extends TBase { static $_TSPEC; /** @@ -3394,9 +1953,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['credentials'])) { - $this->credentials = $vals['credentials']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3406,78 +1963,31 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::MAP) { - $this->credentials = array(); - $_size70 = 0; - $_ktype71 = 0; - $_vtype72 = 0; - $xfer += $input->readMapBegin($_ktype71, $_vtype72, $_size70); - for ($_i74 = 0; $_i74 < $_size70; ++$_i74) - { - $key75 = ''; - $val76 = ''; - $xfer += $input->readString($key75); - $xfer += $input->readString($val76); - $this->credentials[$key75] = $val76; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('AuthenticationRequest', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('AuthenticationRequest'); - if ($this->credentials !== null) { - if (!is_array($this->credentials)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('credentials', TType::MAP, 1); - { - $output->writeMapBegin(TType::STRING, TType::STRING, count($this->credentials)); - { - foreach ($this->credentials as $kiter77 => $viter78) - { - $xfer += $output->writeString($kiter77); - $xfer += $output->writeString($viter78); - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('AuthenticationRequest', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->credentials === null) { + throw new TProtocolException('Required field AuthenticationRequest.credentials is unset!'); + } + } + + private function _validateForWrite() { + if ($this->credentials === null) { + throw new TProtocolException('Required field AuthenticationRequest.credentials is unset!'); + } } } -class ColumnDef { +class ColumnDef extends TBase { static $_TSPEC; /** @@ -3535,21 +2045,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['name'])) { - $this->name = $vals['name']; - } - if (isset($vals['validation_class'])) { - $this->validation_class = $vals['validation_class']; - } - if (isset($vals['index_type'])) { - $this->index_type = $vals['index_type']; - } - if (isset($vals['index_name'])) { - $this->index_name = $vals['index_name']; - } - if (isset($vals['index_options'])) { - $this->index_options = $vals['index_options']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3559,121 +2055,32 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->validation_class); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->index_type); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->index_name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 5: - if ($ftype == TType::MAP) { - $this->index_options = array(); - $_size79 = 0; - $_ktype80 = 0; - $_vtype81 = 0; - $xfer += $input->readMapBegin($_ktype80, $_vtype81, $_size79); - for ($_i83 = 0; $_i83 < $_size79; ++$_i83) - { - $key84 = ''; - $val85 = ''; - $xfer += $input->readString($key84); - $xfer += $input->readString($val85); - $this->index_options[$key84] = $val85; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('ColumnDef', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('ColumnDef'); - if ($this->name !== null) { - $xfer += $output->writeFieldBegin('name', TType::STRING, 1); - $xfer += $output->writeString($this->name); - $xfer += $output->writeFieldEnd(); - } - if ($this->validation_class !== null) { - $xfer += $output->writeFieldBegin('validation_class', TType::STRING, 2); - $xfer += $output->writeString($this->validation_class); - $xfer += $output->writeFieldEnd(); - } - if ($this->index_type !== null) { - $xfer += $output->writeFieldBegin('index_type', TType::I32, 3); - $xfer += $output->writeI32($this->index_type); - $xfer += $output->writeFieldEnd(); - } - if ($this->index_name !== null) { - $xfer += $output->writeFieldBegin('index_name', TType::STRING, 4); - $xfer += $output->writeString($this->index_name); - $xfer += $output->writeFieldEnd(); - } - if ($this->index_options !== null) { - if (!is_array($this->index_options)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('index_options', TType::MAP, 5); - { - $output->writeMapBegin(TType::STRING, TType::STRING, count($this->index_options)); - { - foreach ($this->index_options as $kiter86 => $viter87) - { - $xfer += $output->writeString($kiter86); - $xfer += $output->writeString($viter87); - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('ColumnDef', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->name === null) { + throw new TProtocolException('Required field ColumnDef.name is unset!'); + } + if ($this->validation_class === null) { + throw new TProtocolException('Required field ColumnDef.validation_class is unset!'); + } + } + + private function _validateForWrite() { + if ($this->name === null) { + throw new TProtocolException('Required field ColumnDef.name is unset!'); + } + if ($this->validation_class === null) { + throw new TProtocolException('Required field ColumnDef.validation_class is unset!'); + } } } @@ -3683,7 +2090,7 @@ public function write($output) { * `options` should include at least 'class' param. * Other options are not supported yet. */ -class TriggerDef { +class TriggerDef extends TBase { static $_TSPEC; /** @@ -3717,12 +2124,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['name'])) { - $this->name = $vals['name']; - } - if (isset($vals['options'])) { - $this->options = $vals['options']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -3732,90 +2134,37 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::MAP) { - $this->options = array(); - $_size88 = 0; - $_ktype89 = 0; - $_vtype90 = 0; - $xfer += $input->readMapBegin($_ktype89, $_vtype90, $_size88); - for ($_i92 = 0; $_i92 < $_size88; ++$_i92) - { - $key93 = ''; - $val94 = ''; - $xfer += $input->readString($key93); - $xfer += $input->readString($val94); - $this->options[$key93] = $val94; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('TriggerDef', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('TriggerDef'); - if ($this->name !== null) { - $xfer += $output->writeFieldBegin('name', TType::STRING, 1); - $xfer += $output->writeString($this->name); - $xfer += $output->writeFieldEnd(); - } - if ($this->options !== null) { - if (!is_array($this->options)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('options', TType::MAP, 2); - { - $output->writeMapBegin(TType::STRING, TType::STRING, count($this->options)); - { - foreach ($this->options as $kiter95 => $viter96) - { - $xfer += $output->writeString($kiter95); - $xfer += $output->writeString($viter96); - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('TriggerDef', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->name === null) { + throw new TProtocolException('Required field TriggerDef.name is unset!'); + } + if ($this->options === null) { + throw new TProtocolException('Required field TriggerDef.options is unset!'); + } + } + + private function _validateForWrite() { + if ($this->name === null) { + throw new TProtocolException('Required field TriggerDef.name is unset!'); + } + if ($this->options === null) { + throw new TProtocolException('Required field TriggerDef.options is unset!'); + } } } -class CfDef { +class CfDef extends TBase { static $_TSPEC; /** @@ -4205,129 +2554,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['keyspace'])) { - $this->keyspace = $vals['keyspace']; - } - if (isset($vals['name'])) { - $this->name = $vals['name']; - } - if (isset($vals['column_type'])) { - $this->column_type = $vals['column_type']; - } - if (isset($vals['comparator_type'])) { - $this->comparator_type = $vals['comparator_type']; - } - if (isset($vals['subcomparator_type'])) { - $this->subcomparator_type = $vals['subcomparator_type']; - } - if (isset($vals['comment'])) { - $this->comment = $vals['comment']; - } - if (isset($vals['read_repair_chance'])) { - $this->read_repair_chance = $vals['read_repair_chance']; - } - if (isset($vals['column_metadata'])) { - $this->column_metadata = $vals['column_metadata']; - } - if (isset($vals['gc_grace_seconds'])) { - $this->gc_grace_seconds = $vals['gc_grace_seconds']; - } - if (isset($vals['default_validation_class'])) { - $this->default_validation_class = $vals['default_validation_class']; - } - if (isset($vals['id'])) { - $this->id = $vals['id']; - } - if (isset($vals['min_compaction_threshold'])) { - $this->min_compaction_threshold = $vals['min_compaction_threshold']; - } - if (isset($vals['max_compaction_threshold'])) { - $this->max_compaction_threshold = $vals['max_compaction_threshold']; - } - if (isset($vals['key_validation_class'])) { - $this->key_validation_class = $vals['key_validation_class']; - } - if (isset($vals['key_alias'])) { - $this->key_alias = $vals['key_alias']; - } - if (isset($vals['compaction_strategy'])) { - $this->compaction_strategy = $vals['compaction_strategy']; - } - if (isset($vals['compaction_strategy_options'])) { - $this->compaction_strategy_options = $vals['compaction_strategy_options']; - } - if (isset($vals['compression_options'])) { - $this->compression_options = $vals['compression_options']; - } - if (isset($vals['bloom_filter_fp_chance'])) { - $this->bloom_filter_fp_chance = $vals['bloom_filter_fp_chance']; - } - if (isset($vals['caching'])) { - $this->caching = $vals['caching']; - } - if (isset($vals['dclocal_read_repair_chance'])) { - $this->dclocal_read_repair_chance = $vals['dclocal_read_repair_chance']; - } - if (isset($vals['memtable_flush_period_in_ms'])) { - $this->memtable_flush_period_in_ms = $vals['memtable_flush_period_in_ms']; - } - if (isset($vals['default_time_to_live'])) { - $this->default_time_to_live = $vals['default_time_to_live']; - } - if (isset($vals['speculative_retry'])) { - $this->speculative_retry = $vals['speculative_retry']; - } - if (isset($vals['triggers'])) { - $this->triggers = $vals['triggers']; - } - if (isset($vals['cells_per_row_to_cache'])) { - $this->cells_per_row_to_cache = $vals['cells_per_row_to_cache']; - } - if (isset($vals['min_index_interval'])) { - $this->min_index_interval = $vals['min_index_interval']; - } - if (isset($vals['max_index_interval'])) { - $this->max_index_interval = $vals['max_index_interval']; - } - if (isset($vals['row_cache_size'])) { - $this->row_cache_size = $vals['row_cache_size']; - } - if (isset($vals['key_cache_size'])) { - $this->key_cache_size = $vals['key_cache_size']; - } - if (isset($vals['row_cache_save_period_in_seconds'])) { - $this->row_cache_save_period_in_seconds = $vals['row_cache_save_period_in_seconds']; - } - if (isset($vals['key_cache_save_period_in_seconds'])) { - $this->key_cache_save_period_in_seconds = $vals['key_cache_save_period_in_seconds']; - } - if (isset($vals['memtable_flush_after_mins'])) { - $this->memtable_flush_after_mins = $vals['memtable_flush_after_mins']; - } - if (isset($vals['memtable_throughput_in_mb'])) { - $this->memtable_throughput_in_mb = $vals['memtable_throughput_in_mb']; - } - if (isset($vals['memtable_operations_in_millions'])) { - $this->memtable_operations_in_millions = $vals['memtable_operations_in_millions']; - } - if (isset($vals['replicate_on_write'])) { - $this->replicate_on_write = $vals['replicate_on_write']; - } - if (isset($vals['merge_shards_chance'])) { - $this->merge_shards_chance = $vals['merge_shards_chance']; - } - if (isset($vals['row_cache_provider'])) { - $this->row_cache_provider = $vals['row_cache_provider']; - } - if (isset($vals['row_cache_keys_to_save'])) { - $this->row_cache_keys_to_save = $vals['row_cache_keys_to_save']; - } - if (isset($vals['populate_io_cache_on_flush'])) { - $this->populate_io_cache_on_flush = $vals['populate_io_cache_on_flush']; - } - if (isset($vals['index_interval'])) { - $this->index_interval = $vals['index_interval']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -4337,630 +2564,37 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->keyspace); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->column_type); - } else { - $xfer += $input->skip($ftype); - } - break; - case 5: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->comparator_type); - } else { - $xfer += $input->skip($ftype); - } - break; - case 6: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->subcomparator_type); - } else { - $xfer += $input->skip($ftype); - } - break; - case 8: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->comment); - } else { - $xfer += $input->skip($ftype); - } - break; - case 12: - if ($ftype == TType::DOUBLE) { - $xfer += $input->readDouble($this->read_repair_chance); - } else { - $xfer += $input->skip($ftype); - } - break; - case 13: - if ($ftype == TType::LST) { - $this->column_metadata = array(); - $_size97 = 0; - $_etype100 = 0; - $xfer += $input->readListBegin($_etype100, $_size97); - for ($_i101 = 0; $_i101 < $_size97; ++$_i101) - { - $elem102 = null; - $elem102 = new \cassandra\ColumnDef(); - $xfer += $elem102->read($input); - $this->column_metadata []= $elem102; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 14: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->gc_grace_seconds); - } else { - $xfer += $input->skip($ftype); - } - break; - case 15: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->default_validation_class); - } else { - $xfer += $input->skip($ftype); - } - break; - case 16: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->id); - } else { - $xfer += $input->skip($ftype); - } - break; - case 17: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->min_compaction_threshold); - } else { - $xfer += $input->skip($ftype); - } - break; - case 18: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->max_compaction_threshold); - } else { - $xfer += $input->skip($ftype); - } - break; - case 26: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key_validation_class); - } else { - $xfer += $input->skip($ftype); - } - break; - case 28: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key_alias); - } else { - $xfer += $input->skip($ftype); - } - break; - case 29: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->compaction_strategy); - } else { - $xfer += $input->skip($ftype); - } - break; - case 30: - if ($ftype == TType::MAP) { - $this->compaction_strategy_options = array(); - $_size103 = 0; - $_ktype104 = 0; - $_vtype105 = 0; - $xfer += $input->readMapBegin($_ktype104, $_vtype105, $_size103); - for ($_i107 = 0; $_i107 < $_size103; ++$_i107) - { - $key108 = ''; - $val109 = ''; - $xfer += $input->readString($key108); - $xfer += $input->readString($val109); - $this->compaction_strategy_options[$key108] = $val109; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 32: - if ($ftype == TType::MAP) { - $this->compression_options = array(); - $_size110 = 0; - $_ktype111 = 0; - $_vtype112 = 0; - $xfer += $input->readMapBegin($_ktype111, $_vtype112, $_size110); - for ($_i114 = 0; $_i114 < $_size110; ++$_i114) - { - $key115 = ''; - $val116 = ''; - $xfer += $input->readString($key115); - $xfer += $input->readString($val116); - $this->compression_options[$key115] = $val116; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 33: - if ($ftype == TType::DOUBLE) { - $xfer += $input->readDouble($this->bloom_filter_fp_chance); - } else { - $xfer += $input->skip($ftype); - } - break; - case 34: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->caching); - } else { - $xfer += $input->skip($ftype); - } - break; - case 37: - if ($ftype == TType::DOUBLE) { - $xfer += $input->readDouble($this->dclocal_read_repair_chance); - } else { - $xfer += $input->skip($ftype); - } - break; - case 39: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->memtable_flush_period_in_ms); - } else { - $xfer += $input->skip($ftype); - } - break; - case 40: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->default_time_to_live); - } else { - $xfer += $input->skip($ftype); - } - break; - case 42: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->speculative_retry); - } else { - $xfer += $input->skip($ftype); - } - break; - case 43: - if ($ftype == TType::LST) { - $this->triggers = array(); - $_size117 = 0; - $_etype120 = 0; - $xfer += $input->readListBegin($_etype120, $_size117); - for ($_i121 = 0; $_i121 < $_size117; ++$_i121) - { - $elem122 = null; - $elem122 = new \cassandra\TriggerDef(); - $xfer += $elem122->read($input); - $this->triggers []= $elem122; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 44: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->cells_per_row_to_cache); - } else { - $xfer += $input->skip($ftype); - } - break; - case 45: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->min_index_interval); - } else { - $xfer += $input->skip($ftype); - } - break; - case 46: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->max_index_interval); - } else { - $xfer += $input->skip($ftype); - } - break; - case 9: - if ($ftype == TType::DOUBLE) { - $xfer += $input->readDouble($this->row_cache_size); - } else { - $xfer += $input->skip($ftype); - } - break; - case 11: - if ($ftype == TType::DOUBLE) { - $xfer += $input->readDouble($this->key_cache_size); - } else { - $xfer += $input->skip($ftype); - } - break; - case 19: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->row_cache_save_period_in_seconds); - } else { - $xfer += $input->skip($ftype); - } - break; - case 20: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->key_cache_save_period_in_seconds); - } else { - $xfer += $input->skip($ftype); - } - break; - case 21: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->memtable_flush_after_mins); - } else { - $xfer += $input->skip($ftype); - } - break; - case 22: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->memtable_throughput_in_mb); - } else { - $xfer += $input->skip($ftype); - } - break; - case 23: - if ($ftype == TType::DOUBLE) { - $xfer += $input->readDouble($this->memtable_operations_in_millions); - } else { - $xfer += $input->skip($ftype); - } - break; - case 24: - if ($ftype == TType::BOOL) { - $xfer += $input->readBool($this->replicate_on_write); - } else { - $xfer += $input->skip($ftype); - } - break; - case 25: - if ($ftype == TType::DOUBLE) { - $xfer += $input->readDouble($this->merge_shards_chance); - } else { - $xfer += $input->skip($ftype); - } - break; - case 27: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->row_cache_provider); - } else { - $xfer += $input->skip($ftype); - } - break; - case 31: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->row_cache_keys_to_save); - } else { - $xfer += $input->skip($ftype); - } - break; - case 38: - if ($ftype == TType::BOOL) { - $xfer += $input->readBool($this->populate_io_cache_on_flush); - } else { - $xfer += $input->skip($ftype); - } - break; - case 41: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->index_interval); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('CfDef', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('CfDef'); - if ($this->keyspace !== null) { - $xfer += $output->writeFieldBegin('keyspace', TType::STRING, 1); - $xfer += $output->writeString($this->keyspace); - $xfer += $output->writeFieldEnd(); - } - if ($this->name !== null) { - $xfer += $output->writeFieldBegin('name', TType::STRING, 2); - $xfer += $output->writeString($this->name); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_type !== null) { - $xfer += $output->writeFieldBegin('column_type', TType::STRING, 3); - $xfer += $output->writeString($this->column_type); - $xfer += $output->writeFieldEnd(); - } - if ($this->comparator_type !== null) { - $xfer += $output->writeFieldBegin('comparator_type', TType::STRING, 5); - $xfer += $output->writeString($this->comparator_type); - $xfer += $output->writeFieldEnd(); - } - if ($this->subcomparator_type !== null) { - $xfer += $output->writeFieldBegin('subcomparator_type', TType::STRING, 6); - $xfer += $output->writeString($this->subcomparator_type); - $xfer += $output->writeFieldEnd(); - } - if ($this->comment !== null) { - $xfer += $output->writeFieldBegin('comment', TType::STRING, 8); - $xfer += $output->writeString($this->comment); - $xfer += $output->writeFieldEnd(); - } - if ($this->row_cache_size !== null) { - $xfer += $output->writeFieldBegin('row_cache_size', TType::DOUBLE, 9); - $xfer += $output->writeDouble($this->row_cache_size); - $xfer += $output->writeFieldEnd(); - } - if ($this->key_cache_size !== null) { - $xfer += $output->writeFieldBegin('key_cache_size', TType::DOUBLE, 11); - $xfer += $output->writeDouble($this->key_cache_size); - $xfer += $output->writeFieldEnd(); - } - if ($this->read_repair_chance !== null) { - $xfer += $output->writeFieldBegin('read_repair_chance', TType::DOUBLE, 12); - $xfer += $output->writeDouble($this->read_repair_chance); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_metadata !== null) { - if (!is_array($this->column_metadata)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_metadata', TType::LST, 13); - { - $output->writeListBegin(TType::STRUCT, count($this->column_metadata)); - { - foreach ($this->column_metadata as $iter123) - { - $xfer += $iter123->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->gc_grace_seconds !== null) { - $xfer += $output->writeFieldBegin('gc_grace_seconds', TType::I32, 14); - $xfer += $output->writeI32($this->gc_grace_seconds); - $xfer += $output->writeFieldEnd(); - } - if ($this->default_validation_class !== null) { - $xfer += $output->writeFieldBegin('default_validation_class', TType::STRING, 15); - $xfer += $output->writeString($this->default_validation_class); - $xfer += $output->writeFieldEnd(); - } - if ($this->id !== null) { - $xfer += $output->writeFieldBegin('id', TType::I32, 16); - $xfer += $output->writeI32($this->id); - $xfer += $output->writeFieldEnd(); - } - if ($this->min_compaction_threshold !== null) { - $xfer += $output->writeFieldBegin('min_compaction_threshold', TType::I32, 17); - $xfer += $output->writeI32($this->min_compaction_threshold); - $xfer += $output->writeFieldEnd(); - } - if ($this->max_compaction_threshold !== null) { - $xfer += $output->writeFieldBegin('max_compaction_threshold', TType::I32, 18); - $xfer += $output->writeI32($this->max_compaction_threshold); - $xfer += $output->writeFieldEnd(); - } - if ($this->row_cache_save_period_in_seconds !== null) { - $xfer += $output->writeFieldBegin('row_cache_save_period_in_seconds', TType::I32, 19); - $xfer += $output->writeI32($this->row_cache_save_period_in_seconds); - $xfer += $output->writeFieldEnd(); - } - if ($this->key_cache_save_period_in_seconds !== null) { - $xfer += $output->writeFieldBegin('key_cache_save_period_in_seconds', TType::I32, 20); - $xfer += $output->writeI32($this->key_cache_save_period_in_seconds); - $xfer += $output->writeFieldEnd(); - } - if ($this->memtable_flush_after_mins !== null) { - $xfer += $output->writeFieldBegin('memtable_flush_after_mins', TType::I32, 21); - $xfer += $output->writeI32($this->memtable_flush_after_mins); - $xfer += $output->writeFieldEnd(); - } - if ($this->memtable_throughput_in_mb !== null) { - $xfer += $output->writeFieldBegin('memtable_throughput_in_mb', TType::I32, 22); - $xfer += $output->writeI32($this->memtable_throughput_in_mb); - $xfer += $output->writeFieldEnd(); - } - if ($this->memtable_operations_in_millions !== null) { - $xfer += $output->writeFieldBegin('memtable_operations_in_millions', TType::DOUBLE, 23); - $xfer += $output->writeDouble($this->memtable_operations_in_millions); - $xfer += $output->writeFieldEnd(); - } - if ($this->replicate_on_write !== null) { - $xfer += $output->writeFieldBegin('replicate_on_write', TType::BOOL, 24); - $xfer += $output->writeBool($this->replicate_on_write); - $xfer += $output->writeFieldEnd(); - } - if ($this->merge_shards_chance !== null) { - $xfer += $output->writeFieldBegin('merge_shards_chance', TType::DOUBLE, 25); - $xfer += $output->writeDouble($this->merge_shards_chance); - $xfer += $output->writeFieldEnd(); - } - if ($this->key_validation_class !== null) { - $xfer += $output->writeFieldBegin('key_validation_class', TType::STRING, 26); - $xfer += $output->writeString($this->key_validation_class); - $xfer += $output->writeFieldEnd(); - } - if ($this->row_cache_provider !== null) { - $xfer += $output->writeFieldBegin('row_cache_provider', TType::STRING, 27); - $xfer += $output->writeString($this->row_cache_provider); - $xfer += $output->writeFieldEnd(); - } - if ($this->key_alias !== null) { - $xfer += $output->writeFieldBegin('key_alias', TType::STRING, 28); - $xfer += $output->writeString($this->key_alias); - $xfer += $output->writeFieldEnd(); - } - if ($this->compaction_strategy !== null) { - $xfer += $output->writeFieldBegin('compaction_strategy', TType::STRING, 29); - $xfer += $output->writeString($this->compaction_strategy); - $xfer += $output->writeFieldEnd(); - } - if ($this->compaction_strategy_options !== null) { - if (!is_array($this->compaction_strategy_options)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('compaction_strategy_options', TType::MAP, 30); - { - $output->writeMapBegin(TType::STRING, TType::STRING, count($this->compaction_strategy_options)); - { - foreach ($this->compaction_strategy_options as $kiter124 => $viter125) - { - $xfer += $output->writeString($kiter124); - $xfer += $output->writeString($viter125); - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->row_cache_keys_to_save !== null) { - $xfer += $output->writeFieldBegin('row_cache_keys_to_save', TType::I32, 31); - $xfer += $output->writeI32($this->row_cache_keys_to_save); - $xfer += $output->writeFieldEnd(); - } - if ($this->compression_options !== null) { - if (!is_array($this->compression_options)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('compression_options', TType::MAP, 32); - { - $output->writeMapBegin(TType::STRING, TType::STRING, count($this->compression_options)); - { - foreach ($this->compression_options as $kiter126 => $viter127) - { - $xfer += $output->writeString($kiter126); - $xfer += $output->writeString($viter127); - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->bloom_filter_fp_chance !== null) { - $xfer += $output->writeFieldBegin('bloom_filter_fp_chance', TType::DOUBLE, 33); - $xfer += $output->writeDouble($this->bloom_filter_fp_chance); - $xfer += $output->writeFieldEnd(); - } - if ($this->caching !== null) { - $xfer += $output->writeFieldBegin('caching', TType::STRING, 34); - $xfer += $output->writeString($this->caching); - $xfer += $output->writeFieldEnd(); - } - if ($this->dclocal_read_repair_chance !== null) { - $xfer += $output->writeFieldBegin('dclocal_read_repair_chance', TType::DOUBLE, 37); - $xfer += $output->writeDouble($this->dclocal_read_repair_chance); - $xfer += $output->writeFieldEnd(); - } - if ($this->populate_io_cache_on_flush !== null) { - $xfer += $output->writeFieldBegin('populate_io_cache_on_flush', TType::BOOL, 38); - $xfer += $output->writeBool($this->populate_io_cache_on_flush); - $xfer += $output->writeFieldEnd(); - } - if ($this->memtable_flush_period_in_ms !== null) { - $xfer += $output->writeFieldBegin('memtable_flush_period_in_ms', TType::I32, 39); - $xfer += $output->writeI32($this->memtable_flush_period_in_ms); - $xfer += $output->writeFieldEnd(); - } - if ($this->default_time_to_live !== null) { - $xfer += $output->writeFieldBegin('default_time_to_live', TType::I32, 40); - $xfer += $output->writeI32($this->default_time_to_live); - $xfer += $output->writeFieldEnd(); - } - if ($this->index_interval !== null) { - $xfer += $output->writeFieldBegin('index_interval', TType::I32, 41); - $xfer += $output->writeI32($this->index_interval); - $xfer += $output->writeFieldEnd(); - } - if ($this->speculative_retry !== null) { - $xfer += $output->writeFieldBegin('speculative_retry', TType::STRING, 42); - $xfer += $output->writeString($this->speculative_retry); - $xfer += $output->writeFieldEnd(); - } - if ($this->triggers !== null) { - if (!is_array($this->triggers)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('triggers', TType::LST, 43); - { - $output->writeListBegin(TType::STRUCT, count($this->triggers)); - { - foreach ($this->triggers as $iter128) - { - $xfer += $iter128->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->cells_per_row_to_cache !== null) { - $xfer += $output->writeFieldBegin('cells_per_row_to_cache', TType::STRING, 44); - $xfer += $output->writeString($this->cells_per_row_to_cache); - $xfer += $output->writeFieldEnd(); - } - if ($this->min_index_interval !== null) { - $xfer += $output->writeFieldBegin('min_index_interval', TType::I32, 45); - $xfer += $output->writeI32($this->min_index_interval); - $xfer += $output->writeFieldEnd(); - } - if ($this->max_index_interval !== null) { - $xfer += $output->writeFieldBegin('max_index_interval', TType::I32, 46); - $xfer += $output->writeI32($this->max_index_interval); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('CfDef', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field CfDef.keyspace is unset!'); + } + if ($this->name === null) { + throw new TProtocolException('Required field CfDef.name is unset!'); + } + } + + private function _validateForWrite() { + if ($this->keyspace === null) { + throw new TProtocolException('Required field CfDef.keyspace is unset!'); + } + if ($this->name === null) { + throw new TProtocolException('Required field CfDef.name is unset!'); + } } } -class KsDef { +class KsDef extends TBase { static $_TSPEC; /** @@ -5033,24 +2667,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['name'])) { - $this->name = $vals['name']; - } - if (isset($vals['strategy_class'])) { - $this->strategy_class = $vals['strategy_class']; - } - if (isset($vals['strategy_options'])) { - $this->strategy_options = $vals['strategy_options']; - } - if (isset($vals['replication_factor'])) { - $this->replication_factor = $vals['replication_factor']; - } - if (isset($vals['cf_defs'])) { - $this->cf_defs = $vals['cf_defs']; - } - if (isset($vals['durable_writes'])) { - $this->durable_writes = $vals['durable_writes']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5060,156 +2677,38 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->strategy_class); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::MAP) { - $this->strategy_options = array(); - $_size129 = 0; - $_ktype130 = 0; - $_vtype131 = 0; - $xfer += $input->readMapBegin($_ktype130, $_vtype131, $_size129); - for ($_i133 = 0; $_i133 < $_size129; ++$_i133) - { - $key134 = ''; - $val135 = ''; - $xfer += $input->readString($key134); - $xfer += $input->readString($val135); - $this->strategy_options[$key134] = $val135; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->replication_factor); - } else { - $xfer += $input->skip($ftype); - } - break; - case 5: - if ($ftype == TType::LST) { - $this->cf_defs = array(); - $_size136 = 0; - $_etype139 = 0; - $xfer += $input->readListBegin($_etype139, $_size136); - for ($_i140 = 0; $_i140 < $_size136; ++$_i140) - { - $elem141 = null; - $elem141 = new \cassandra\CfDef(); - $xfer += $elem141->read($input); - $this->cf_defs []= $elem141; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 6: - if ($ftype == TType::BOOL) { - $xfer += $input->readBool($this->durable_writes); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('KsDef', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('KsDef'); - if ($this->name !== null) { - $xfer += $output->writeFieldBegin('name', TType::STRING, 1); - $xfer += $output->writeString($this->name); - $xfer += $output->writeFieldEnd(); - } - if ($this->strategy_class !== null) { - $xfer += $output->writeFieldBegin('strategy_class', TType::STRING, 2); - $xfer += $output->writeString($this->strategy_class); - $xfer += $output->writeFieldEnd(); - } - if ($this->strategy_options !== null) { - if (!is_array($this->strategy_options)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('strategy_options', TType::MAP, 3); - { - $output->writeMapBegin(TType::STRING, TType::STRING, count($this->strategy_options)); - { - foreach ($this->strategy_options as $kiter142 => $viter143) - { - $xfer += $output->writeString($kiter142); - $xfer += $output->writeString($viter143); - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->replication_factor !== null) { - $xfer += $output->writeFieldBegin('replication_factor', TType::I32, 4); - $xfer += $output->writeI32($this->replication_factor); - $xfer += $output->writeFieldEnd(); - } - if ($this->cf_defs !== null) { - if (!is_array($this->cf_defs)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('cf_defs', TType::LST, 5); - { - $output->writeListBegin(TType::STRUCT, count($this->cf_defs)); - { - foreach ($this->cf_defs as $iter144) - { - $xfer += $iter144->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->durable_writes !== null) { - $xfer += $output->writeFieldBegin('durable_writes', TType::BOOL, 6); - $xfer += $output->writeBool($this->durable_writes); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('KsDef', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->name === null) { + throw new TProtocolException('Required field KsDef.name is unset!'); + } + if ($this->strategy_class === null) { + throw new TProtocolException('Required field KsDef.strategy_class is unset!'); + } + if ($this->cf_defs === null) { + throw new TProtocolException('Required field KsDef.cf_defs is unset!'); + } + } + + private function _validateForWrite() { + if ($this->name === null) { + throw new TProtocolException('Required field KsDef.name is unset!'); + } + if ($this->strategy_class === null) { + throw new TProtocolException('Required field KsDef.strategy_class is unset!'); + } + if ($this->cf_defs === null) { + throw new TProtocolException('Required field KsDef.cf_defs is unset!'); + } } } @@ -5222,7 +2721,7 @@ public function write($output) { * it will be included in the columns list if it was included in the SELECT and * the key field is always null. */ -class CqlRow { +class CqlRow extends TBase { static $_TSPEC; /** @@ -5253,12 +2752,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['columns'])) { - $this->columns = $vals['columns']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5268,87 +2762,37 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::LST) { - $this->columns = array(); - $_size145 = 0; - $_etype148 = 0; - $xfer += $input->readListBegin($_etype148, $_size145); - for ($_i149 = 0; $_i149 < $_size145; ++$_i149) - { - $elem150 = null; - $elem150 = new \cassandra\Column(); - $xfer += $elem150->read($input); - $this->columns []= $elem150; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('CqlRow', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('CqlRow'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->columns !== null) { - if (!is_array($this->columns)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('columns', TType::LST, 2); - { - $output->writeListBegin(TType::STRUCT, count($this->columns)); - { - foreach ($this->columns as $iter151) - { - $xfer += $iter151->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('CqlRow', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->key === null) { + throw new TProtocolException('Required field CqlRow.key is unset!'); + } + if ($this->columns === null) { + throw new TProtocolException('Required field CqlRow.columns is unset!'); + } + } + + private function _validateForWrite() { + if ($this->key === null) { + throw new TProtocolException('Required field CqlRow.key is unset!'); + } + if ($this->columns === null) { + throw new TProtocolException('Required field CqlRow.columns is unset!'); + } } } -class CqlMetadata { +class CqlMetadata extends TBase { static $_TSPEC; /** @@ -5406,18 +2850,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['name_types'])) { - $this->name_types = $vals['name_types']; - } - if (isset($vals['value_types'])) { - $this->value_types = $vals['value_types']; - } - if (isset($vals['default_name_type'])) { - $this->default_name_type = $vals['default_name_type']; - } - if (isset($vals['default_value_type'])) { - $this->default_value_type = $vals['default_value_type']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5427,140 +2860,49 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::MAP) { - $this->name_types = array(); - $_size152 = 0; - $_ktype153 = 0; - $_vtype154 = 0; - $xfer += $input->readMapBegin($_ktype153, $_vtype154, $_size152); - for ($_i156 = 0; $_i156 < $_size152; ++$_i156) - { - $key157 = ''; - $val158 = ''; - $xfer += $input->readString($key157); - $xfer += $input->readString($val158); - $this->name_types[$key157] = $val158; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::MAP) { - $this->value_types = array(); - $_size159 = 0; - $_ktype160 = 0; - $_vtype161 = 0; - $xfer += $input->readMapBegin($_ktype160, $_vtype161, $_size159); - for ($_i163 = 0; $_i163 < $_size159; ++$_i163) - { - $key164 = ''; - $val165 = ''; - $xfer += $input->readString($key164); - $xfer += $input->readString($val165); - $this->value_types[$key164] = $val165; - } - $xfer += $input->readMapEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->default_name_type); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->default_value_type); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('CqlMetadata', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('CqlMetadata'); - if ($this->name_types !== null) { - if (!is_array($this->name_types)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('name_types', TType::MAP, 1); - { - $output->writeMapBegin(TType::STRING, TType::STRING, count($this->name_types)); - { - foreach ($this->name_types as $kiter166 => $viter167) - { - $xfer += $output->writeString($kiter166); - $xfer += $output->writeString($viter167); - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->value_types !== null) { - if (!is_array($this->value_types)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('value_types', TType::MAP, 2); - { - $output->writeMapBegin(TType::STRING, TType::STRING, count($this->value_types)); - { - foreach ($this->value_types as $kiter168 => $viter169) - { - $xfer += $output->writeString($kiter168); - $xfer += $output->writeString($viter169); - } - } - $output->writeMapEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->default_name_type !== null) { - $xfer += $output->writeFieldBegin('default_name_type', TType::STRING, 3); - $xfer += $output->writeString($this->default_name_type); - $xfer += $output->writeFieldEnd(); - } - if ($this->default_value_type !== null) { - $xfer += $output->writeFieldBegin('default_value_type', TType::STRING, 4); - $xfer += $output->writeString($this->default_value_type); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('CqlMetadata', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->name_types === null) { + throw new TProtocolException('Required field CqlMetadata.name_types is unset!'); + } + if ($this->value_types === null) { + throw new TProtocolException('Required field CqlMetadata.value_types is unset!'); + } + if ($this->default_name_type === null) { + throw new TProtocolException('Required field CqlMetadata.default_name_type is unset!'); + } + if ($this->default_value_type === null) { + throw new TProtocolException('Required field CqlMetadata.default_value_type is unset!'); + } + } + + private function _validateForWrite() { + if ($this->name_types === null) { + throw new TProtocolException('Required field CqlMetadata.name_types is unset!'); + } + if ($this->value_types === null) { + throw new TProtocolException('Required field CqlMetadata.value_types is unset!'); + } + if ($this->default_name_type === null) { + throw new TProtocolException('Required field CqlMetadata.default_name_type is unset!'); + } + if ($this->default_value_type === null) { + throw new TProtocolException('Required field CqlMetadata.default_value_type is unset!'); + } } } -class CqlResult { +class CqlResult extends TBase { static $_TSPEC; /** @@ -5608,18 +2950,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['type'])) { - $this->type = $vals['type']; - } - if (isset($vals['rows'])) { - $this->rows = $vals['rows']; - } - if (isset($vals['num'])) { - $this->num = $vals['num']; - } - if (isset($vals['schema'])) { - $this->schema = $vals['schema']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5629,115 +2960,31 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->type); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::LST) { - $this->rows = array(); - $_size170 = 0; - $_etype173 = 0; - $xfer += $input->readListBegin($_etype173, $_size170); - for ($_i174 = 0; $_i174 < $_size170; ++$_i174) - { - $elem175 = null; - $elem175 = new \cassandra\CqlRow(); - $xfer += $elem175->read($input); - $this->rows []= $elem175; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->num); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::STRUCT) { - $this->schema = new \cassandra\CqlMetadata(); - $xfer += $this->schema->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('CqlResult', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('CqlResult'); - if ($this->type !== null) { - $xfer += $output->writeFieldBegin('type', TType::I32, 1); - $xfer += $output->writeI32($this->type); - $xfer += $output->writeFieldEnd(); - } - if ($this->rows !== null) { - if (!is_array($this->rows)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('rows', TType::LST, 2); - { - $output->writeListBegin(TType::STRUCT, count($this->rows)); - { - foreach ($this->rows as $iter176) - { - $xfer += $iter176->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->num !== null) { - $xfer += $output->writeFieldBegin('num', TType::I32, 3); - $xfer += $output->writeI32($this->num); - $xfer += $output->writeFieldEnd(); - } - if ($this->schema !== null) { - if (!is_object($this->schema)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('schema', TType::STRUCT, 4); - $xfer += $this->schema->write($output); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('CqlResult', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->type === null) { + throw new TProtocolException('Required field CqlResult.type is unset!'); + } + } + + private function _validateForWrite() { + if ($this->type === null) { + throw new TProtocolException('Required field CqlResult.type is unset!'); + } } } -class CqlPreparedResult { +class CqlPreparedResult extends TBase { static $_TSPEC; /** @@ -5787,18 +3034,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['itemId'])) { - $this->itemId = $vals['itemId']; - } - if (isset($vals['count'])) { - $this->count = $vals['count']; - } - if (isset($vals['variable_types'])) { - $this->variable_types = $vals['variable_types']; - } - if (isset($vals['variable_names'])) { - $this->variable_names = $vals['variable_names']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5808,127 +3044,32 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->itemId); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->count); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::LST) { - $this->variable_types = array(); - $_size177 = 0; - $_etype180 = 0; - $xfer += $input->readListBegin($_etype180, $_size177); - for ($_i181 = 0; $_i181 < $_size177; ++$_i181) - { - $elem182 = null; - $xfer += $input->readString($elem182); - $this->variable_types []= $elem182; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::LST) { - $this->variable_names = array(); - $_size183 = 0; - $_etype186 = 0; - $xfer += $input->readListBegin($_etype186, $_size183); - for ($_i187 = 0; $_i187 < $_size183; ++$_i187) - { - $elem188 = null; - $xfer += $input->readString($elem188); - $this->variable_names []= $elem188; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('CqlPreparedResult', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('CqlPreparedResult'); - if ($this->itemId !== null) { - $xfer += $output->writeFieldBegin('itemId', TType::I32, 1); - $xfer += $output->writeI32($this->itemId); - $xfer += $output->writeFieldEnd(); - } - if ($this->count !== null) { - $xfer += $output->writeFieldBegin('count', TType::I32, 2); - $xfer += $output->writeI32($this->count); - $xfer += $output->writeFieldEnd(); - } - if ($this->variable_types !== null) { - if (!is_array($this->variable_types)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('variable_types', TType::LST, 3); - { - $output->writeListBegin(TType::STRING, count($this->variable_types)); - { - foreach ($this->variable_types as $iter189) - { - $xfer += $output->writeString($iter189); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->variable_names !== null) { - if (!is_array($this->variable_names)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('variable_names', TType::LST, 4); - { - $output->writeListBegin(TType::STRING, count($this->variable_names)); - { - foreach ($this->variable_names as $iter190) - { - $xfer += $output->writeString($iter190); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + $this->_validateForWrite(); + return $this->_write('CqlPreparedResult', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->itemId === null) { + throw new TProtocolException('Required field CqlPreparedResult.itemId is unset!'); + } + if ($this->count === null) { + throw new TProtocolException('Required field CqlPreparedResult.count is unset!'); + } + } + + private function _validateForWrite() { + if ($this->itemId === null) { + throw new TProtocolException('Required field CqlPreparedResult.itemId is unset!'); + } + if ($this->count === null) { + throw new TProtocolException('Required field CqlPreparedResult.count is unset!'); + } } } @@ -5936,7 +3077,7 @@ public function write($output) { /** * Represents input splits used by hadoop ColumnFamilyRecordReaders */ -class CfSplit { +class CfSplit extends TBase { static $_TSPEC; /** @@ -5970,15 +3111,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['start_token'])) { - $this->start_token = $vals['start_token']; - } - if (isset($vals['end_token'])) { - $this->end_token = $vals['end_token']; - } - if (isset($vals['row_count'])) { - $this->row_count = $vals['row_count']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -5988,71 +3121,38 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->start_token); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->end_token); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::I64) { - $xfer += $input->readI64($this->row_count); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + $tmp = $this->_read('CfSplit', self::$_TSPEC, $input); + $this->_validateForRead(); + return $tmp; } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('CfSplit'); - if ($this->start_token !== null) { - $xfer += $output->writeFieldBegin('start_token', TType::STRING, 1); - $xfer += $output->writeString($this->start_token); - $xfer += $output->writeFieldEnd(); + $this->_validateForWrite(); + return $this->_write('CfSplit', self::$_TSPEC, $output); + } + + private function _validateForRead() { + if ($this->start_token === null) { + throw new TProtocolException('Required field CfSplit.start_token is unset!'); + } + if ($this->end_token === null) { + throw new TProtocolException('Required field CfSplit.end_token is unset!'); } - if ($this->end_token !== null) { - $xfer += $output->writeFieldBegin('end_token', TType::STRING, 2); - $xfer += $output->writeString($this->end_token); - $xfer += $output->writeFieldEnd(); + if ($this->row_count === null) { + throw new TProtocolException('Required field CfSplit.row_count is unset!'); } - if ($this->row_count !== null) { - $xfer += $output->writeFieldBegin('row_count', TType::I64, 3); - $xfer += $output->writeI64($this->row_count); - $xfer += $output->writeFieldEnd(); + } + + private function _validateForWrite() { + if ($this->start_token === null) { + throw new TProtocolException('Required field CfSplit.start_token is unset!'); + } + if ($this->end_token === null) { + throw new TProtocolException('Required field CfSplit.end_token is unset!'); + } + if ($this->row_count === null) { + throw new TProtocolException('Required field CfSplit.row_count is unset!'); } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; } } @@ -6064,7 +3164,7 @@ public function write($output) { * @param start. The start of the ColumnSlice inclusive * @param finish. The end of the ColumnSlice inclusive */ -class ColumnSlice { +class ColumnSlice extends TBase { static $_TSPEC; /** @@ -6090,12 +3190,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['start'])) { - $this->start = $vals['start']; - } - if (isset($vals['finish'])) { - $this->finish = $vals['finish']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -6105,59 +3200,11 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->start); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->finish); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('ColumnSlice', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('ColumnSlice'); - if ($this->start !== null) { - $xfer += $output->writeFieldBegin('start', TType::STRING, 1); - $xfer += $output->writeString($this->start); - $xfer += $output->writeFieldEnd(); - } - if ($this->finish !== null) { - $xfer += $output->writeFieldBegin('finish', TType::STRING, 2); - $xfer += $output->writeString($this->finish); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('ColumnSlice', self::$_TSPEC, $output); } } @@ -6171,7 +3218,7 @@ public function write($output) { * @param count. Maximum number of columns * @param consistency_level. Level to perform the operation at */ -class MultiSliceRequest { +class MultiSliceRequest extends TBase { static $_TSPEC; /** @@ -6235,24 +3282,7 @@ public function __construct($vals=null) { ); } if (is_array($vals)) { - if (isset($vals['key'])) { - $this->key = $vals['key']; - } - if (isset($vals['column_parent'])) { - $this->column_parent = $vals['column_parent']; - } - if (isset($vals['column_slices'])) { - $this->column_slices = $vals['column_slices']; - } - if (isset($vals['reversed'])) { - $this->reversed = $vals['reversed']; - } - if (isset($vals['count'])) { - $this->count = $vals['count']; - } - if (isset($vals['consistency_level'])) { - $this->consistency_level = $vals['consistency_level']; - } + parent::__construct(self::$_TSPEC, $vals); } } @@ -6262,134 +3292,11 @@ public function getName() { public function read($input) { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) - { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - switch ($fid) - { - case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->key); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRUCT) { - $this->column_parent = new \cassandra\ColumnParent(); - $xfer += $this->column_parent->read($input); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: - if ($ftype == TType::LST) { - $this->column_slices = array(); - $_size191 = 0; - $_etype194 = 0; - $xfer += $input->readListBegin($_etype194, $_size191); - for ($_i195 = 0; $_i195 < $_size191; ++$_i195) - { - $elem196 = null; - $elem196 = new \cassandra\ColumnSlice(); - $xfer += $elem196->read($input); - $this->column_slices []= $elem196; - } - $xfer += $input->readListEnd(); - } else { - $xfer += $input->skip($ftype); - } - break; - case 4: - if ($ftype == TType::BOOL) { - $xfer += $input->readBool($this->reversed); - } else { - $xfer += $input->skip($ftype); - } - break; - case 5: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->count); - } else { - $xfer += $input->skip($ftype); - } - break; - case 6: - if ($ftype == TType::I32) { - $xfer += $input->readI32($this->consistency_level); - } else { - $xfer += $input->skip($ftype); - } - break; - default: - $xfer += $input->skip($ftype); - break; - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - return $xfer; + return $this->_read('MultiSliceRequest', self::$_TSPEC, $input); } public function write($output) { - $xfer = 0; - $xfer += $output->writeStructBegin('MultiSliceRequest'); - if ($this->key !== null) { - $xfer += $output->writeFieldBegin('key', TType::STRING, 1); - $xfer += $output->writeString($this->key); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_parent !== null) { - if (!is_object($this->column_parent)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_parent', TType::STRUCT, 2); - $xfer += $this->column_parent->write($output); - $xfer += $output->writeFieldEnd(); - } - if ($this->column_slices !== null) { - if (!is_array($this->column_slices)) { - throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); - } - $xfer += $output->writeFieldBegin('column_slices', TType::LST, 3); - { - $output->writeListBegin(TType::STRUCT, count($this->column_slices)); - { - foreach ($this->column_slices as $iter197) - { - $xfer += $iter197->write($output); - } - } - $output->writeListEnd(); - } - $xfer += $output->writeFieldEnd(); - } - if ($this->reversed !== null) { - $xfer += $output->writeFieldBegin('reversed', TType::BOOL, 4); - $xfer += $output->writeBool($this->reversed); - $xfer += $output->writeFieldEnd(); - } - if ($this->count !== null) { - $xfer += $output->writeFieldBegin('count', TType::I32, 5); - $xfer += $output->writeI32($this->count); - $xfer += $output->writeFieldEnd(); - } - if ($this->consistency_level !== null) { - $xfer += $output->writeFieldBegin('consistency_level', TType::I32, 6); - $xfer += $output->writeI32($this->consistency_level); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - return $xfer; + return $this->_write('MultiSliceRequest', self::$_TSPEC, $output); } } diff --git a/update.sh b/update.sh index d72db2d..5043963 100755 --- a/update.sh +++ b/update.sh @@ -1,6 +1,8 @@ +#!/bin/sh git clone --depth=1 --branch=trunk git@github.com:apache/cassandra tmp cp tmp/interface/cassandra.thrift cassandra-thrift/ rm -Rf tmp -thrift --gen php cassandra-thrift/cassandra.thrift +thrift --gen php:oop,validate cassandra-thrift/cassandra.thrift cp -R gen-php/cassandra src rm -Rf gen-php/ +php refactor.php