public SportsTeamGrain( #if USE_TRANSACTIONS [TransactionalIndexedState("stateName", GrainStoreName)] #else [NonFaultTolerantWorkflowIndexedState("stateName", GrainStoreName)] #endif IIndexedState <SportsTeamState> indexedState) => this.indexedState = indexedState;
internal TestMultiIndexGrainBase(Type grainClassType, IIndexedState <TGrainState> indexedState) { this.IndexedState = indexedState; var grainInterfaceTypes = ApplicationPartsIndexableGrainLoader.EnumerateIndexedInterfacesForAGrainClassType(grainClassType).ToArray(); Assert.Single(grainInterfaceTypes); var propertiesType = grainInterfaceTypes[0].propertiesType; Assert.True(propertiesType.IsClass); bool isIndexed(string propertyName) { var propInfo = propertiesType.GetProperty(propertyName); return(propInfo.GetCustomAttributes <IndexAttribute>(inherit: false).Any()); } this.IsUniqueIntIndexed = isIndexed(nameof(ITestMultiIndexProperties.UniqueInt)); this.IsUniqueStringIndexed = isIndexed(nameof(ITestMultiIndexProperties.UniqueString)); this.IsNonUniqueIntIndexed = isIndexed(nameof(ITestMultiIndexProperties.NonUniqueInt)); this.IsNonUniqueStringIndexed = isIndexed(nameof(ITestMultiIndexProperties.NonUniqueString)); Assert.True(this.IsUniqueIntIndexed || this.IsUniqueStringIndexed || this.IsNonUniqueIntIndexed || this.IsNonUniqueStringIndexed); }
public TXN_Grain_UIUSNINS_TI_EG_PK( [TransactionalIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <TestMultiIndexState> indexedState) : base(indexedState) { }
public NFT_Grain_Employee_XI_EG_PK( [NonFaultTolerantWorkflowIndexedState(IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <EmployeeGrainState> indexedState) : base(indexedState) { }
public static Task PerformUpdate <TGrainState>(this IIndexedState <TGrainState> indexedState, Action <TGrainState> updateAction) where TGrainState : class, new() => indexedState.PerformUpdate(state => { updateAction(state); return(true); });
public NFT_Grain_UIUSNINS_XI_LZ_PK( [NonFaultTolerantWorkflowIndexedState(IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <TestMultiIndexState> indexedState) : base(indexedState) { }
public NFT_Grain_UIUSNINS_DSMI_LZ_PK( [NonFaultTolerantWorkflowIndexedState(IndexingConstants.IndexedGrainStateName, IndexingTestConstants.CosmosDBGrainStorage)] IIndexedState <TestMultiIndexState> indexedState) : base(indexedState) { }
public IndexingGrainTransactional_PK( [TransactionalIndexedState(IndexUtils.IndexedGrainStateName)] IIndexedState <IndexingState> indexedState) : base(indexedState) { }
public Player3Grain( [FaultTolerantWorkflowIndexedState(IndexingTestConstants.GrainStore)] IIndexedState <PlayerGrainState> indexedState) : base(indexedState) { }
public FT_Grain_UIUSNINS_TI_LZ_SB( [FaultTolerantWorkflowIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <TestMultiIndexState> indexedState) : base(indexedState) { }
public TestMultiIndexGrainTransactional(IIndexedState <TGrainState> indexedState) : base(indexedState) => Debug.Assert(this.GetType().GetConsistencyScheme() == ConsistencyScheme.Transactional);
public TestMultiIndexGrainFaultTolerant(IIndexedState <TGrainState> indexedState) : base(indexedState) => Debug.Assert(this.GetType().GetConsistencyScheme() == ConsistencyScheme.FaultTolerantWorkflow);
public PlayerGrain(IIndexedState <TGrainState> indexedState) => this.indexedState = indexedState;
public TestMultiIndexGrain(IIndexedState <TGrainState> indexedState) => this.testBase = new TestMultiIndexGrainBase <TGrainState>(this.GetType(), indexedState);
public GrainShared2( [NonFaultTolerantWorkflowIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <GrainState> indexedState) : base(indexedState) { }
protected TestEmployeeGrain(IIndexedState <TGrainState> indexedState) => this.indexedState = indexedState;
public TXN_Grain_UIUSNINS_DSMI_EG_PK( [TransactionalIndexedState(IndexingConstants.IndexedGrainStateName, IndexingTestConstants.CosmosDBGrainStorage)] IIndexedState <TestMultiIndexState> indexedState) : base(indexedState) { }
public Player_FT_TI_LZ_PK( [FaultTolerantWorkflowIndexedState(IndexingConstants.IndexedGrainStateName, IndexingTestConstants.GrainStore)] IIndexedState <PlayerGrainState> indexedState) : base(indexedState) { }
public IndexingGrainWorkflowFT_PK( [FaultTolerantWorkflowIndexedState(IndexUtils.IndexedGrainStateName)] IIndexedState <IndexingState> indexedState) : base(indexedState) { }
public FT_Grain_UIUSNINS_DSMI_LZ_SB( [FaultTolerantWorkflowIndexedState(IndexingTestConstants.CosmosDBGrainStorage)] IIndexedState <TestMultiIndexState> indexedState) : base(indexedState) { }
public TXN_Grain_Employee_TI_EG_PK( [TransactionalIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <EmployeeGrainState> indexedState) : base(indexedState) { }
public SportsTeamGrain( [NonFaultTolerantWorkflowIndexedState(GrainStoreName)] IIndexedState <SportsTeamState> indexedState) => this.indexedState = indexedState;
public static Task PerformRead <TGrainState>(this IIndexedState <TGrainState> indexedState) where TGrainState : class, new() => indexedState.PerformRead(_ => true);
public Player_NFT_AI_EG_PSPS( [NonFaultTolerantWorkflowIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <PlayerGrainState> indexedState) : base(indexedState) { }
public Player5GrainNonFaultTolerant( [NonFaultTolerantWorkflowIndexedState(IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <PlayerGrainState> indexedState) : base(indexedState) { }
public TransactionalPlayerGrain( [TransactionalIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <PlayerGrainState> indexedState) : base(indexedState) { }
public FT_Grain_Employee_TI_LZ_SB( [FaultTolerantWorkflowIndexedState(IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <EmployeeGrainState> indexedState) : base(indexedState) { }
public GrainBase(IIndexedState <GrainState> indexedState) => this.indexedState = indexedState;
public Player_FT_TI_LZ_SB( [FaultTolerantWorkflowIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)] IIndexedState <PlayerGrainState> indexedState) : base(indexedState) { }
internal static async Task SetPropertyAndWriteStateAsync <TGrainState>(Action <TGrainState> setterAction, IIndexedState <TGrainState> indexedState, bool retry) where TGrainState : class, new() { const int MaxRetries = 10; int retries = 0; while (true) { try { await indexedState.PerformUpdate(setterAction); return; } catch (Exception) when(retry && retries < MaxRetries) { ++retries; await indexedState.PerformRead(); } } }