/// <summary> /// Removes the connections older than the utcDateTime. /// </summary> /// <param name="shardSetName">Name of the shard set to clear connections for.</param> /// <param name="utcDateTime">The UTC date time.</param> public void RemoveConnections(string shardSetName, DateTime utcDateTime) { // delete all connections from the shardlet repository var repository = new AzureShardletConnectionRepository(shardSetName); repository.Delete(utcDateTime); }
/// <summary> /// Terminates the connections to the shardlet. /// </summary> /// <param name="shardlet">The shardlet.</param> public override void TerminateConnections(Shardlet shardlet) { var repository = new AzureShardletConnectionRepository(shardlet.ShardSetName); // get all connections to the shardlet var spids = repository.Get(shardlet); // terminate all connections.... TerminateDatabaseConnections(shardlet, spids); // delete all connections from the shardlet repository repository.Delete(shardlet, spids); }
/// <summary> /// De-registers the shardlet connection. /// </summary> /// <param name="shardlet">The shardlet.</param> /// <param name="spid">The spid.</param> /// <returns>Microsoft.AzureCat.Patterns.DataElasticity.Models.ShardletStatus.</returns> /// <exception cref="System.NotImplementedException"></exception> public override void RemoveShardletConnection(Shardlet shardlet, short spid) { // todo: do we have to look it up? or can we just fail to delete? var repository = new AzureShardletConnectionRepository(shardlet.ShardSetName); var azureShardletConnection = repository.Get(shardlet, spid); if (azureShardletConnection == null) { return; } repository.Delete(azureShardletConnection); }