class Cassandra::Cluster::Schema::Fetchers::V2_1_x

Constants

SELECT_KEYSPACE_TYPES
SELECT_TYPE
SELECT_TYPES

Private Instance Methods

create_table_options(table_data, compaction_strategy, is_compact) click to toggle source
    # File lib/cassandra/cluster/schema/fetchers.rb
796 def create_table_options(table_data, compaction_strategy, is_compact)
797   compression_parameters = ::JSON.load(table_data['compression_parameters'])
798   if compression_parameters['sstable_compression']
799     compression_parameters['sstable_compression']
800       .slice!(COMPRESSION_PACKAGE_PREFIX)
801   end
802   Cassandra::ColumnContainer::Options.new(
803     table_data['comment'],
804     table_data['read_repair_chance'],
805     table_data['local_read_repair_chance'],
806     table_data['gc_grace_seconds'],
807     table_data['caching'],
808     table_data['bloom_filter_fp_chance'],
809     table_data['populate_io_cache_on_flush'],
810     table_data['memtable_flush_period_in_ms'],
811     table_data['default_time_to_live'],
812     table_data['speculative_retry'],
813     table_data['index_interval'],
814     table_data['replicate_on_write'],
815     table_data['min_index_interval'],
816     table_data['max_index_interval'],
817     compaction_strategy,
818     compression_parameters,
819     is_compact,
820     table_data['crc_check_chance'],
821     table_data['extensions'],
822     nil
823   )
824 end
create_type(type_data) click to toggle source
    # File lib/cassandra/cluster/schema/fetchers.rb
763 def create_type(type_data)
764   keyspace_name = type_data['keyspace_name']
765   type_name     = type_data['type_name']
766   type_fields   = ::Array.new
767 
768   field_names = type_data['field_names']
769   field_types = type_data['field_types']
770 
771   field_names.zip(field_types) do |(field_name, fqcn)|
772     field_type = @type_parser.parse(fqcn).results.first.first
773 
774     type_fields << [field_name, field_type]
775   end
776 
777   Types.udt(keyspace_name, type_name, type_fields)
778 end
select_keyspace_types(connection, keyspace_name) click to toggle source
    # File lib/cassandra/cluster/schema/fetchers.rb
784 def select_keyspace_types(connection, keyspace_name)
785   params = [keyspace_name]
786   hints  = [Types.varchar]
787   send_select_request(connection, SELECT_KEYSPACE_TYPES, params, hints)
788 end
select_type(connection, keyspace_name, type_name) click to toggle source
    # File lib/cassandra/cluster/schema/fetchers.rb
790 def select_type(connection, keyspace_name, type_name)
791   params = [keyspace_name, type_name]
792   hints  = [Types.varchar, Types.varchar]
793   send_select_request(connection, SELECT_TYPE, params, hints)
794 end
select_types(connection) click to toggle source
    # File lib/cassandra/cluster/schema/fetchers.rb
780 def select_types(connection)
781   send_select_request(connection, SELECT_TYPES)
782 end