• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ShardMapManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ShardMapManager的典型用法代码示例。如果您正苦于以下问题:C# ShardMapManager类的具体用法?C# ShardMapManager怎么用?C# ShardMapManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ShardMapManager类属于命名空间,在下文中一共展示了ShardMapManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CheckShardLocalOperation

 /// <summary>
 /// Constructs request for obtaining all the shard maps and shards from an LSM.
 /// </summary>
 /// <param name="operationName">Operation name.</param>
 /// <param name="shardMapManager">Shard map manager.</param>
 /// <param name="location">Location of the LSM.</param>
 internal CheckShardLocalOperation(
     string operationName,
     ShardMapManager shardMapManager,
     ShardLocation location) :
     base(shardMapManager.Credentials, shardMapManager.RetryPolicy, location, operationName)
 {
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:13,代码来源:CheckShardLocalOperation.cs


示例2: AddShardOperation

 /// <summary>
 /// Creates request to add shard to given shard map.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager object.</param>
 /// <param name="shardMap">Shard map for which to add shard.</param>
 /// <param name="shard">Shard to add.</param>
 protected internal AddShardOperation(
     ShardMapManager shardMapManager,
     IStoreShardMap shardMap,
     IStoreShard shard) :
     this(shardMapManager, Guid.NewGuid(), StoreOperationState.UndoBegin, shardMap, shard)
 {
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:13,代码来源:AddShardOperation.cs


示例3: CreateShardMapFromStoreShardMap

        /// <summary>
        /// Converts IStoreShardMap to ShardMap.
        /// </summary>
        /// <param name="manager">Reference to shard map manager.</param>
        /// <param name="ssm">Storage representation for ShardMap.</param>
        /// <returns>ShardMap object corresponding to storange representation.</returns>
        internal static ShardMap CreateShardMapFromStoreShardMap(
            ShardMapManager manager,
            IStoreShardMap ssm)
        {
            switch (ssm.MapType)
            {
                case ShardMapType.List:
                    // Create ListShardMap<TKey>
                    return (ShardMap)Activator.CreateInstance(
                            typeof(ListShardMap<>).MakeGenericType(
                                ShardKey.TypeFromShardKeyType(ssm.KeyType)),
                            BindingFlags.NonPublic | BindingFlags.Instance,
                            null,
                            new object[] { manager, ssm },
                            CultureInfo.InvariantCulture);

                default:
                    Debug.Assert(ssm.MapType == ShardMapType.Range);
                    // Create RangeShardMap<TKey>
                    return (ShardMap)Activator.CreateInstance(
                            typeof(RangeShardMap<>).MakeGenericType(
                                ShardKey.TypeFromShardKeyType(ssm.KeyType)),
                            BindingFlags.NonPublic | BindingFlags.Instance,
                            null,
                            new object[] { manager, ssm },
                            CultureInfo.InvariantCulture);
            }
        }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:34,代码来源:ShardMapUtils.cs


示例4: FindShardByLocationGlobalOperation

 /// <summary>
 /// Constructs request to get shard with specific location for given shard map from GSM.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager object.</param>
 /// <param name="operationName">Operation name, useful for diagnostics.</param>
 /// <param name="shardMap">Shard map for which shard is being requested.</param>
 /// <param name="location">Location of shard being searched.</param>
 internal FindShardByLocationGlobalOperation(ShardMapManager shardMapManager, string operationName, IStoreShardMap shardMap, ShardLocation location) :
     base(shardMapManager.Credentials, shardMapManager.RetryPolicy, operationName)
 {
     _shardMapManager = shardMapManager;
     _shardMap = shardMap;
     _location = location;
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:14,代码来源:FindShardByLocationGlobalOperation.cs


示例5: ReplaceMappingsGlobalOperation

 /// <summary>
 /// Constructs request for replacing the GSM mappings for given shard map with the input mappings.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager.</param>
 /// <param name="operationName">Operation name.</param>
 /// <param name="shardMap">GSM Shard map.</param>
 /// <param name="shard">GSM Shard.</param>
 /// <param name="mappingsToRemove">Optional list of mappings to remove.</param>
 /// <param name="mappingsToAdd">List of mappings to add.</param>
 internal ReplaceMappingsGlobalOperation(ShardMapManager shardMapManager, string operationName, IStoreShardMap shardMap, IStoreShard shard, IEnumerable<IStoreMapping> mappingsToRemove, IEnumerable<IStoreMapping> mappingsToAdd) :
     base(shardMapManager.Credentials, shardMapManager.RetryPolicy, operationName)
 {
     _shardMap = shardMap;
     _shard = shard;
     _mappingsToRemove = mappingsToRemove;
     _mappingsToAdd = mappingsToAdd;
 }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:17,代码来源:ReplaceMappingsGlobalOperation.cs


示例6: RecoveryManager

 /// <summary>
 /// Constructs an instance of the recovery manager for given shard map manager.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager being recovered.</param>
 internal RecoveryManager(ShardMapManager shardMapManager)
 {
     Debug.Assert(shardMapManager != null);
     this.Manager = shardMapManager;
     this.Inconsistencies = new Dictionary<RecoveryToken, IDictionary<ShardRange, MappingDifference>>();
     this.StoreShardMaps = new Dictionary<RecoveryToken, Tuple<IStoreShardMap, IStoreShard>>();
     this.Locations = new Dictionary<RecoveryToken, ShardLocation>();
 }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:12,代码来源:RecoveryManager.cs


示例7: FindMappingByIdGlobalOperation

 /// <summary>
 /// Constructs request for obtaining mapping from GSM based on given key.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager.</param>
 /// <param name="operationName">Operation being executed.</param>
 /// <param name="shardMap">Local shard map.</param>
 /// <param name="mapping">Mapping whose Id will be used.</param>
 /// <param name="errorCategory">Error category.</param>
 internal FindMappingByIdGlobalOperation(ShardMapManager shardMapManager, string operationName, IStoreShardMap shardMap, IStoreMapping mapping, ShardManagementErrorCategory errorCategory) :
     base(shardMapManager.Credentials, shardMapManager.RetryPolicy, operationName)
 {
     _manager = shardMapManager;
     _shardMap = shardMap;
     _mapping = mapping;
     _errorCategory = errorCategory;
 }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:16,代码来源:FindMappingByIdGlobalOperation.cs


示例8: UpgradeStoreGlobalOperation

 /// <summary>
 /// Constructs request to upgrade store hosting GSM.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager object.</param>
 /// <param name="operationName">Operation name, useful for diagnostics.</param>
 /// <param name="targetVersion">Target version to upgrade.</param>
 internal UpgradeStoreGlobalOperation(
     ShardMapManager shardMapManager,
     string operationName,
     Version targetVersion) :
     base(shardMapManager.Credentials, shardMapManager.RetryPolicy, operationName)
 {
     _targetVersion = targetVersion;
 }
开发者ID:edtbot,项目名称:elastic-db-tools,代码行数:14,代码来源:UpgradeStoreGlobalOperation.cs


示例9: GetShardsGlobalOperation

 /// <summary>
 /// Constructs request to get all shards for given shard map from GSM.
 /// </summary>
 /// <param name="operationName">Operation name, useful for diagnostics.</param>
 /// <param name="shardMapManager">Shard map manager object.</param>
 /// <param name="shardMap">Shard map for which shards are being requested.</param>
 internal GetShardsGlobalOperation(
     string operationName,
     ShardMapManager shardMapManager,
     IStoreShardMap shardMap) :
     base(shardMapManager.Credentials, shardMapManager.RetryPolicy, operationName)
 {
     _shardMapManager = shardMapManager;
     _shardMap = shardMap;
 }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:15,代码来源:GetShardsGlobalOperation.cs


示例10: CreateShardMapManager

 private bool CreateShardMapManager()
 {
     try
     {
         ShardMapManager = ShardMapManagerFactory.CreateSqlShardMapManager(connectionString);
         return true;
     }
     catch { ShardMapManager = null; return false; }
 }
开发者ID:azure-appservice-samples,项目名称:WingTipTickets,代码行数:9,代码来源:HorizontalShard.cs


示例11: HorizontalShard

        public HorizontalShard(string _mapManagerServer, string _userID, string _password, string _mapManagerName, string _secondaryDR)
        {
            connectionString = string.Format("Data Source={0};Initial Catalog={3};Integrated Security=False;User ID={1};Password={2};Encrypt=True", 
                                _mapManagerServer, _userID, _password, _mapManagerName);
            shardConnectionString = string.Format("Integrated Security=False;User ID={0};Password={1};Encrypt=True", _userID, _password);
            mapManagerName = _mapManagerName;

            if (!ShardMapManagerFactory.TryGetSqlShardMapManager(connectionString, ShardMapManagerLoadPolicy.Lazy, out ShardMapManager))
                ShardMapManager = null;
        }
开发者ID:azure-appservice-samples,项目名称:WingTipTickets,代码行数:10,代码来源:HorizontalShard.cs


示例12: GetMappingsByRangeGlobalOperation

 /// <summary>
 /// Constructs request for obtaining all the mappings from GSM based on given shard and mappings.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager.</param>
 /// <param name="operationName">Operation being executed.</param>
 /// <param name="shardMap">Local shard map.</param>
 /// <param name="shard">Local shard.</param>
 /// <param name="range">Optional range to get mappings from.</param>
 /// <param name="errorCategory">Error category.</param>
 /// <param name="cacheResults">Whether to cache the results of the operation.</param>
 /// <param name="ignoreFailure">Ignore shard map not found error.</param>
 internal GetMappingsByRangeGlobalOperation(ShardMapManager shardMapManager, string operationName, IStoreShardMap shardMap, IStoreShard shard, ShardRange range, ShardManagementErrorCategory errorCategory, bool cacheResults, bool ignoreFailure) :
     base(shardMapManager.Credentials, shardMapManager.RetryPolicy, operationName)
 {
     _manager = shardMapManager;
     _shardMap = shardMap;
     _shard = shard;
     _range = range;
     _errorCategory = errorCategory;
     _cacheResults = cacheResults;
     _ignoreFailure = ignoreFailure;
 }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:22,代码来源:GetMappingsByRangeGlobalOperation.cs


示例13: CreateDetachShardGlobalOperation

 /// <summary>
 /// Constructs request for Detaching the given shard and mapping information to the GSM database.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager object.</param>
 /// <param name="operationName">Operation name.</param>
 /// <param name="location">Location to be detached.</param>
 /// <param name="shardMapName">Shard map from which shard is being detached.</param>
 /// <returns>The store operation.</returns>
 public virtual IStoreOperationGlobal CreateDetachShardGlobalOperation(
     ShardMapManager shardMapManager,
     string operationName,
     ShardLocation location,
     string shardMapName)
 {
     return new DetachShardGlobalOperation(
         shardMapManager,
         operationName,
         location,
         shardMapName);
 }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:20,代码来源:StoreOperationFactory.cs


示例14: LockOrUnLockMappingsGlobalOperation

        /// <summary>
        /// Constructs request to lock or unlock given mappings in GSM.
        /// </summary>
        /// <param name="shardMapManager">Shard map manager object.</param>
        /// <param name="operationName">Operation name, useful for diagnostics.</param>
        /// <param name="shardMap">Shard map to add.</param>
        /// <param name="mapping">Mapping to lock or unlock. Null means all mappings.</param>
        /// <param name="lockOwnerId">Lock owner.</param>
        /// <param name="lockOpType">Lock operation type.</param>
        /// <param name="errorCategory">Error category.</param>
        internal LockOrUnLockMappingsGlobalOperation(ShardMapManager shardMapManager, string operationName, IStoreShardMap shardMap, IStoreMapping mapping, Guid lockOwnerId, LockOwnerIdOpType lockOpType, ShardManagementErrorCategory errorCategory) :
            base(shardMapManager.Credentials, shardMapManager.RetryPolicy, operationName)
        {
            _shardMapManager = shardMapManager;
            _shardMap = shardMap;
            _mapping = mapping;
            _lockOwnerId = lockOwnerId;
            _lockOpType = lockOpType;
            _errorCategory = errorCategory;

            Debug.Assert(mapping != null || (lockOpType == LockOwnerIdOpType.UnlockAllMappingsForId || lockOpType == LockOwnerIdOpType.UnlockAllMappings));
        }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:22,代码来源:LockOrUnLockMappingsGlobalOperation.cs


示例15: ReplaceMappingsLocalOperation

 /// <summary>
 /// Constructs request for replacing the LSM mappings for given shard map with the input mappings.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager.</param>
 /// <param name="location">Location of the LSM.</param>
 /// <param name="operationName">Operation name.</param>
 /// <param name="shardMap">Local shard map.</param>
 /// <param name="shard">Local shard.</param>
 /// <param name="rangesToRemove">Optional list of ranges to minimize amount of deletions.</param>
 /// <param name="mappingsToAdd">List of mappings to add.</param>
 internal ReplaceMappingsLocalOperation(
     ShardMapManager shardMapManager,
     ShardLocation location,
     string operationName,
     IStoreShardMap shardMap,
     IStoreShard shard,
     IEnumerable<ShardRange> rangesToRemove,
     IEnumerable<IStoreMapping> mappingsToAdd) :
     base(shardMapManager.Credentials, shardMapManager.RetryPolicy, location, operationName)
 {
     _shardMap = shardMap;
     _shard = shard;
     _rangesToRemove = rangesToRemove;
     _mappingsToAdd = mappingsToAdd;
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:25,代码来源:ReplaceMappingsLocalOperation.cs


示例16: AddMappingOperation

 /// <summary>
 /// Creates request to add shard to given shard map.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager object.</param>
 /// <param name="operationCode">Store operation code.</param>
 /// <param name="shardMap">Shard map for which to add mapping.</param>
 /// <param name="mapping">Mapping to add.</param>
 protected internal AddMappingOperation(
     ShardMapManager shardMapManager,
     StoreOperationCode operationCode,
     IStoreShardMap shardMap,
     IStoreMapping mapping) :
     this(
     shardMapManager,
     Guid.NewGuid(),
     StoreOperationState.UndoBegin,
     operationCode,
     shardMap,
     mapping,
     default(Guid))
 {
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:22,代码来源:AddMappingOperation.cs


示例17: GetMappingsByRangeLocalOperation

        /// <summary>
        /// Constructs request for obtaining all the shard maps and shards from an LSM.
        /// </summary>
        /// <param name="shardMapManager">Shard map manager.</param>
        /// <param name="location">Location of the LSM.</param>
        /// <param name="operationName">Operation name.</param>
        /// <param name="shardMap">Local shard map.</param>
        /// <param name="shard">Local shard.</param>
        /// <param name="range">Optional range to get mappings from.</param>
        /// <param name="ignoreFailure">Ignore shard map not found error.</param>
        internal GetMappingsByRangeLocalOperation(
            ShardMapManager shardMapManager,
            ShardLocation location,
            string operationName,
            IStoreShardMap shardMap,
            IStoreShard shard,
            ShardRange range,
            bool ignoreFailure) :
            base(shardMapManager.Credentials, shardMapManager.RetryPolicy, location, operationName)
        {
            Debug.Assert(shard != null);

            _shardMap = shardMap;
            _shard = shard;
            _range = range;
            _ignoreFailure = ignoreFailure;
        }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:27,代码来源:GetMappingsByRangeLocalOperation.cs


示例18: ReplaceMappingsOperation

 /// <summary>
 /// Creates request to replace mappings within shard map.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager object.</param>
 /// <param name="operationCode">Store operation code.</param>
 /// <param name="shardMap">Shard map for which to update mapping.</param>
 /// <param name="mappingsSource">Original mappings.</param>
 /// <param name="mappingsTarget">Target mappings mapping.</param>
 protected internal ReplaceMappingsOperation(
     ShardMapManager shardMapManager,
     StoreOperationCode operationCode,
     IStoreShardMap shardMap,
     Tuple<IStoreMapping, Guid>[] mappingsSource,
     Tuple<IStoreMapping, Guid>[] mappingsTarget) :
     this(
     shardMapManager,
     Guid.NewGuid(),
     StoreOperationState.UndoBegin,
     operationCode,
     shardMap,
     mappingsSource,
     mappingsTarget,
     default(Guid))
 {
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:25,代码来源:ReplaceMappingsOperation.cs


示例19: StoreOperation

 /// <summary>
 /// Constructs an instance of StoreOperation.
 /// </summary>
 /// <param name="shardMapManager">ShardMapManager object.</param>
 /// <param name="operationId">Operation Id.</param>
 /// <param name="undoStartState">State from which Undo operation starts.</param>
 /// <param name="opCode">Operation code.</param>
 /// <param name="originalShardVersionRemoves">Original shard version for removes.</param>
 /// <param name="originalShardVersionAdds">Original shard version for adds.</param>
 protected StoreOperation(
     ShardMapManager shardMapManager,
     Guid operationId,
     StoreOperationState undoStartState,
     StoreOperationCode opCode,
     Guid originalShardVersionRemoves,
     Guid originalShardVersionAdds
     )
 {
     this.Id = operationId;
     this.OperationCode = opCode;
     this.Manager = shardMapManager;
     this.UndoStartState = undoStartState;
     _operationState = StoreOperationState.DoBegin;
     _maxDoState = StoreOperationState.DoBegin;
     this.OriginalShardVersionRemoves = originalShardVersionRemoves;
     this.OriginalShardVersionAdds = originalShardVersionAdds;
 }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:27,代码来源:StoreOperation.cs


示例20: UpdateShardOperation

 /// <summary>
 /// Creates request to update shard in given shard map.
 /// </summary>
 /// <param name="shardMapManager">Shard map manager object.</param>
 /// <param name="operationId">Operation id.</param>
 /// <param name="undoStartState">State from which Undo operation starts.</param>
 /// <param name="shardMap">Shard map for which to remove shard.</param>
 /// <param name="shardOld">Shard to update.</param>
 /// <param name="shardNew">Updated shard.</param>
 internal UpdateShardOperation(
     ShardMapManager shardMapManager,
     Guid operationId,
     StoreOperationState undoStartState,
     IStoreShardMap shardMap,
     IStoreShard shardOld,
     IStoreShard shardNew) :
     base(
     shardMapManager,
     operationId,
     undoStartState,
     StoreOperationCode.UpdateShard,
     default(Guid),
     default(Guid))
 {
     _shardMap = shardMap;
     _shardOld = shardOld;
     _shardNew = shardNew;
 }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:28,代码来源:UpdateShardOperation.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ShareCacheStruct类代码示例发布时间:2022-05-24
下一篇:
C# ShardLocation类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap