[ 
https://issues.apache.org/jira/browse/CASSANDRA-7688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14307108#comment-14307108
 ] 

Piotr Kołaczkowski commented on CASSANDRA-7688:
-----------------------------------------------

Looks good.

{code}
       // delete all previous values with a single range tombstone.
        mutation.deleteRange(SIZE_ESTIMATES_CF,
                             estimatesTable.comparator.make(table).start(),
                             estimatesTable.comparator.make(table).end(),
                             timestamp - 1);

        // add a CQL row for each primary token range.
        ColumnFamily cells = mutation.addOrGet(estimatesTable);
        for (Map.Entry<Range<Token>, Pair<Long, Long>> entry : 
estimates.entrySet())
        {
            Range<Token> range = entry.getKey();
            Pair<Long, Long> values = entry.getValue();
            Composite prefix = estimatesTable.comparator.make(table, 
range.left.toString(), range.right.toString());
            CFRowAdder adder = new CFRowAdder(cells, prefix, timestamp);
            adder.add("partitions_count", values.left)
                 .add("mean_partition_size", values.right);
        }

        mutation.apply();
{code}

Are updates of the table atomic? I can see you delete a whole bunch of token 
ranges with one tombstone and than add one by one. Is it possible to get an 
incomplete table when querying at the wrong moment?

> Add data sizing to a system table
> ---------------------------------
>
>                 Key: CASSANDRA-7688
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7688
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Jeremiah Jordan
>            Assignee: Aleksey Yeschenko
>             Fix For: 2.1.3
>
>         Attachments: 7688.txt
>
>
> Currently you can't implement something similar to describe_splits_ex purely 
> from the a native protocol driver.  
> https://datastax-oss.atlassian.net/browse/JAVA-312 is open to expose easily 
> getting ownership information to a client in the java-driver.  But you still 
> need the data sizing part to get splits of a given size.  We should add the 
> sizing information to a system table so that native clients can get to it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to