/// <summary>Specify the datacenter ID that was passed to fdbserver processes running in the same datacenter as this client, for better location-aware load balancing.</summary> /// <param name="db">Database instance</param> /// <param name="hexId">Hexadecimal ID</param> public static void SetDataCenterId(this IFdbDatabase db, string hexId) { Contract.NotNull(db); //REVIEW: we can't really change this to a Property, because we don't have a way to get the current value for the getter, and set only properties are weird... //TODO: cache this into a local variable ? db.SetOption(FdbDatabaseOption.DataCenterId, hexId); }
/// <summary>Specify the datacenter ID that was passed to fdbserver processes running in the same datacenter as this client, for better location-aware load balancing.</summary> /// <param name="db">Database instance</param> /// <param name="hexId">Hexadecimal ID</param> public static void SetDataCenterId(this IFdbDatabase db, string hexId) { if (db == null) { throw new ArgumentNullException("db"); } //REVIEW: we can't really change this to a Property, because we don't have a way to get the current value for the getter, and set only properties are weird... //TODO: cache this into a local variable ? db.SetOption(FdbDatabaseOption.DataCenterId, hexId); }
/// <summary>Set the size of the client location cache. Raising this value can boost performance in very large databases where clients access data in a near-random pattern. Defaults to 100000.</summary> /// <param name="db">Database instance</param> /// <param name="size">Max location cache entries</param> public static void SetLocationCacheSize(this IFdbDatabase db, int size) { Contract.NotNull(db); if (size < 0) { throw new FdbException(FdbError.InvalidOptionValue, "Location cache size must be a positive integer"); } //REVIEW: we can't really change this to a Property, because we don't have a way to get the current value for the getter, and set only properties are weird... //TODO: cache this into a local variable ? db.SetOption(FdbDatabaseOption.LocationCacheSize, size); }
/// <summary>Set the maximum number of watches allowed to be outstanding on a database connection. Increasing this number could result in increased resource usage. Reducing this number will not cancel any outstanding watches. Defaults to 10000 and cannot be larger than 1000000.</summary> /// <param name="db">Database instance</param> /// <param name="count">Max outstanding watches</param> public static void SetMaxWatches(this IFdbDatabase db, int count) { Contract.NotNull(db); if (count < 0) { throw new FdbException(FdbError.InvalidOptionValue, "Maximum outstanding watches count must be a positive integer"); } //REVIEW: we can't really change this to a Property, because we don't have a way to get the current value for the getter, and set only properties are weird... //TODO: cache this into a local variable ? db.SetOption(FdbDatabaseOption.MaxWatches, count); }
public virtual void SetOption(FdbDatabaseOption option) { ThrowIfDisposed(); m_database.SetOption(option); }