/// <summary> /// Construct an instance, for the given parameters. /// </summary> protected PrimaryBasedLogViewAdaptor(ILogViewAdaptorHost <TLogView, TLogEntry> host, TLogView initialstate, ILogConsistencyProtocolServices services) { Debug.Assert(host != null && services != null && initialstate != null); this.Host = host; this.Services = services; InitializeConfirmedView(initialstate); worker = new BatchWorkerFromDelegate(Work); }
/// <summary> /// Initialize a new instance of CustomStorageAdaptor class /// </summary> public CustomStorageAdaptor(ILogViewAdaptorHost <TLogView, TLogEntry> host, TLogView initialState, ILogConsistencyProtocolServices services, string primaryCluster) : base(host, initialState, services) { if (!(host is ICustomStorageInterface <TLogView, TLogEntry>)) { throw new BadProviderConfigException("Must implement ICustomStorageInterface<TLogView,TLogEntry> for CustomStorageLogView provider"); } this.primaryCluster = primaryCluster; }
public LogViewAdaptor(ILogViewAdaptorHost <TLogView, TLogEntry> host, TLogView initialState, string grainTypeName, ILogConsistencyProtocolServices services, DocumentClient dbClient, DocumentClient spClient, EventStorageOptions options, JsonSerializerSettings serializerSettings) : base(host, initialState, services) { _grainTypeName = grainTypeName; _client = dbClient; _storedProcClient = spClient; _serializerSettings = serializerSettings; _options = options; _databaseUri = UriFactory.CreateDatabaseUri(options.DatabaseName); _collectionUri = UriFactory.CreateDocumentCollectionUri(options.DatabaseName, options.CollectionName); _commitStoredProcUri = UriFactory.CreateStoredProcedureUri(options.DatabaseName, options.CollectionName, ServerSideRegistry.StoredProcedures.Commit); }
public ILogViewAdaptor <TLogView, TLogEntry> MakeLogViewAdaptor <TLogView, TLogEntry>( ILogViewAdaptorHost <TLogView, TLogEntry> hostGrain, TLogView initialState, string grainTypeName, IGrainStorage grainStorage, ILogConsistencyProtocolServices services) where TLogView : class, new() where TLogEntry : class { return(new LogViewAdaptor <TLogView, TLogEntry>( hostGrain, initialState, grainStorage, grainTypeName, _snapshotStrategy, services, _options.UseIndependentEventStorage, _eventStorage)); }
public LogViewAdaptor( ILogViewAdaptorHost <TLogView, TLogEntry> host, TLogView initialState, IGrainStorage grainStorage, string grainTypeName, Func <SnapshotStrategyInfo, bool> snapshotStrategy, ILogConsistencyProtocolServices services, bool useIndependentEventStorage, IGrainEventStorage eventStorage) : base(host, initialState, services) { _grainStorage = grainStorage; _grainTypeName = grainTypeName; _snapshotStrategy = snapshotStrategy; _useIndependentEventStorage = useIndependentEventStorage; if (useIndependentEventStorage) { _eventStorage = eventStorage ?? throw new ArgumentNullException(nameof(eventStorage), "Must set eventStorage when useIndependentEventStorage is true"); } }
/// <summary> /// Make log view adaptor /// </summary> /// <typeparam name="TView">The type of the view</typeparam> /// <typeparam name="TEntry">The type of the log entries</typeparam> /// <param name="hostGrain">The grain that is hosting this adaptor</param> /// <param name="initialState">The initial state for this view</param> /// <param name="grainTypeName">The type name of the grain</param> /// <param name="grainStorage">Storage provider</param> /// <param name="services">Runtime services for multi-cluster coherence protocols</param> public ILogViewAdaptor <TView, TEntry> MakeLogViewAdaptor <TView, TEntry>(ILogViewAdaptorHost <TView, TEntry> hostGrain, TView initialState, string grainTypeName, IGrainStorage grainStorage, ILogConsistencyProtocolServices services) where TView : class, new() where TEntry : class { return(new LogViewAdaptor <TView, TEntry>(hostGrain, initialState, grainStorage, grainTypeName, services)); }
/// <summary> /// Initialize a StorageProviderLogViewAdaptor class /// </summary> public LogViewAdaptor(ILogViewAdaptorHost <TLogView, TLogEntry> host, TLogView initialState, IStorageProvider globalStorageProvider, string grainTypeName, ILogConsistencyProtocolServices services) : base(host, initialState, services) { this.globalStorageProvider = globalStorageProvider; this.grainTypeName = grainTypeName; }
/// <inheritdoc/> public ILogViewAdaptor <TView, TEntry> MakeLogViewAdaptor <TView, TEntry>(ILogViewAdaptorHost <TView, TEntry> hostgrain, TView initialstate, string graintypename, IGrainStorage grainStorage, ILogConsistencyProtocolServices services) where TView : class, new() where TEntry : class { return(new CustomStorageAdaptor <TView, TEntry>(hostgrain, initialstate, services, PrimaryCluster)); }
public ILogViewAdaptor <T, E> MakeLogViewAdaptor <T, E>(ILogViewAdaptorHost <T, E> hostgrain, T initialstate, string graintypename, IStorageProvider storageProvider, ILogConsistencyProtocolServices services) where T : class, new() where E : class { return(new LogViewAdaptor <T, E>(hostgrain, initialstate, storageProvider, graintypename, services)); }
public ILogViewAdaptor <TLogView, TLogEntry> MakeLogViewAdaptor <TLogView, TLogEntry>(ILogViewAdaptorHost <TLogView, TLogEntry> hostGrain, TLogView initialState, string grainTypeName, IStorageProvider storageProvider, ILogConsistencyProtocolServices services) where TLogView : class, new() where TLogEntry : class { return(new LogViewAdaptor <TLogView, TLogEntry>(hostGrain, initialState, grainTypeName, services, _dbClient, _spClient, _options, _serializerSettings)); }