internal DseCluster(ICluster coreCluster, DseConfiguration config) { _coreCluster = coreCluster; _config = config; _coreCluster.HostAdded += OnCoreHostAdded; _coreCluster.HostRemoved += OnCoreHostRemoved; }
/// <summary> /// Builds the cluster with the configured set of initial contact points and policies. /// </summary> /// <returns> /// A new <see cref="DseCluster"/> instance. /// </returns> public new DseCluster Build() { var dseAssembly = typeof(DseCluster).GetTypeInfo().Assembly; var cassandraAssembly = typeof(ISession).GetTypeInfo().Assembly; Logger.Info("Using DataStax C# DSE driver v{0} (core driver v{1})", FileVersionInfo.GetVersionInfo(dseAssembly.Location).FileVersion, FileVersionInfo.GetVersionInfo(cassandraAssembly.Location).FileVersion); var typeSerializerDefinitions = _typeSerializerDefinitions ?? new TypeSerializerDefinitions(); typeSerializerDefinitions .Define(new DateRangeSerializer()) .Define(new DurationSerializer(true)) .Define(new LineStringSerializer()) .Define(new PointSerializer()) .Define(new PolygonSerializer()); base.WithTypeSerializers(typeSerializerDefinitions); var coreCluster = base.Build(); var config = new DseConfiguration(coreCluster.Configuration, GraphOptions ?? new GraphOptions()); // To be replaced after CSHARP-444. config.AddressTranslator = _addressTranslator; return(new DseCluster( coreCluster, config)); }
public DseSession(ISession coreSession, DseConfiguration config) { if (coreSession == null) { throw new ArgumentNullException("coreSession"); } if (config == null) { throw new ArgumentNullException("config"); } _coreSession = coreSession; _config = config; }
/// <summary> /// Builds the cluster with the configured set of initial contact points and policies. /// </summary> /// <returns> /// A new <see cref="DseCluster"/> instance. /// </returns> public new DseCluster Build() { var dseAssembly = Assembly.GetExecutingAssembly(); var cassandraAssembly = typeof(ISession).Assembly; Logger.Info("Using DataStax C# DSE driver v{0} (core driver v{1})", FileVersionInfo.GetVersionInfo(dseAssembly.Location).FileVersion, FileVersionInfo.GetVersionInfo(cassandraAssembly.Location).FileVersion); var typeSerializerDefinitions = _typeSerializerDefinitions ?? new TypeSerializerDefinitions(); typeSerializerDefinitions .Define(new LineStringSerializer()) .Define(new PointSerializer()) .Define(new PolygonSerializer()); base.WithTypeSerializers(typeSerializerDefinitions); var coreCluster = base.Build(); var config = new DseConfiguration(coreCluster.Configuration, GraphOptions ?? new GraphOptions()); // To be replaced after CSHARP-444. config.AddressTranslator = _addressTranslator; return new DseCluster( coreCluster, config); }
internal DseSession(ISession coreSession, DseConfiguration config) : this(coreSession, coreSession.Cluster, config) { }