本文整理汇总了C#中IStoreResults类的典型用法代码示例。如果您正苦于以下问题:C# IStoreResults类的具体用法?C# IStoreResults怎么用?C# IStoreResults使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IStoreResults类属于命名空间,在下文中一共展示了IStoreResults类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoGlobalUpdateCachePost
/// <summary>
/// Refreshes the cache on successful commit of the GSM operation.
/// </summary>
/// <param name="result">Operation result.</param>
public override void DoGlobalUpdateCachePost(IStoreResults result)
{
Debug.Assert(result.Result == StoreResult.Success);
// Add cache entry.
_shardMapManager.Cache.AddOrUpdateShardMap(_shardMap);
}
示例2: DoGlobalUpdateCachePre
/// <summary>
/// Invalidates the cache on unsuccessful commit of the GSM operation.
/// </summary>
/// <param name="result">Operation result.</param>
public override void DoGlobalUpdateCachePre(IStoreResults result)
{
if (result.Result == StoreResult.ShardMapDoesNotExist)
{
// Remove cache entry.
_shardMapManager.Cache.DeleteShardMap(_shardMap);
}
}
示例3: HandleDoGlobalExecuteError
/// <summary>
/// Handles errors from the GSM operation after the LSM operations.
/// </summary>
/// <param name="result">Operation result.</param>
public override void HandleDoGlobalExecuteError(IStoreResults result)
{
if (_throwOnFailure)
{
throw new ShardManagementException(
ShardManagementErrorCategory.ShardMapManagerFactory,
ShardManagementErrorCode.ShardMapManagerStoreDoesNotExist,
Errors._Store_ShardMapManager_DoesNotExistGlobal);
}
}
示例4: HandleDoGlobalExecuteError
/// <summary>
/// Handles errors from the GSM operation after the LSM operations.
/// </summary>
/// <param name="result">Operation result.</param>
public override void HandleDoGlobalExecuteError(IStoreResults result)
{
// Possible errors are:
// StoreResult.StoreVersionMismatch
// StoreResult.MissingParametersForStoredProcedure
throw StoreOperationErrorHandler.OnShardMapManagerErrorGlobal(
result,
null,
this.OperationName,
StoreOperationRequestBuilder.SpFindShardMapByNameGlobal);
}
示例5: HandleDoGlobalExecuteError
/// <summary>
/// Handles errors from the GSM operation after the LSM operations.
/// </summary>
/// <param name="result">Operation result.</param>
public override void HandleDoGlobalExecuteError(IStoreResults result)
{
// Expected errors are:
// StoreResult.MissingParametersForStoredProcedure:
// StoreResult.StoreVersionMismatch:
throw StoreOperationErrorHandler.OnShardSchemaInfoErrorGlobal(
result,
"*",
this.OperationName,
StoreOperationRequestBuilder.SpGetAllShardingSchemaInfosGlobal);
}
示例6: HandleDoLocalExecuteError
/// <summary>
/// Handles errors from the LSM operation.
/// </summary>
/// <param name="result">Operation result.</param>
public override void HandleDoLocalExecuteError(IStoreResults result)
{
// Possible errors are:
// StoreResult.StoreVersionMismatch
// StoreResult.MissingParametersForStoredProcedure
throw StoreOperationErrorHandler.OnRecoveryErrorLocal(
result,
null,
this.Location,
ShardManagementErrorCategory.Recovery,
this.OperationName,
StoreOperationRequestBuilder.SpGetAllShardsLocal);
}
示例7: DoGlobalUpdateCachePre
/// <summary>
/// Invalidates the cache on unsuccessful commit of the GSM operation.
/// </summary>
/// <param name="result">Operation result.</param>
public override void DoGlobalUpdateCachePre(IStoreResults result)
{
if (result.Result == StoreResult.ShardMapDoesNotExist)
{
// Remove shard map from cache.
_manager.Cache.DeleteShardMap(_shardMap);
}
if (result.Result == StoreResult.MappingDoesNotExist)
{
// Remove mapping from cache.
_manager.Cache.DeleteMapping(_mapping);
}
}
示例8: HandleDoGlobalExecuteError
/// <summary>
/// Handles errors from the GSM operation after the LSM operations.
/// </summary>
/// <param name="result">Operation result.</param>
public override void HandleDoGlobalExecuteError(IStoreResults result)
{
if (result.Result != StoreResult.ShardMapDoesNotExist)
{
// Possible errors are:
// StoreResult.ShardMapHasShards
// StoreResult.StoreVersionMismatch
// StoreResult.MissingParametersForStoredProcedure
throw StoreOperationErrorHandler.OnShardMapManagerErrorGlobal(
result,
_shardMap,
this.OperationName,
StoreOperationRequestBuilder.SpRemoveShardMapGlobal);
}
}
示例9: HandleDoGlobalExecuteError
/// <summary>
/// Handles errors from the GSM operation after the LSM operations.
/// </summary>
/// <param name="result">Operation result.</param>
public override void HandleDoGlobalExecuteError(IStoreResults result)
{
// SchemaInfoNameDoesNotExist is handled by the callers i.e. Get vs TryGet.
if (result.Result != StoreResult.SchemaInfoNameDoesNotExist)
{
// Expected errors are:
// StoreResult.MissingParametersForStoredProcedure:
// StoreResult.StoreVersionMismatch:
throw StoreOperationErrorHandler.OnShardSchemaInfoErrorGlobal(
result,
_schemaInfoName,
this.OperationName,
StoreOperationRequestBuilder.SpFindShardingSchemaInfoByNameGlobal);
}
}
示例10: HandleDoGlobalExecuteError
/// <summary>
/// Handles errors from the GSM operation after the LSM operations.
/// </summary>
/// <param name="result">Operation result.</param>
public override void HandleDoGlobalExecuteError(IStoreResults result)
{
if (result.Result == StoreResult.ShardMapDoesNotExist)
{
// Remove shard map from cache.
_shardMapManager.Cache.DeleteShardMap(_shardMap);
}
// Possible errors are:
// StoreResult.ShardMapDoesNotExist
// StoreResult.StoreVersionMismatch
// StoreResult.MissingParametersForStoredProcedure
throw StoreOperationErrorHandler.OnShardMapErrorGlobal(
result,
_shardMap,
null, // shard
ShardManagementErrorCategory.ShardMap,
this.OperationName,
StoreOperationRequestBuilder.SpGetAllShardsGlobal);
}
示例11: OnShardMapManagerErrorGlobal
/// <summary>
/// Returns the proper ShardManagementException corresponding to given error code in
/// <paramref name="result"/> for ShardMapManager operations.
/// </summary>
/// <param name="result">Operation result object.</param>
/// <param name="shardMap">Shard map object.</param>
/// <param name="operationName">Operation being performed.</param>
/// <param name="storedProcName">Stored procedure being executed.</param>
/// <returns>ShardManagementException to be raised.</returns>
internal static ShardManagementException OnShardMapManagerErrorGlobal(
IStoreResults result,
IStoreShardMap shardMap,
string operationName,
string storedProcName)
{
switch (result.Result)
{
case StoreResult.ShardMapExists:
Debug.Assert(shardMap != null);
return new ShardManagementException(
ShardManagementErrorCategory.ShardMapManager,
ShardManagementErrorCode.ShardMapAlreadyExists,
Errors._Store_ShardMap_AlreadyExistsGlobal,
shardMap.Name,
storedProcName,
operationName);
case StoreResult.ShardMapHasShards:
Debug.Assert(shardMap != null);
return new ShardManagementException(
ShardManagementErrorCategory.ShardMapManager,
ShardManagementErrorCode.ShardMapHasShards,
Errors._Store_ShardMap_ContainsShardsGlobal,
shardMap.Name,
storedProcName,
operationName);
case StoreResult.StoreVersionMismatch:
case StoreResult.MissingParametersForStoredProcedure:
default:
return StoreOperationErrorHandler.OnCommonErrorGlobal(
result,
operationName,
storedProcName);
}
}
示例12: DoGlobalUpdateCachePost
/// <summary>
/// Refreshes the cache on successful commit of the GSM operation.
/// </summary>
/// <param name="result">Operation result.</param>
public override void DoGlobalUpdateCachePost(IStoreResults result)
{
Debug.Assert(
result.Result == StoreResult.Success ||
result.Result == StoreResult.MappingNotFoundForKey ||
result.Result == StoreResult.ShardMapDoesNotExist);
if (result.Result == StoreResult.Success && _cacheResults)
{
foreach (IStoreMapping sm in result.StoreMappings)
{
_manager.Cache.AddOrUpdateMapping(sm, _policy);
}
}
}
示例13: HandleDoLocalTargetExecuteError
public virtual void HandleDoLocalTargetExecuteError(IStoreResults result)
{
this.inner.HandleDoLocalTargetExecuteError(result);
}
示例14: HandleUndoGlobalPostLocalExecuteError
/// <summary>
/// Handles errors from the undo of GSM operation after LSM operations.
/// </summary>
/// <param name="result">Operation result.</param>
public override void HandleUndoGlobalPostLocalExecuteError(IStoreResults result)
{
if (result.Result == StoreResult.ShardMapDoesNotExist)
{
// Remove shard map from cache.
this.Manager.Cache.DeleteShardMap(_shardMap);
}
// Possible errors are:
// StoreResult.ShardMapDoesNotExist
// StoreResult.StoreVersionMismatch
// StoreResult.MissingParametersForStoredProcedure
throw StoreOperationErrorHandler.OnShardMapperErrorGlobal(
result,
_shardMap,
_mapping.StoreShard,
_errorCategory,
StoreOperationErrorHandler.OperationNameFromStoreOperationCode(this.OperationCode),
StoreOperationRequestBuilder.SpBulkOperationShardMappingsGlobalEnd);
}
示例15: DoGlobalPostLocalUpdateCache
/// <summary>
/// Refreshes the cache on successful commit of the final GSM operation after the LSM operations.
/// </summary>
/// <param name="result">Operation result.</param>
public override void DoGlobalPostLocalUpdateCache(IStoreResults result)
{
// Add mapping to cache.
this.Manager.Cache.AddOrUpdateMapping(_mapping, CacheStoreMappingUpdatePolicy.OverwriteExisting);
}