PageRenderTime 58ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 1ms

/thrift/packages/cassandra/Cassandra.php

https://github.com/furqanrydhan/Cassandra-PHP-Client-Library
PHP | 8743 lines | 8170 code | 566 blank | 7 comment | 1436 complexity | b313a9d986306c769a8231721fdab03b MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /**
  3. * Autogenerated by Thrift Compiler (0.8.0)
  4. *
  5. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  6. * @generated
  7. */
  8. include_once $GLOBALS['THRIFT_ROOT'].'/Thrift.php';
  9. include_once $GLOBALS['THRIFT_ROOT'].'/packages/cassandra/cassandra_types.php';
  10. interface cassandra_CassandraIf {
  11. public function login($auth_request);
  12. public function set_keyspace($keyspace);
  13. public function get($key, $column_path, $consistency_level);
  14. public function get_slice($key, $column_parent, $predicate, $consistency_level);
  15. public function get_count($key, $column_parent, $predicate, $consistency_level);
  16. public function multiget_slice($keys, $column_parent, $predicate, $consistency_level);
  17. public function multiget_count($keys, $column_parent, $predicate, $consistency_level);
  18. public function get_range_slices($column_parent, $predicate, $range, $consistency_level);
  19. public function get_indexed_slices($column_parent, $index_clause, $column_predicate, $consistency_level);
  20. public function insert($key, $column_parent, $column, $consistency_level);
  21. public function add($key, $column_parent, $column, $consistency_level);
  22. public function remove($key, $column_path, $timestamp, $consistency_level);
  23. public function remove_counter($key, $path, $consistency_level);
  24. public function batch_mutate($mutation_map, $consistency_level);
  25. public function truncate($cfname);
  26. public function describe_schema_versions();
  27. public function describe_keyspaces();
  28. public function describe_cluster_name();
  29. public function describe_version();
  30. public function describe_ring($keyspace);
  31. public function describe_partitioner();
  32. public function describe_snitch();
  33. public function describe_keyspace($keyspace);
  34. public function describe_splits($cfName, $start_token, $end_token, $keys_per_split);
  35. public function system_add_column_family($cf_def);
  36. public function system_drop_column_family($column_family);
  37. public function system_add_keyspace($ks_def);
  38. public function system_drop_keyspace($keyspace);
  39. public function system_update_keyspace($ks_def);
  40. public function system_update_column_family($cf_def);
  41. public function execute_cql_query($query, $compression);
  42. }
  43. class cassandra_CassandraClient implements cassandra_CassandraIf {
  44. protected $input_ = null;
  45. protected $output_ = null;
  46. protected $seqid_ = 0;
  47. public function __construct($input, $output=null) {
  48. $this->input_ = $input;
  49. $this->output_ = $output ? $output : $input;
  50. }
  51. public function login($auth_request)
  52. {
  53. $this->send_login($auth_request);
  54. $this->recv_login();
  55. }
  56. public function send_login($auth_request)
  57. {
  58. $args = new cassandra_Cassandra_login_args();
  59. $args->auth_request = $auth_request;
  60. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  61. if ($bin_accel)
  62. {
  63. thrift_protocol_write_binary($this->output_, 'login', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  64. }
  65. else
  66. {
  67. $this->output_->writeMessageBegin('login', TMessageType::CALL, $this->seqid_);
  68. $args->write($this->output_);
  69. $this->output_->writeMessageEnd();
  70. $this->output_->getTransport()->flush();
  71. }
  72. }
  73. public function recv_login()
  74. {
  75. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  76. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_login_result', $this->input_->isStrictRead());
  77. else
  78. {
  79. $rseqid = 0;
  80. $fname = null;
  81. $mtype = 0;
  82. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  83. if ($mtype == TMessageType::EXCEPTION) {
  84. $x = new TApplicationException();
  85. $x->read($this->input_);
  86. $this->input_->readMessageEnd();
  87. throw $x;
  88. }
  89. $result = new cassandra_Cassandra_login_result();
  90. $result->read($this->input_);
  91. $this->input_->readMessageEnd();
  92. }
  93. if ($result->authnx !== null) {
  94. throw $result->authnx;
  95. }
  96. if ($result->authzx !== null) {
  97. throw $result->authzx;
  98. }
  99. return;
  100. }
  101. public function set_keyspace($keyspace)
  102. {
  103. $this->send_set_keyspace($keyspace);
  104. $this->recv_set_keyspace();
  105. }
  106. public function send_set_keyspace($keyspace)
  107. {
  108. $args = new cassandra_Cassandra_set_keyspace_args();
  109. $args->keyspace = $keyspace;
  110. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  111. if ($bin_accel)
  112. {
  113. thrift_protocol_write_binary($this->output_, 'set_keyspace', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  114. }
  115. else
  116. {
  117. $this->output_->writeMessageBegin('set_keyspace', TMessageType::CALL, $this->seqid_);
  118. $args->write($this->output_);
  119. $this->output_->writeMessageEnd();
  120. $this->output_->getTransport()->flush();
  121. }
  122. }
  123. public function recv_set_keyspace()
  124. {
  125. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  126. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_set_keyspace_result', $this->input_->isStrictRead());
  127. else
  128. {
  129. $rseqid = 0;
  130. $fname = null;
  131. $mtype = 0;
  132. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  133. if ($mtype == TMessageType::EXCEPTION) {
  134. $x = new TApplicationException();
  135. $x->read($this->input_);
  136. $this->input_->readMessageEnd();
  137. throw $x;
  138. }
  139. $result = new cassandra_Cassandra_set_keyspace_result();
  140. $result->read($this->input_);
  141. $this->input_->readMessageEnd();
  142. }
  143. if ($result->ire !== null) {
  144. throw $result->ire;
  145. }
  146. return;
  147. }
  148. public function get($key, $column_path, $consistency_level)
  149. {
  150. $this->send_get($key, $column_path, $consistency_level);
  151. return $this->recv_get();
  152. }
  153. public function send_get($key, $column_path, $consistency_level)
  154. {
  155. $args = new cassandra_Cassandra_get_args();
  156. $args->key = $key;
  157. $args->column_path = $column_path;
  158. $args->consistency_level = $consistency_level;
  159. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  160. if ($bin_accel)
  161. {
  162. thrift_protocol_write_binary($this->output_, 'get', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  163. }
  164. else
  165. {
  166. $this->output_->writeMessageBegin('get', TMessageType::CALL, $this->seqid_);
  167. $args->write($this->output_);
  168. $this->output_->writeMessageEnd();
  169. $this->output_->getTransport()->flush();
  170. }
  171. }
  172. public function recv_get()
  173. {
  174. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  175. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_get_result', $this->input_->isStrictRead());
  176. else
  177. {
  178. $rseqid = 0;
  179. $fname = null;
  180. $mtype = 0;
  181. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  182. if ($mtype == TMessageType::EXCEPTION) {
  183. $x = new TApplicationException();
  184. $x->read($this->input_);
  185. $this->input_->readMessageEnd();
  186. throw $x;
  187. }
  188. $result = new cassandra_Cassandra_get_result();
  189. $result->read($this->input_);
  190. $this->input_->readMessageEnd();
  191. }
  192. if ($result->success !== null) {
  193. return $result->success;
  194. }
  195. if ($result->ire !== null) {
  196. throw $result->ire;
  197. }
  198. if ($result->nfe !== null) {
  199. throw $result->nfe;
  200. }
  201. if ($result->ue !== null) {
  202. throw $result->ue;
  203. }
  204. if ($result->te !== null) {
  205. throw $result->te;
  206. }
  207. throw new Exception("get failed: unknown result");
  208. }
  209. public function get_slice($key, $column_parent, $predicate, $consistency_level)
  210. {
  211. $this->send_get_slice($key, $column_parent, $predicate, $consistency_level);
  212. return $this->recv_get_slice();
  213. }
  214. public function send_get_slice($key, $column_parent, $predicate, $consistency_level)
  215. {
  216. $args = new cassandra_Cassandra_get_slice_args();
  217. $args->key = $key;
  218. $args->column_parent = $column_parent;
  219. $args->predicate = $predicate;
  220. $args->consistency_level = $consistency_level;
  221. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  222. if ($bin_accel)
  223. {
  224. thrift_protocol_write_binary($this->output_, 'get_slice', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  225. }
  226. else
  227. {
  228. $this->output_->writeMessageBegin('get_slice', TMessageType::CALL, $this->seqid_);
  229. $args->write($this->output_);
  230. $this->output_->writeMessageEnd();
  231. $this->output_->getTransport()->flush();
  232. }
  233. }
  234. public function recv_get_slice()
  235. {
  236. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  237. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_get_slice_result', $this->input_->isStrictRead());
  238. else
  239. {
  240. $rseqid = 0;
  241. $fname = null;
  242. $mtype = 0;
  243. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  244. if ($mtype == TMessageType::EXCEPTION) {
  245. $x = new TApplicationException();
  246. $x->read($this->input_);
  247. $this->input_->readMessageEnd();
  248. throw $x;
  249. }
  250. $result = new cassandra_Cassandra_get_slice_result();
  251. $result->read($this->input_);
  252. $this->input_->readMessageEnd();
  253. }
  254. if ($result->success !== null) {
  255. return $result->success;
  256. }
  257. if ($result->ire !== null) {
  258. throw $result->ire;
  259. }
  260. if ($result->ue !== null) {
  261. throw $result->ue;
  262. }
  263. if ($result->te !== null) {
  264. throw $result->te;
  265. }
  266. throw new Exception("get_slice failed: unknown result");
  267. }
  268. public function get_count($key, $column_parent, $predicate, $consistency_level)
  269. {
  270. $this->send_get_count($key, $column_parent, $predicate, $consistency_level);
  271. return $this->recv_get_count();
  272. }
  273. public function send_get_count($key, $column_parent, $predicate, $consistency_level)
  274. {
  275. $args = new cassandra_Cassandra_get_count_args();
  276. $args->key = $key;
  277. $args->column_parent = $column_parent;
  278. $args->predicate = $predicate;
  279. $args->consistency_level = $consistency_level;
  280. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  281. if ($bin_accel)
  282. {
  283. thrift_protocol_write_binary($this->output_, 'get_count', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  284. }
  285. else
  286. {
  287. $this->output_->writeMessageBegin('get_count', TMessageType::CALL, $this->seqid_);
  288. $args->write($this->output_);
  289. $this->output_->writeMessageEnd();
  290. $this->output_->getTransport()->flush();
  291. }
  292. }
  293. public function recv_get_count()
  294. {
  295. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  296. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_get_count_result', $this->input_->isStrictRead());
  297. else
  298. {
  299. $rseqid = 0;
  300. $fname = null;
  301. $mtype = 0;
  302. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  303. if ($mtype == TMessageType::EXCEPTION) {
  304. $x = new TApplicationException();
  305. $x->read($this->input_);
  306. $this->input_->readMessageEnd();
  307. throw $x;
  308. }
  309. $result = new cassandra_Cassandra_get_count_result();
  310. $result->read($this->input_);
  311. $this->input_->readMessageEnd();
  312. }
  313. if ($result->success !== null) {
  314. return $result->success;
  315. }
  316. if ($result->ire !== null) {
  317. throw $result->ire;
  318. }
  319. if ($result->ue !== null) {
  320. throw $result->ue;
  321. }
  322. if ($result->te !== null) {
  323. throw $result->te;
  324. }
  325. throw new Exception("get_count failed: unknown result");
  326. }
  327. public function multiget_slice($keys, $column_parent, $predicate, $consistency_level)
  328. {
  329. $this->send_multiget_slice($keys, $column_parent, $predicate, $consistency_level);
  330. return $this->recv_multiget_slice();
  331. }
  332. public function send_multiget_slice($keys, $column_parent, $predicate, $consistency_level)
  333. {
  334. $args = new cassandra_Cassandra_multiget_slice_args();
  335. $args->keys = $keys;
  336. $args->column_parent = $column_parent;
  337. $args->predicate = $predicate;
  338. $args->consistency_level = $consistency_level;
  339. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  340. if ($bin_accel)
  341. {
  342. thrift_protocol_write_binary($this->output_, 'multiget_slice', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  343. }
  344. else
  345. {
  346. $this->output_->writeMessageBegin('multiget_slice', TMessageType::CALL, $this->seqid_);
  347. $args->write($this->output_);
  348. $this->output_->writeMessageEnd();
  349. $this->output_->getTransport()->flush();
  350. }
  351. }
  352. public function recv_multiget_slice()
  353. {
  354. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  355. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_multiget_slice_result', $this->input_->isStrictRead());
  356. else
  357. {
  358. $rseqid = 0;
  359. $fname = null;
  360. $mtype = 0;
  361. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  362. if ($mtype == TMessageType::EXCEPTION) {
  363. $x = new TApplicationException();
  364. $x->read($this->input_);
  365. $this->input_->readMessageEnd();
  366. throw $x;
  367. }
  368. $result = new cassandra_Cassandra_multiget_slice_result();
  369. $result->read($this->input_);
  370. $this->input_->readMessageEnd();
  371. }
  372. if ($result->success !== null) {
  373. return $result->success;
  374. }
  375. if ($result->ire !== null) {
  376. throw $result->ire;
  377. }
  378. if ($result->ue !== null) {
  379. throw $result->ue;
  380. }
  381. if ($result->te !== null) {
  382. throw $result->te;
  383. }
  384. throw new Exception("multiget_slice failed: unknown result");
  385. }
  386. public function multiget_count($keys, $column_parent, $predicate, $consistency_level)
  387. {
  388. $this->send_multiget_count($keys, $column_parent, $predicate, $consistency_level);
  389. return $this->recv_multiget_count();
  390. }
  391. public function send_multiget_count($keys, $column_parent, $predicate, $consistency_level)
  392. {
  393. $args = new cassandra_Cassandra_multiget_count_args();
  394. $args->keys = $keys;
  395. $args->column_parent = $column_parent;
  396. $args->predicate = $predicate;
  397. $args->consistency_level = $consistency_level;
  398. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  399. if ($bin_accel)
  400. {
  401. thrift_protocol_write_binary($this->output_, 'multiget_count', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  402. }
  403. else
  404. {
  405. $this->output_->writeMessageBegin('multiget_count', TMessageType::CALL, $this->seqid_);
  406. $args->write($this->output_);
  407. $this->output_->writeMessageEnd();
  408. $this->output_->getTransport()->flush();
  409. }
  410. }
  411. public function recv_multiget_count()
  412. {
  413. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  414. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_multiget_count_result', $this->input_->isStrictRead());
  415. else
  416. {
  417. $rseqid = 0;
  418. $fname = null;
  419. $mtype = 0;
  420. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  421. if ($mtype == TMessageType::EXCEPTION) {
  422. $x = new TApplicationException();
  423. $x->read($this->input_);
  424. $this->input_->readMessageEnd();
  425. throw $x;
  426. }
  427. $result = new cassandra_Cassandra_multiget_count_result();
  428. $result->read($this->input_);
  429. $this->input_->readMessageEnd();
  430. }
  431. if ($result->success !== null) {
  432. return $result->success;
  433. }
  434. if ($result->ire !== null) {
  435. throw $result->ire;
  436. }
  437. if ($result->ue !== null) {
  438. throw $result->ue;
  439. }
  440. if ($result->te !== null) {
  441. throw $result->te;
  442. }
  443. throw new Exception("multiget_count failed: unknown result");
  444. }
  445. public function get_range_slices($column_parent, $predicate, $range, $consistency_level)
  446. {
  447. $this->send_get_range_slices($column_parent, $predicate, $range, $consistency_level);
  448. return $this->recv_get_range_slices();
  449. }
  450. public function send_get_range_slices($column_parent, $predicate, $range, $consistency_level)
  451. {
  452. $args = new cassandra_Cassandra_get_range_slices_args();
  453. $args->column_parent = $column_parent;
  454. $args->predicate = $predicate;
  455. $args->range = $range;
  456. $args->consistency_level = $consistency_level;
  457. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  458. if ($bin_accel)
  459. {
  460. thrift_protocol_write_binary($this->output_, 'get_range_slices', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  461. }
  462. else
  463. {
  464. $this->output_->writeMessageBegin('get_range_slices', TMessageType::CALL, $this->seqid_);
  465. $args->write($this->output_);
  466. $this->output_->writeMessageEnd();
  467. $this->output_->getTransport()->flush();
  468. }
  469. }
  470. public function recv_get_range_slices()
  471. {
  472. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  473. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_get_range_slices_result', $this->input_->isStrictRead());
  474. else
  475. {
  476. $rseqid = 0;
  477. $fname = null;
  478. $mtype = 0;
  479. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  480. if ($mtype == TMessageType::EXCEPTION) {
  481. $x = new TApplicationException();
  482. $x->read($this->input_);
  483. $this->input_->readMessageEnd();
  484. throw $x;
  485. }
  486. $result = new cassandra_Cassandra_get_range_slices_result();
  487. $result->read($this->input_);
  488. $this->input_->readMessageEnd();
  489. }
  490. if ($result->success !== null) {
  491. return $result->success;
  492. }
  493. if ($result->ire !== null) {
  494. throw $result->ire;
  495. }
  496. if ($result->ue !== null) {
  497. throw $result->ue;
  498. }
  499. if ($result->te !== null) {
  500. throw $result->te;
  501. }
  502. throw new Exception("get_range_slices failed: unknown result");
  503. }
  504. public function get_indexed_slices($column_parent, $index_clause, $column_predicate, $consistency_level)
  505. {
  506. $this->send_get_indexed_slices($column_parent, $index_clause, $column_predicate, $consistency_level);
  507. return $this->recv_get_indexed_slices();
  508. }
  509. public function send_get_indexed_slices($column_parent, $index_clause, $column_predicate, $consistency_level)
  510. {
  511. $args = new cassandra_Cassandra_get_indexed_slices_args();
  512. $args->column_parent = $column_parent;
  513. $args->index_clause = $index_clause;
  514. $args->column_predicate = $column_predicate;
  515. $args->consistency_level = $consistency_level;
  516. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  517. if ($bin_accel)
  518. {
  519. thrift_protocol_write_binary($this->output_, 'get_indexed_slices', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  520. }
  521. else
  522. {
  523. $this->output_->writeMessageBegin('get_indexed_slices', TMessageType::CALL, $this->seqid_);
  524. $args->write($this->output_);
  525. $this->output_->writeMessageEnd();
  526. $this->output_->getTransport()->flush();
  527. }
  528. }
  529. public function recv_get_indexed_slices()
  530. {
  531. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  532. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_get_indexed_slices_result', $this->input_->isStrictRead());
  533. else
  534. {
  535. $rseqid = 0;
  536. $fname = null;
  537. $mtype = 0;
  538. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  539. if ($mtype == TMessageType::EXCEPTION) {
  540. $x = new TApplicationException();
  541. $x->read($this->input_);
  542. $this->input_->readMessageEnd();
  543. throw $x;
  544. }
  545. $result = new cassandra_Cassandra_get_indexed_slices_result();
  546. $result->read($this->input_);
  547. $this->input_->readMessageEnd();
  548. }
  549. if ($result->success !== null) {
  550. return $result->success;
  551. }
  552. if ($result->ire !== null) {
  553. throw $result->ire;
  554. }
  555. if ($result->ue !== null) {
  556. throw $result->ue;
  557. }
  558. if ($result->te !== null) {
  559. throw $result->te;
  560. }
  561. throw new Exception("get_indexed_slices failed: unknown result");
  562. }
  563. public function insert($key, $column_parent, $column, $consistency_level)
  564. {
  565. $this->send_insert($key, $column_parent, $column, $consistency_level);
  566. $this->recv_insert();
  567. }
  568. public function send_insert($key, $column_parent, $column, $consistency_level)
  569. {
  570. $args = new cassandra_Cassandra_insert_args();
  571. $args->key = $key;
  572. $args->column_parent = $column_parent;
  573. $args->column = $column;
  574. $args->consistency_level = $consistency_level;
  575. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  576. if ($bin_accel)
  577. {
  578. thrift_protocol_write_binary($this->output_, 'insert', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  579. }
  580. else
  581. {
  582. $this->output_->writeMessageBegin('insert', TMessageType::CALL, $this->seqid_);
  583. $args->write($this->output_);
  584. $this->output_->writeMessageEnd();
  585. $this->output_->getTransport()->flush();
  586. }
  587. }
  588. public function recv_insert()
  589. {
  590. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  591. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_insert_result', $this->input_->isStrictRead());
  592. else
  593. {
  594. $rseqid = 0;
  595. $fname = null;
  596. $mtype = 0;
  597. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  598. if ($mtype == TMessageType::EXCEPTION) {
  599. $x = new TApplicationException();
  600. $x->read($this->input_);
  601. $this->input_->readMessageEnd();
  602. throw $x;
  603. }
  604. $result = new cassandra_Cassandra_insert_result();
  605. $result->read($this->input_);
  606. $this->input_->readMessageEnd();
  607. }
  608. if ($result->ire !== null) {
  609. throw $result->ire;
  610. }
  611. if ($result->ue !== null) {
  612. throw $result->ue;
  613. }
  614. if ($result->te !== null) {
  615. throw $result->te;
  616. }
  617. return;
  618. }
  619. public function add($key, $column_parent, $column, $consistency_level)
  620. {
  621. $this->send_add($key, $column_parent, $column, $consistency_level);
  622. $this->recv_add();
  623. }
  624. public function send_add($key, $column_parent, $column, $consistency_level)
  625. {
  626. $args = new cassandra_Cassandra_add_args();
  627. $args->key = $key;
  628. $args->column_parent = $column_parent;
  629. $args->column = $column;
  630. $args->consistency_level = $consistency_level;
  631. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  632. if ($bin_accel)
  633. {
  634. thrift_protocol_write_binary($this->output_, 'add', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  635. }
  636. else
  637. {
  638. $this->output_->writeMessageBegin('add', TMessageType::CALL, $this->seqid_);
  639. $args->write($this->output_);
  640. $this->output_->writeMessageEnd();
  641. $this->output_->getTransport()->flush();
  642. }
  643. }
  644. public function recv_add()
  645. {
  646. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  647. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_add_result', $this->input_->isStrictRead());
  648. else
  649. {
  650. $rseqid = 0;
  651. $fname = null;
  652. $mtype = 0;
  653. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  654. if ($mtype == TMessageType::EXCEPTION) {
  655. $x = new TApplicationException();
  656. $x->read($this->input_);
  657. $this->input_->readMessageEnd();
  658. throw $x;
  659. }
  660. $result = new cassandra_Cassandra_add_result();
  661. $result->read($this->input_);
  662. $this->input_->readMessageEnd();
  663. }
  664. if ($result->ire !== null) {
  665. throw $result->ire;
  666. }
  667. if ($result->ue !== null) {
  668. throw $result->ue;
  669. }
  670. if ($result->te !== null) {
  671. throw $result->te;
  672. }
  673. return;
  674. }
  675. public function remove($key, $column_path, $timestamp, $consistency_level)
  676. {
  677. $this->send_remove($key, $column_path, $timestamp, $consistency_level);
  678. $this->recv_remove();
  679. }
  680. public function send_remove($key, $column_path, $timestamp, $consistency_level)
  681. {
  682. $args = new cassandra_Cassandra_remove_args();
  683. $args->key = $key;
  684. $args->column_path = $column_path;
  685. $args->timestamp = $timestamp;
  686. $args->consistency_level = $consistency_level;
  687. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  688. if ($bin_accel)
  689. {
  690. thrift_protocol_write_binary($this->output_, 'remove', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  691. }
  692. else
  693. {
  694. $this->output_->writeMessageBegin('remove', TMessageType::CALL, $this->seqid_);
  695. $args->write($this->output_);
  696. $this->output_->writeMessageEnd();
  697. $this->output_->getTransport()->flush();
  698. }
  699. }
  700. public function recv_remove()
  701. {
  702. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  703. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_remove_result', $this->input_->isStrictRead());
  704. else
  705. {
  706. $rseqid = 0;
  707. $fname = null;
  708. $mtype = 0;
  709. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  710. if ($mtype == TMessageType::EXCEPTION) {
  711. $x = new TApplicationException();
  712. $x->read($this->input_);
  713. $this->input_->readMessageEnd();
  714. throw $x;
  715. }
  716. $result = new cassandra_Cassandra_remove_result();
  717. $result->read($this->input_);
  718. $this->input_->readMessageEnd();
  719. }
  720. if ($result->ire !== null) {
  721. throw $result->ire;
  722. }
  723. if ($result->ue !== null) {
  724. throw $result->ue;
  725. }
  726. if ($result->te !== null) {
  727. throw $result->te;
  728. }
  729. return;
  730. }
  731. public function remove_counter($key, $path, $consistency_level)
  732. {
  733. $this->send_remove_counter($key, $path, $consistency_level);
  734. $this->recv_remove_counter();
  735. }
  736. public function send_remove_counter($key, $path, $consistency_level)
  737. {
  738. $args = new cassandra_Cassandra_remove_counter_args();
  739. $args->key = $key;
  740. $args->path = $path;
  741. $args->consistency_level = $consistency_level;
  742. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  743. if ($bin_accel)
  744. {
  745. thrift_protocol_write_binary($this->output_, 'remove_counter', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  746. }
  747. else
  748. {
  749. $this->output_->writeMessageBegin('remove_counter', TMessageType::CALL, $this->seqid_);
  750. $args->write($this->output_);
  751. $this->output_->writeMessageEnd();
  752. $this->output_->getTransport()->flush();
  753. }
  754. }
  755. public function recv_remove_counter()
  756. {
  757. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  758. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_remove_counter_result', $this->input_->isStrictRead());
  759. else
  760. {
  761. $rseqid = 0;
  762. $fname = null;
  763. $mtype = 0;
  764. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  765. if ($mtype == TMessageType::EXCEPTION) {
  766. $x = new TApplicationException();
  767. $x->read($this->input_);
  768. $this->input_->readMessageEnd();
  769. throw $x;
  770. }
  771. $result = new cassandra_Cassandra_remove_counter_result();
  772. $result->read($this->input_);
  773. $this->input_->readMessageEnd();
  774. }
  775. if ($result->ire !== null) {
  776. throw $result->ire;
  777. }
  778. if ($result->ue !== null) {
  779. throw $result->ue;
  780. }
  781. if ($result->te !== null) {
  782. throw $result->te;
  783. }
  784. return;
  785. }
  786. public function batch_mutate($mutation_map, $consistency_level)
  787. {
  788. $this->send_batch_mutate($mutation_map, $consistency_level);
  789. $this->recv_batch_mutate();
  790. }
  791. public function send_batch_mutate($mutation_map, $consistency_level)
  792. {
  793. $args = new cassandra_Cassandra_batch_mutate_args();
  794. $args->mutation_map = $mutation_map;
  795. $args->consistency_level = $consistency_level;
  796. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  797. if ($bin_accel)
  798. {
  799. thrift_protocol_write_binary($this->output_, 'batch_mutate', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  800. }
  801. else
  802. {
  803. $this->output_->writeMessageBegin('batch_mutate', TMessageType::CALL, $this->seqid_);
  804. $args->write($this->output_);
  805. $this->output_->writeMessageEnd();
  806. $this->output_->getTransport()->flush();
  807. }
  808. }
  809. public function recv_batch_mutate()
  810. {
  811. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  812. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_batch_mutate_result', $this->input_->isStrictRead());
  813. else
  814. {
  815. $rseqid = 0;
  816. $fname = null;
  817. $mtype = 0;
  818. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  819. if ($mtype == TMessageType::EXCEPTION) {
  820. $x = new TApplicationException();
  821. $x->read($this->input_);
  822. $this->input_->readMessageEnd();
  823. throw $x;
  824. }
  825. $result = new cassandra_Cassandra_batch_mutate_result();
  826. $result->read($this->input_);
  827. $this->input_->readMessageEnd();
  828. }
  829. if ($result->ire !== null) {
  830. throw $result->ire;
  831. }
  832. if ($result->ue !== null) {
  833. throw $result->ue;
  834. }
  835. if ($result->te !== null) {
  836. throw $result->te;
  837. }
  838. return;
  839. }
  840. public function truncate($cfname)
  841. {
  842. $this->send_truncate($cfname);
  843. $this->recv_truncate();
  844. }
  845. public function send_truncate($cfname)
  846. {
  847. $args = new cassandra_Cassandra_truncate_args();
  848. $args->cfname = $cfname;
  849. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  850. if ($bin_accel)
  851. {
  852. thrift_protocol_write_binary($this->output_, 'truncate', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  853. }
  854. else
  855. {
  856. $this->output_->writeMessageBegin('truncate', TMessageType::CALL, $this->seqid_);
  857. $args->write($this->output_);
  858. $this->output_->writeMessageEnd();
  859. $this->output_->getTransport()->flush();
  860. }
  861. }
  862. public function recv_truncate()
  863. {
  864. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  865. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_truncate_result', $this->input_->isStrictRead());
  866. else
  867. {
  868. $rseqid = 0;
  869. $fname = null;
  870. $mtype = 0;
  871. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  872. if ($mtype == TMessageType::EXCEPTION) {
  873. $x = new TApplicationException();
  874. $x->read($this->input_);
  875. $this->input_->readMessageEnd();
  876. throw $x;
  877. }
  878. $result = new cassandra_Cassandra_truncate_result();
  879. $result->read($this->input_);
  880. $this->input_->readMessageEnd();
  881. }
  882. if ($result->ire !== null) {
  883. throw $result->ire;
  884. }
  885. if ($result->ue !== null) {
  886. throw $result->ue;
  887. }
  888. return;
  889. }
  890. public function describe_schema_versions()
  891. {
  892. $this->send_describe_schema_versions();
  893. return $this->recv_describe_schema_versions();
  894. }
  895. public function send_describe_schema_versions()
  896. {
  897. $args = new cassandra_Cassandra_describe_schema_versions_args();
  898. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  899. if ($bin_accel)
  900. {
  901. thrift_protocol_write_binary($this->output_, 'describe_schema_versions', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  902. }
  903. else
  904. {
  905. $this->output_->writeMessageBegin('describe_schema_versions', TMessageType::CALL, $this->seqid_);
  906. $args->write($this->output_);
  907. $this->output_->writeMessageEnd();
  908. $this->output_->getTransport()->flush();
  909. }
  910. }
  911. public function recv_describe_schema_versions()
  912. {
  913. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  914. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_describe_schema_versions_result', $this->input_->isStrictRead());
  915. else
  916. {
  917. $rseqid = 0;
  918. $fname = null;
  919. $mtype = 0;
  920. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  921. if ($mtype == TMessageType::EXCEPTION) {
  922. $x = new TApplicationException();
  923. $x->read($this->input_);
  924. $this->input_->readMessageEnd();
  925. throw $x;
  926. }
  927. $result = new cassandra_Cassandra_describe_schema_versions_result();
  928. $result->read($this->input_);
  929. $this->input_->readMessageEnd();
  930. }
  931. if ($result->success !== null) {
  932. return $result->success;
  933. }
  934. if ($result->ire !== null) {
  935. throw $result->ire;
  936. }
  937. throw new Exception("describe_schema_versions failed: unknown result");
  938. }
  939. public function describe_keyspaces()
  940. {
  941. $this->send_describe_keyspaces();
  942. return $this->recv_describe_keyspaces();
  943. }
  944. public function send_describe_keyspaces()
  945. {
  946. $args = new cassandra_Cassandra_describe_keyspaces_args();
  947. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  948. if ($bin_accel)
  949. {
  950. thrift_protocol_write_binary($this->output_, 'describe_keyspaces', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  951. }
  952. else
  953. {
  954. $this->output_->writeMessageBegin('describe_keyspaces', TMessageType::CALL, $this->seqid_);
  955. $args->write($this->output_);
  956. $this->output_->writeMessageEnd();
  957. $this->output_->getTransport()->flush();
  958. }
  959. }
  960. public function recv_describe_keyspaces()
  961. {
  962. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  963. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_describe_keyspaces_result', $this->input_->isStrictRead());
  964. else
  965. {
  966. $rseqid = 0;
  967. $fname = null;
  968. $mtype = 0;
  969. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  970. if ($mtype == TMessageType::EXCEPTION) {
  971. $x = new TApplicationException();
  972. $x->read($this->input_);
  973. $this->input_->readMessageEnd();
  974. throw $x;
  975. }
  976. $result = new cassandra_Cassandra_describe_keyspaces_result();
  977. $result->read($this->input_);
  978. $this->input_->readMessageEnd();
  979. }
  980. if ($result->success !== null) {
  981. return $result->success;
  982. }
  983. if ($result->ire !== null) {
  984. throw $result->ire;
  985. }
  986. throw new Exception("describe_keyspaces failed: unknown result");
  987. }
  988. public function describe_cluster_name()
  989. {
  990. $this->send_describe_cluster_name();
  991. return $this->recv_describe_cluster_name();
  992. }
  993. public function send_describe_cluster_name()
  994. {
  995. $args = new cassandra_Cassandra_describe_cluster_name_args();
  996. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  997. if ($bin_accel)
  998. {
  999. thrift_protocol_write_binary($this->output_, 'describe_cluster_name', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  1000. }
  1001. else
  1002. {
  1003. $this->output_->writeMessageBegin('describe_cluster_name', TMessageType::CALL, $this->seqid_);
  1004. $args->write($this->output_);
  1005. $this->output_->writeMessageEnd();
  1006. $this->output_->getTransport()->flush();
  1007. }
  1008. }
  1009. public function recv_describe_cluster_name()
  1010. {
  1011. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  1012. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_describe_cluster_name_result', $this->input_->isStrictRead());
  1013. else
  1014. {
  1015. $rseqid = 0;
  1016. $fname = null;
  1017. $mtype = 0;
  1018. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  1019. if ($mtype == TMessageType::EXCEPTION) {
  1020. $x = new TApplicationException();
  1021. $x->read($this->input_);
  1022. $this->input_->readMessageEnd();
  1023. throw $x;
  1024. }
  1025. $result = new cassandra_Cassandra_describe_cluster_name_result();
  1026. $result->read($this->input_);
  1027. $this->input_->readMessageEnd();
  1028. }
  1029. if ($result->success !== null) {
  1030. return $result->success;
  1031. }
  1032. throw new Exception("describe_cluster_name failed: unknown result");
  1033. }
  1034. public function describe_version()
  1035. {
  1036. $this->send_describe_version();
  1037. return $this->recv_describe_version();
  1038. }
  1039. public function send_describe_version()
  1040. {
  1041. $args = new cassandra_Cassandra_describe_version_args();
  1042. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  1043. if ($bin_accel)
  1044. {
  1045. thrift_protocol_write_binary($this->output_, 'describe_version', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  1046. }
  1047. else
  1048. {
  1049. $this->output_->writeMessageBegin('describe_version', TMessageType::CALL, $this->seqid_);
  1050. $args->write($this->output_);
  1051. $this->output_->writeMessageEnd();
  1052. $this->output_->getTransport()->flush();
  1053. }
  1054. }
  1055. public function recv_describe_version()
  1056. {
  1057. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  1058. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_describe_version_result', $this->input_->isStrictRead());
  1059. else
  1060. {
  1061. $rseqid = 0;
  1062. $fname = null;
  1063. $mtype = 0;
  1064. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  1065. if ($mtype == TMessageType::EXCEPTION) {
  1066. $x = new TApplicationException();
  1067. $x->read($this->input_);
  1068. $this->input_->readMessageEnd();
  1069. throw $x;
  1070. }
  1071. $result = new cassandra_Cassandra_describe_version_result();
  1072. $result->read($this->input_);
  1073. $this->input_->readMessageEnd();
  1074. }
  1075. if ($result->success !== null) {
  1076. return $result->success;
  1077. }
  1078. throw new Exception("describe_version failed: unknown result");
  1079. }
  1080. public function describe_ring($keyspace)
  1081. {
  1082. $this->send_describe_ring($keyspace);
  1083. return $this->recv_describe_ring();
  1084. }
  1085. public function send_describe_ring($keyspace)
  1086. {
  1087. $args = new cassandra_Cassandra_describe_ring_args();
  1088. $args->keyspace = $keyspace;
  1089. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  1090. if ($bin_accel)
  1091. {
  1092. thrift_protocol_write_binary($this->output_, 'describe_ring', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  1093. }
  1094. else
  1095. {
  1096. $this->output_->writeMessageBegin('describe_ring', TMessageType::CALL, $this->seqid_);
  1097. $args->write($this->output_);
  1098. $this->output_->writeMessageEnd();
  1099. $this->output_->getTransport()->flush();
  1100. }
  1101. }
  1102. public function recv_describe_ring()
  1103. {
  1104. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  1105. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_describe_ring_result', $this->input_->isStrictRead());
  1106. else
  1107. {
  1108. $rseqid = 0;
  1109. $fname = null;
  1110. $mtype = 0;
  1111. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  1112. if ($mtype == TMessageType::EXCEPTION) {
  1113. $x = new TApplicationException();
  1114. $x->read($this->input_);
  1115. $this->input_->readMessageEnd();
  1116. throw $x;
  1117. }
  1118. $result = new cassandra_Cassandra_describe_ring_result();
  1119. $result->read($this->input_);
  1120. $this->input_->readMessageEnd();
  1121. }
  1122. if ($result->success !== null) {
  1123. return $result->success;
  1124. }
  1125. if ($result->ire !== null) {
  1126. throw $result->ire;
  1127. }
  1128. throw new Exception("describe_ring failed: unknown result");
  1129. }
  1130. public function describe_partitioner()
  1131. {
  1132. $this->send_describe_partitioner();
  1133. return $this->recv_describe_partitioner();
  1134. }
  1135. public function send_describe_partitioner()
  1136. {
  1137. $args = new cassandra_Cassandra_describe_partitioner_args();
  1138. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  1139. if ($bin_accel)
  1140. {
  1141. thrift_protocol_write_binary($this->output_, 'describe_partitioner', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  1142. }
  1143. else
  1144. {
  1145. $this->output_->writeMessageBegin('describe_partitioner', TMessageType::CALL, $this->seqid_);
  1146. $args->write($this->output_);
  1147. $this->output_->writeMessageEnd();
  1148. $this->output_->getTransport()->flush();
  1149. }
  1150. }
  1151. public function recv_describe_partitioner()
  1152. {
  1153. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  1154. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_describe_partitioner_result', $this->input_->isStrictRead());
  1155. else
  1156. {
  1157. $rseqid = 0;
  1158. $fname = null;
  1159. $mtype = 0;
  1160. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  1161. if ($mtype == TMessageType::EXCEPTION) {
  1162. $x = new TApplicationException();
  1163. $x->read($this->input_);
  1164. $this->input_->readMessageEnd();
  1165. throw $x;
  1166. }
  1167. $result = new cassandra_Cassandra_describe_partitioner_result();
  1168. $result->read($this->input_);
  1169. $this->input_->readMessageEnd();
  1170. }
  1171. if ($result->success !== null) {
  1172. return $result->success;
  1173. }
  1174. throw new Exception("describe_partitioner failed: unknown result");
  1175. }
  1176. public function describe_snitch()
  1177. {
  1178. $this->send_describe_snitch();
  1179. return $this->recv_describe_snitch();
  1180. }
  1181. public function send_describe_snitch()
  1182. {
  1183. $args = new cassandra_Cassandra_describe_snitch_args();
  1184. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  1185. if ($bin_accel)
  1186. {
  1187. thrift_protocol_write_binary($this->output_, 'describe_snitch', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  1188. }
  1189. else
  1190. {
  1191. $this->output_->writeMessageBegin('describe_snitch', TMessageType::CALL, $this->seqid_);
  1192. $args->write($this->output_);
  1193. $this->output_->writeMessageEnd();
  1194. $this->output_->getTransport()->flush();
  1195. }
  1196. }
  1197. public function recv_describe_snitch()
  1198. {
  1199. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  1200. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_describe_snitch_result', $this->input_->isStrictRead());
  1201. else
  1202. {
  1203. $rseqid = 0;
  1204. $fname = null;
  1205. $mtype = 0;
  1206. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  1207. if ($mtype == TMessageType::EXCEPTION) {
  1208. $x = new TApplicationException();
  1209. $x->read($this->input_);
  1210. $this->input_->readMessageEnd();
  1211. throw $x;
  1212. }
  1213. $result = new cassandra_Cassandra_describe_snitch_result();
  1214. $result->read($this->input_);
  1215. $this->input_->readMessageEnd();
  1216. }
  1217. if ($result->success !== null) {
  1218. return $result->success;
  1219. }
  1220. throw new Exception("describe_snitch failed: unknown result");
  1221. }
  1222. public function describe_keyspace($keyspace)
  1223. {
  1224. $this->send_describe_keyspace($keyspace);
  1225. return $this->recv_describe_keyspace();
  1226. }
  1227. public function send_describe_keyspace($keyspace)
  1228. {
  1229. $args = new cassandra_Cassandra_describe_keyspace_args();
  1230. $args->keyspace = $keyspace;
  1231. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  1232. if ($bin_accel)
  1233. {
  1234. thrift_protocol_write_binary($this->output_, 'describe_keyspace', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  1235. }
  1236. else
  1237. {
  1238. $this->output_->writeMessageBegin('describe_keyspace', TMessageType::CALL, $this->seqid_);
  1239. $args->write($this->output_);
  1240. $this->output_->writeMessageEnd();
  1241. $this->output_->getTransport()->flush();
  1242. }
  1243. }
  1244. public function recv_describe_keyspace()
  1245. {
  1246. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  1247. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_describe_keyspace_result', $this->input_->isStrictRead());
  1248. else
  1249. {
  1250. $rseqid = 0;
  1251. $fname = null;
  1252. $mtype = 0;
  1253. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  1254. if ($mtype == TMessageType::EXCEPTION) {
  1255. $x = new TApplicationException();
  1256. $x->read($this->input_);
  1257. $this->input_->readMessageEnd();
  1258. throw $x;
  1259. }
  1260. $result = new cassandra_Cassandra_describe_keyspace_result();
  1261. $result->read($this->input_);
  1262. $this->input_->readMessageEnd();
  1263. }
  1264. if ($result->success !== null) {
  1265. return $result->success;
  1266. }
  1267. if ($result->nfe !== null) {
  1268. throw $result->nfe;
  1269. }
  1270. if ($result->ire !== null) {
  1271. throw $result->ire;
  1272. }
  1273. throw new Exception("describe_keyspace failed: unknown result");
  1274. }
  1275. public function describe_splits($cfName, $start_token, $end_token, $keys_per_split)
  1276. {
  1277. $this->send_describe_splits($cfName, $start_token, $end_token, $keys_per_split);
  1278. return $this->recv_describe_splits();
  1279. }
  1280. public function send_describe_splits($cfName, $start_token, $end_token, $keys_per_split)
  1281. {
  1282. $args = new cassandra_Cassandra_describe_splits_args();
  1283. $args->cfName = $cfName;
  1284. $args->start_token = $start_token;
  1285. $args->end_token = $end_token;
  1286. $args->keys_per_split = $keys_per_split;
  1287. $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
  1288. if ($bin_accel)
  1289. {
  1290. thrift_protocol_write_binary($this->output_, 'describe_splits', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  1291. }
  1292. else
  1293. {
  1294. $this->output_->writeMessageBegin('describe_splits', TMessageType::CALL, $this->seqid_);
  1295. $args->write($this->output_);
  1296. $this->output_->writeMessageEnd();
  1297. $this->output_->getTransport()->flush();
  1298. }
  1299. }
  1300. public function recv_describe_splits()
  1301. {
  1302. $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
  1303. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'cassandra_Cassandra_describe_splits_result', $this->input_->isStrictRead());
  1304. else
  1305. {
  1306. $rseqid = 0;
  1307. $fname = null;
  1308. $mtype = 0;
  1309. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  1310. if ($mtype == TMessageType::EXCEPTION) {
  1311. $x = new TApplicationException();
  1312. $x->read($this->input_);
  1313. $this->input_->readMessageEnd();
  1314. throw $x;
  1315. }
  1316. $result = new cassandra_Cassandra_describe_splits_result();
  1317. $result->read($this->input_);
  1318. $this->input_->readMessageEnd();
  1319. }
  1320. if ($result->success !== null) {
  1321. return $result->success;
  1322. }
  1323. if ($result->ire !== null) {
  1324. throw $result->ire;
  1325. }
  1326. throw new Exception("describe_splits failed: unknown result");
  1327. }
  1328. public function system_add_column_family($cf_def)
  1329. {
  1330. $this->send_system_add_column_family($cf_def);
  1331. return $this->recv_system_add_column_family();
  1332. }
  1333. public function send_system_add_column_family($cf_def)
  1334. {
  1335. $args = new cassandra_Cassandra_system_add_column_family_args();
  1336. $args->cf_def = $

Large files files are truncated, but you can click here to view the full file