    # File lib/memcache.rb, line 35
      def initialize(opts)
        @default_expiry   = opts[:default_expiry] || DEFAULT_EXPIRY
        @backup           = opts[:backup] # for multi-level caches
        @hash_with_prefix = opts[:hash_with_prefix].nil? ? true : opts[:hash_with_prefix]

        if opts[:native]
          native_opts = opts.clone
          native_opts[:servers] = (opts[:servers] || [ opts[:server] ]).collect do |server|
            server.is_a?(Hash) ? "#{server[:host]}:#{server[:port]}:#{server[:weight]}" : server
          end
          native_opts[:hash] ||= :crc unless native_opts[:ketama] or native_opts[:ketama_wieghted]
          native_opts[:hash_with_prefix] = @hash_with_prefix

          server_class = opts[:segment_large_values] ? SegmentedNativeServer : NativeServer
          @servers = [server_class.new(native_opts)]
        else
          raise "only CRC hashing is supported unless :native => true" if opts[:hash] and opts[:hash] != :crc

          server_class = opts[:segment_large_values] ? SegmentedServer : Server
          @servers = (opts[:servers] || [ opts[:server] ]).collect do |server|
            case server
            when Hash
              server = server_class.new(opts.merge(server))
            when String
              host, port = server.split(':')
              server = server_class.new(opts.merge(:host => host, :port => port))
            when Class
              server = server.new
            when :local
              server = Memcache::LocalServer.new
            end
            server
          end
        end

        @server = @servers.first if @servers.size == 1 and @backup.nil?
        self.namespace = opts[:namespace] if opts[:namespace]
      end