当前位置: 首页>>代码示例>>C#>>正文


C# IStoreTransactionScope.ExecuteOperation方法代码示例

本文整理汇总了C#中IStoreTransactionScope.ExecuteOperation方法的典型用法代码示例。如果您正苦于以下问题:C# IStoreTransactionScope.ExecuteOperation方法的具体用法?C# IStoreTransactionScope.ExecuteOperation怎么用?C# IStoreTransactionScope.ExecuteOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IStoreTransactionScope的用法示例。


在下文中一共展示了IStoreTransactionScope.ExecuteOperation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoGlobalExecute

 /// <summary>
 /// Execute the operation against GSM in the current transaction scope.
 /// </summary>
 /// <param name="ts">Transaction scope.</param>
 /// <returns>
 /// Results of the operation.
 /// </returns>
 public override IStoreResults DoGlobalExecute(IStoreTransactionScope ts)
 {
     // If no ranges are specified, blindly mark everything for deletion.
     return ts.ExecuteOperation(
         StoreOperationRequestBuilder.SpFindShardMappingByIdGlobal,
         StoreOperationRequestBuilder.FindShardMappingByIdGlobal(_shardMap, _mapping));
 }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:14,代码来源:FindMappingByIdGlobalOperation.cs

示例2: DoGlobalPreLocalExecute

 /// <summary>
 /// Performs the initial GSM operation prior to LSM operations.
 /// </summary>
 /// <param name="ts">Transaction scope.</param>
 /// <returns>Pending operations on the target objects if any.</returns>
 public override IStoreResults DoGlobalPreLocalExecute(IStoreTransactionScope ts)
 {
     return ts.ExecuteOperation(
         StoreOperationRequestBuilder.SpBulkOperationShardsGlobalBegin,
         StoreOperationRequestBuilder.AddShardGlobal(
             this.Id,
             this.OperationCode,
             false, // undo
             _shardMap,
             _shard));
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:16,代码来源:AddShardOperation.cs

示例3: DoGlobalExecute

        /// <summary>
        /// Execute the operation against GSM in the current transaction scope.
        /// </summary>
        /// <param name="ts">Transaction scope.</param>
        /// <returns>
        /// Results of the operation.
        /// </returns>
        public override IStoreResults DoGlobalExecute(IStoreTransactionScope ts)
        {
            IEnumerable<IStoreMapping> mappingsToReplace = this.GetMappingsToPurge(ts);

            return ts.ExecuteOperation(
                StoreOperationRequestBuilder.SpReplaceShardMappingsGlobal,
                StoreOperationRequestBuilder.ReplaceShardMappingsGlobalWithoutLogging(
                    _shardMap,
                    mappingsToReplace.ToArray(),
                    _mappingsToAdd.ToArray()));
        }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:18,代码来源:ReplaceMappingsGlobalOperation.cs

示例4: DoGlobalExecute

        /// <summary>
        /// Execute the operation against GSM in the current transaction scope.
        /// </summary>
        /// <param name="ts">Transaction scope.</param>
        /// <returns>
        /// Results of the operation.
        /// </returns>
        public override IStoreResults DoGlobalExecute(IStoreTransactionScope ts)
        {
            _loadResults.Clear();

            IStoreResults result = ts.ExecuteOperation(
                StoreOperationRequestBuilder.SpGetAllShardMapsGlobal,
                StoreOperationRequestBuilder.GetAllShardMapsGlobal());

            if (result.Result == StoreResult.Success)
            {
                foreach (IStoreShardMap ssm in result.StoreShardMaps)
                {
                    _ssmCurrent = ssm;

                    result = ts.ExecuteOperation(
                        StoreOperationRequestBuilder.SpGetAllShardMappingsGlobal,
                        StoreOperationRequestBuilder.GetAllShardMappingsGlobal(ssm, null, null));

                    if (result.Result == StoreResult.Success)
                    {
                        _loadResults.Add(
                            new LoadResult
                            {
                                ShardMap = ssm,
                                Mappings = result.StoreMappings
                            });
                    }
                    else
                    if (result.Result != StoreResult.ShardMapDoesNotExist)
                    {
                        // Ignore some possible failures for Load operation and skip failed
                        // shard map caching operations.
                        break;
                    }
                }
            }

            return result;
        }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:46,代码来源:LoadShardMapManagerGlobalOperation.cs

示例5: DoLocalExecute

        /// <summary>
        /// Execute the operation against LSM in the current transaction scope.
        /// </summary>
        /// <param name="ts">Transaction scope.</param>
        /// <returns>
        /// Results of the operation.
        /// </returns>
        public override IStoreResults DoLocalExecute(IStoreTransactionScope ts)
        {
            IStoreResults result = ts.ExecuteCommandSingle(SqlUtils.CheckIfExistsLocalScript.Single());

            if (result.StoreVersion == null)
            {
                // Shard not deployed, which is an error condition.
                throw new ShardManagementException(
                    ShardManagementErrorCategory.Recovery,
                    ShardManagementErrorCode.ShardNotValid,
                    Errors._Recovery_ShardNotValid,
                    this.Location,
                    this.OperationName);
            }

            return ts.ExecuteOperation(
                StoreOperationRequestBuilder.SpGetAllShardsLocal,
                StoreOperationRequestBuilder.GetAllShardsLocal());
        }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:26,代码来源:GetShardsLocalOperation.cs

示例6: DoLocalExecute

 /// <summary>
 /// Execute the operation against LSM in the current transaction scope.
 /// </summary>
 /// <param name="ts">Transaction scope.</param>
 /// <returns>
 /// Results of the operation.
 /// </returns>
 public override IStoreResults DoLocalExecute(IStoreTransactionScope ts)
 {
     return ts.ExecuteOperation(
         StoreOperationRequestBuilder.SpGetAllShardMappingsLocal,
         StoreOperationRequestBuilder.GetAllShardMappingsLocal(_shardMap, _shard, _range));
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:13,代码来源:GetMappingsByRangeLocalOperation.cs

示例7: DoLocalExecute

        /// <summary>
        /// Execute the operation against LSM in the current transaction scope.
        /// </summary>
        /// <param name="ts">Transaction scope.</param>
        /// <returns>
        /// Results of the operation.
        /// </returns>
        public override IStoreResults DoLocalExecute(IStoreTransactionScope ts)
        {
            IEnumerable<IStoreMapping> mappingsToRemove = this.GetMappingsToPurge(ts);

            return ts.ExecuteOperation(
                StoreOperationRequestBuilder.SpBulkOperationShardMappingsLocal,
                StoreOperationRequestBuilder.ReplaceShardMappingsLocal(
                    Guid.NewGuid(), // Create a new Guid so that this operation forces over-writes.
                    false,
                    _shardMap,
                    mappingsToRemove.ToArray(),
                    _mappingsToAdd.ToArray()));
        }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:20,代码来源:ReplaceMappingsLocalOperation.cs

示例8: UndoGlobalPostLocalExecute

 /// <summary>
 /// Performs the undo of GSM operation after LSM operations.
 /// </summary>
 /// <param name="ts">Transaction scope.</param>
 /// <returns>Pending operations on the target objects if any.</returns>
 public override IStoreResults UndoGlobalPostLocalExecute(IStoreTransactionScope ts)
 {
     return ts.ExecuteOperation(
         StoreOperationRequestBuilder.SpBulkOperationShardMappingsGlobalEnd,
         StoreOperationRequestBuilder.UpdateShardMappingGlobal(
             this.Id,
             this.OperationCode,
             true, // undo
             _patternForKill,
             _shardMap,
             _mappingSource,
             _mappingTarget,
             _lockOwnerId));
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:19,代码来源:UpdateMappingOperation.cs

示例9: UndoGlobalPostLocalExecute

 /// <summary>
 /// Performs the undo of GSM operation after LSM operations.
 /// </summary>
 /// <param name="ts">Transaction scope.</param>
 /// <returns>Pending operations on the target objects if any.</returns>
 public override IStoreResults UndoGlobalPostLocalExecute(IStoreTransactionScope ts)
 {
     return ts.ExecuteOperation(
         StoreOperationRequestBuilder.SpBulkOperationShardMappingsGlobalEnd,
         StoreOperationRequestBuilder.AddShardMappingGlobal(
             this.Id,
             this.OperationCode,
             true, // undo
             _shardMap,
             _mapping));
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:16,代码来源:AddMappingOperation.cs

示例10: DoLocalSourceExecute

 /// <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.AddShardMappingLocal(
             this.Id,
             false,
             _shardMap,
             _mapping));
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:15,代码来源:AddMappingOperation.cs

示例11: DoLocalSourceExecute

        /// <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;
        }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:40,代码来源:UpdateMappingOperation.cs

示例12: DoLocalSourceExecute

        /// <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 checkResult = ts.ExecuteCommandSingle(SqlUtils.CheckIfExistsLocalScript.Single());

            // Shard not already deployed, just need to add the proper entries.
            if (checkResult.StoreVersion == null)
            {
                // create initial version of LSM
                ts.ExecuteCommandBatch(SqlUtils.CreateLocalScript);

                // now upgrade LSM to latest version
                ts.ExecuteCommandBatch(SqlUtils.FilterUpgradeCommands(SqlUtils.UpgradeLocalScript, GlobalConstants.LsmVersionClient));
            }

            // Now actually add the shard entries.
            return ts.ExecuteOperation(
                StoreOperationRequestBuilder.SpAddShardLocal,
                StoreOperationRequestBuilder.AddShardLocal(this.Id, false, _shardMap, _shard));
        }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:24,代码来源:AddShardOperation.cs

