/// <summary> /// Creates a new instance if the currentInstance is not valid for the given Cassandra version /// </summary> public static SchemaParser GetInstance(Version cassandraVersion, Metadata parent, Func <string, string, Task <UdtColumnInfo> > udtResolver, SchemaParser currentInstance = null) { if (cassandraVersion >= Version30 && !(currentInstance is SchemaParserV2)) { return(new SchemaParserV2(parent, udtResolver)); } if (cassandraVersion < Version30 && !(currentInstance is SchemaParserV1)) { return(new SchemaParserV1(parent)); } if (currentInstance == null) { throw new ArgumentNullException("currentInstance"); } return(currentInstance); }
/// <summary> /// Sets the Cassandra version in order to identify how to parse the metadata information /// </summary> /// <param name="version"></param> internal void SetCassandraVersion(Version version) { _schemaParser = SchemaParser.GetInstance(version, this, GetUdtDefinitionAsync, _schemaParser); }