You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Murukesh Mohanan <mu...@gmail.com> on 2017/01/24 10:42:17 UTC

Showing a new property in DESCRIBE TABLE output

I'm having a go at CASSANDRA-13002 (
https://issues.apache.org/jira/browse/CASSANDRA-12403), by adding a new
table property which will override the global slow_query_log_timeout_in_ms
setting. It works, but I can't get it to show up in cqlsh DESCRIBE TABLE
output. For example, this is what I get:

cqlsh> DESCRIBE TABLE foo.bar;

CREATE TABLE foo.bar (
    id uuid PRIMARY KEY,
    name text
) WITH bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND cdc = true
    AND comment = ''
    AND compaction = {'class':
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class':
'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 1001
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';

cqlsh> select table_name, slow_query_log_timeout_in_ms from
system_schema.tables  where table_name = 'bar' allow filtering;

 table_name | slow_query_log_timeout_in_ms
------------+------------------------------
        bar |                          103

The property (which is also called `slow_query_log_timeout_in_ms`) shows up
in the system_schema table.

It seems that the file to modify would be
src/java/org/apache/cassandra/db/ColumnFamilyStoreCQLHelper.java, but I
didn't have any luck modifying it.

Any pointers, please?



-- 

Murukesh Mohanan,
Yahoo! Japan

Re: Showing a new property in DESCRIBE TABLE output

Posted by Murukesh Mohanan <mu...@gmail.com>.
Yes, that was it. The file to modify was cassandra/metadata.py in
cassandra-driver, which has a list of recognized table options (
https://github.com/datastax/python-driver/blob/master/cassandra/metadata.py#L2169).
Sorry for not posting the implementation, but I've followed the changes
made for adding the CDC option (
https://github.com/apache/cassandra/commit/e31e216234c6b57a531cae607e0355666007deb2).
Naturally, it didn't contain the changes made in another repository.

OT: I wonder if cassandra-driver can be added as a submodule to cassandra,
instead of embedding it as zip file. Since submodule updates are also part
of the commit history, that will make it easier to spot related changes in
the driver.

On Wed, 25 Jan 2017 at 07:56 Blake Eggleston <be...@apple.com> wrote:

I haven't seen your implementation, but the likely cause of your problem is
either that the new parameter isn't being sent over the client protocol, or
that cqlsh is ignoring it. The cqlsh output of DESCRIBE TABLE seems to be
generated by the TableMetadata class in the python driver (see the
as_cql_query method). Dropping a breakpoint in there would probably be a
good place to start.
On January 24, 2017 at 7:07:38 AM, Murukesh Mohanan (
murukesh.mohanan@gmail.com) wrote:

I'm having a go at CASSANDRA-13002 (
https://issues.apache.org/jira/browse/CASSANDRA-12403), by adding a new
table property which will override the global slow_query_log_timeout_in_ms
setting. It works, but I can't get it to show up in cqlsh DESCRIBE TABLE
output. For example, this is what I get:

cqlsh> DESCRIBE TABLE foo.bar;

CREATE TABLE foo.bar (
id uuid PRIMARY KEY,
name text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND cdc = true
AND comment = ''
AND compaction = {'class':
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class':
'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 1001
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';

cqlsh> select table_name, slow_query_log_timeout_in_ms from
system_schema.tables where table_name = 'bar' allow filtering;

table_name | slow_query_log_timeout_in_ms
------------+------------------------------
bar | 103

The property (which is also called `slow_query_log_timeout_in_ms`) shows up
in the system_schema table.

It seems that the file to modify would be
src/java/org/apache/cassandra/db/ColumnFamilyStoreCQLHelper.java, but I
didn't have any luck modifying it.

Any pointers, please?



--

Murukesh Mohanan,
Yahoo! Japan

-- 

Murukesh Mohanan,
Yahoo! Japan

Re: Showing a new property in DESCRIBE TABLE output

Posted by Blake Eggleston <be...@apple.com>.
I haven't seen your implementation, but the likely cause of your problem is either that the new parameter isn't being sent over the client protocol, or that cqlsh is ignoring it. The cqlsh output of DESCRIBE TABLE seems to be generated by the TableMetadata class in the python driver (see the as_cql_query method). Dropping a breakpoint in there would probably be a good place to start.
On January 24, 2017 at 7:07:38 AM, Murukesh Mohanan (murukesh.mohanan@gmail.com) wrote:

I'm having a go at CASSANDRA-13002 ( 
https://issues.apache.org/jira/browse/CASSANDRA-12403), by adding a new 
table property which will override the global slow_query_log_timeout_in_ms 
setting. It works, but I can't get it to show up in cqlsh DESCRIBE TABLE 
output. For example, this is what I get: 

cqlsh> DESCRIBE TABLE foo.bar; 

CREATE TABLE foo.bar ( 
id uuid PRIMARY KEY, 
name text 
) WITH bloom_filter_fp_chance = 0.01 
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'} 
AND cdc = true 
AND comment = '' 
AND compaction = {'class': 
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
'max_threshold': '32', 'min_threshold': '4'} 
AND compression = {'chunk_length_in_kb': '64', 'class': 
'org.apache.cassandra.io.compress.LZ4Compressor'} 
AND crc_check_chance = 1.0 
AND dclocal_read_repair_chance = 0.1 
AND default_time_to_live = 0 
AND gc_grace_seconds = 864000 
AND max_index_interval = 2048 
AND memtable_flush_period_in_ms = 1001 
AND min_index_interval = 128 
AND read_repair_chance = 0.0 
AND speculative_retry = '99PERCENTILE'; 

cqlsh> select table_name, slow_query_log_timeout_in_ms from 
system_schema.tables where table_name = 'bar' allow filtering; 

table_name | slow_query_log_timeout_in_ms 
------------+------------------------------ 
bar | 103 

The property (which is also called `slow_query_log_timeout_in_ms`) shows up 
in the system_schema table. 

It seems that the file to modify would be 
src/java/org/apache/cassandra/db/ColumnFamilyStoreCQLHelper.java, but I 
didn't have any luck modifying it. 

Any pointers, please? 



-- 

Murukesh Mohanan, 
Yahoo! Japan