php - Row Iteration not working -
My goal is to redo all the rows in the node in a specific column.
Here is the PHP code my cover on Phpcassa):
$ ring = $ cass_db-> description_ ring (); Forex Currency ($ Ring_details as Ring $) {$ start_token = $ ring_details-> Start_token; $ End_token = $ ring_details-> End_token; If ($ start_token! = Null & amp; $ end_token! = Null) {$ i = 0; $ Batch_size = 10; $ Params = array ('token_start' = & gt; $ start_token, 'token_finish' = & gt; $ end_token, 'row_count' = & gt; $ batch_size, 'buffer_size' => 1000); While ($ batch = $ cass_db- & gt; get_range_by_token ('myColumnFamily', $ params)) {var_dump ('batch #'. $ I); Forex Currency ($ batch $ as line) {$ row_key = $ line [0]; $ Row_values = $ line [1]; Var_dump ($ row_key); } $ I ++; // To prevent endless loop if ($ i> 14) {die (); }}}}
- get_range_by_token () uses the default parameter overwritten by $ params
I have the same 10 line keys in each batch Meet.
How to reinforce all the existing rows in the large CASDRA DB?
I'm not a PHP developer, so I can do something wrong in your code. Plus, you have not specified which spring version you are using.
Normally the change on all the lines starts and ends with an empty token, and redefines the start token in each iteration. In your code I can not see that you redefine token_start in each iteration. If you do not redefine it, then you are asking for the same category of tokens each time and you will always get the same result.
Your code should do something like this ...
start_token = ''; End_token = ''; Page_sys = 100; Whereas (get_range_by_token ('cf', start_token, end_token, page_size) {// Here I should get page_sys lines (unless I'm not on a previous trip or table row is smaller than page_size elements) start_token = rows [ Rows.size ()] .getKey ();}
html, carlo
Comments
Post a Comment