示例13: UndoLocalSourceExecute

 /// <summary>
 /// Performs the undo of LSM operation on the source shard.
 /// </summary>
 /// <param name="ts">Transaction scope.</param>
 /// <returns>Result of the operation.</returns>
 public override IStoreResults UndoLocalSourceExecute(IStoreTransactionScope ts)
 {
     // Adds back the removed shard entries.
     return ts.ExecuteOperation(
         StoreOperationRequestBuilder.SpAddShardLocal,
         StoreOperationRequestBuilder.AddShardLocal(this.Id, true, _shardMap, _shard));
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:12,代码来源:RemoveShardOperation.cs

示例14: DoLocalSourceExecute

 /// <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)
 {
     // Now actually add the shard entries.
     return ts.ExecuteOperation(
         StoreOperationRequestBuilder.SpRemoveShardLocal,
         StoreOperationRequestBuilder.RemoveShardLocal(this.Id, _shardMap, _shard));
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:12,代码来源:RemoveShardOperation.cs

示例15: DoGlobalPostLocalExecute

 /// <summary>
 /// Performs the final GSM operation after the LSM operations.
 /// </summary>
 /// <param name="ts">Transaction scope.</param>
 /// <returns>Pending operations on the target objects if any.</returns>
 public override IStoreResults DoGlobalPostLocalExecute(IStoreTransactionScope ts)
 {
     return ts.ExecuteOperation(
         StoreOperationRequestBuilder.SpBulkOperationShardsGlobalEnd,
         StoreOperationRequestBuilder.UpdateShardGlobal(
             this.Id,
             this.OperationCode,
             false, // undo
             _shardMap,
             _shardOld,
             _shardNew));
 }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:17,代码来源:UpdateShardOperation.cs


注:本文中的IStoreTransactionScope.ExecuteOperation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。