Esempio n. 1
0
 public DriverInfo GetInformation(IInternalCluster cluster, IInternalSession session)
 {
     return(new DriverInfo
     {
         DriverName = AssemblyHelpers.GetAssemblyTitle(typeof(DriverInfoProvider)),
         DriverVersion = AssemblyHelpers.GetAssemblyInformationalVersion(typeof(DriverInfoProvider))
     });
 }
Esempio n. 2
0
        public IReadOnlyDictionary <string, string> CreateStartupOptions(ProtocolOptions options)
        {
            var startupOptions = new Dictionary <string, string>
            {
                { StartupOptionsFactory.CqlVersionOption, StartupOptionsFactory.CqlVersion }
            };

            string compressionName = null;

            switch (options.Compression)
            {
            case CompressionType.LZ4:
                compressionName = StartupOptionsFactory.Lz4Compression;
                break;

            case CompressionType.Snappy:
                compressionName = StartupOptionsFactory.SnappyCompression;
                break;
            }

            if (compressionName != null)
            {
                startupOptions.Add(StartupOptionsFactory.CompressionOption, compressionName);
            }

            if (options.NoCompact)
            {
                startupOptions.Add(StartupOptionsFactory.NoCompactOption, "true");
            }

            startupOptions.Add(StartupOptionsFactory.DriverNameOption, AssemblyHelpers.GetAssemblyTitle(typeof(StartupOptionsFactory)));
            startupOptions.Add(
                StartupOptionsFactory.DriverVersionOption, AssemblyHelpers.GetAssemblyInformationalVersion(typeof(StartupOptionsFactory)));

            if (_appName != null)
            {
                startupOptions[StartupOptionsFactory.ApplicationNameOption] = _appName;
            }

            if (_appVersion != null)
            {
                startupOptions[StartupOptionsFactory.ApplicationVersionOption] = _appVersion;
            }

            startupOptions[StartupOptionsFactory.ClientIdOption] = _clusterId.ToString();
            return(startupOptions);
        }