/// <summary> /// Performs the LSM operation on the source shard. /// </summary> /// <param name="ts">Transaction scope.</param> /// <returns>Result of the operation.</returns> public override IStoreResults DoLocalSourceExecute(IStoreTransactionScope ts) { IStoreResults result; if (_updateLocation) { result = ts.ExecuteOperation( StoreOperationRequestBuilder.SpBulkOperationShardMappingsLocal, StoreOperationRequestBuilder.RemoveShardMappingLocal( this.Id, false, _shardMap, _mappingSource)); } else { result = ts.ExecuteOperation( StoreOperationRequestBuilder.SpBulkOperationShardMappingsLocal, StoreOperationRequestBuilder.UpdateShardMappingLocal( this.Id, false, _shardMap, _mappingSource, _mappingTarget)); } // We need to treat the kill connection operation separately, the reason // being that we cannot perform kill operations within a transaction. if (result.Result == StoreResult.Success && _fromOnlineToOffline) { this.KillConnectionsOnSourceShard(); } return(result); }
/// <summary> /// Performs the LSM operation on the source shard. /// </summary> /// <param name="ts">Transaction scope.</param> /// <returns>Result of the operation.</returns> public override IStoreResults DoLocalSourceExecute(IStoreTransactionScope ts) { return(ts.ExecuteOperation( StoreOperationRequestBuilder.SpBulkOperationShardMappingsLocal, StoreOperationRequestBuilder.RemoveShardMappingLocal( this.Id, false, _shardMap, _mapping))); }
/// <summary> /// Performs undo of LSM operation on the target shard. /// </summary> /// <param name="ts">Transaction scope.</param> /// <returns>Result of the operation.</returns> public override IStoreResults UndoLocalTargetExecute(IStoreTransactionScope ts) { DefaultStoreMapping dsmTarget = new DefaultStoreMapping( _mappingTarget.Id, _shardMap.Id, new DefaultStoreShard( _mappingTarget.StoreShard.Id, this.OriginalShardVersionAdds, _shardMap.Id, _mappingTarget.StoreShard.Location, _mappingTarget.StoreShard.Status), _mappingTarget.MinValue, _mappingTarget.MaxValue, _mappingTarget.Status, _lockOwnerId); return(ts.ExecuteOperation( StoreOperationRequestBuilder.SpBulkOperationShardMappingsLocal, StoreOperationRequestBuilder.RemoveShardMappingLocal( this.Id, true, _shardMap, dsmTarget))); }