# File lib/moneta/adapters/cassandra.rb, line 22
      def initialize(options = {})
        self.default_expires = options.delete(:expires)
        @cf = (options.delete(:column_family) || 'moneta').to_sym
        if options[:backend]
          @backend = options[:backend]
        else
          keyspace = options.delete(:keyspace) || 'moneta'
          options[:retries] ||= 3
          options[:connect_timeout] ||= 10
          options[:timeout] ||= 10
          @backend = ::Cassandra.new('system',
                                     "#{options[:host] || '127.0.0.1'}:#{options[:port] || 9160}",
                                     options)
          unless @backend.keyspaces.include?(keyspace)
            cf_def = ::Cassandra::ColumnFamily.new(:keyspace => keyspace, :name => @cf.to_s)
            ks_def = ::Cassandra::Keyspace.new(:name => keyspace,
                                               :strategy_class => 'SimpleStrategy',
                                               :strategy_options => { 'replication_factor' => '1' },
                                               :replication_factor => 1,
                                               :cf_defs => [cf_def])
            # Wait for keyspace to be created (issue #24)
            10.times do
              begin
                @backend.add_keyspace(ks_def)
              rescue Exception => ex
                warn "Moneta::Adapters::Cassandra - #{ex.message}"
              end
              break if @backend.keyspaces.include?(keyspace)
              sleep 0.1
            end
          end
          @backend.keyspace = keyspace
        end
      end