For C* 2.2+
| 1969 | |
| 1970 | |
| 1971 | class SchemaParserV22(_SchemaParser): |
| 1972 | """ |
| 1973 | For C* 2.2+ |
| 1974 | """ |
| 1975 | _SELECT_KEYSPACES = "SELECT * FROM system.schema_keyspaces" |
| 1976 | _SELECT_COLUMN_FAMILIES = "SELECT * FROM system.schema_columnfamilies" |
| 1977 | _SELECT_COLUMNS = "SELECT * FROM system.schema_columns" |
| 1978 | _SELECT_TRIGGERS = "SELECT * FROM system.schema_triggers" |
| 1979 | _SELECT_TYPES = "SELECT * FROM system.schema_usertypes" |
| 1980 | _SELECT_FUNCTIONS = "SELECT * FROM system.schema_functions" |
| 1981 | _SELECT_AGGREGATES = "SELECT * FROM system.schema_aggregates" |
| 1982 | |
| 1983 | _table_name_col = 'columnfamily_name' |
| 1984 | |
| 1985 | _function_agg_arument_type_col = 'signature' |
| 1986 | |
| 1987 | recognized_table_options = ( |
| 1988 | "comment", |
| 1989 | "read_repair_chance", |
| 1990 | "dclocal_read_repair_chance", # kept to be safe, but see _build_table_options() |
| 1991 | "local_read_repair_chance", |
| 1992 | "replicate_on_write", |
| 1993 | "gc_grace_seconds", |
| 1994 | "bloom_filter_fp_chance", |
| 1995 | "caching", |
| 1996 | "compaction_strategy_class", |
| 1997 | "compaction_strategy_options", |
| 1998 | "min_compaction_threshold", |
| 1999 | "max_compaction_threshold", |
| 2000 | "compression_parameters", |
| 2001 | "min_index_interval", |
| 2002 | "max_index_interval", |
| 2003 | "index_interval", |
| 2004 | "speculative_retry", |
| 2005 | "rows_per_partition_to_cache", |
| 2006 | "memtable_flush_period_in_ms", |
| 2007 | "populate_io_cache_on_flush", |
| 2008 | "compression", |
| 2009 | "default_time_to_live") |
| 2010 | |
| 2011 | def __init__(self, connection, timeout): |
| 2012 | super(SchemaParserV22, self).__init__(connection, timeout) |
| 2013 | self.keyspaces_result = [] |
| 2014 | self.tables_result = [] |
| 2015 | self.columns_result = [] |
| 2016 | self.triggers_result = [] |
| 2017 | self.types_result = [] |
| 2018 | self.functions_result = [] |
| 2019 | self.aggregates_result = [] |
| 2020 | |
| 2021 | self.keyspace_table_rows = defaultdict(list) |
| 2022 | self.keyspace_table_col_rows = defaultdict(lambda: defaultdict(list)) |
| 2023 | self.keyspace_type_rows = defaultdict(list) |
| 2024 | self.keyspace_func_rows = defaultdict(list) |
| 2025 | self.keyspace_agg_rows = defaultdict(list) |
| 2026 | self.keyspace_table_trigger_rows = defaultdict(lambda: defaultdict(list)) |
| 2027 | |
| 2028 | def get_all_keyspaces(self): |