public async Task Execute(CancellationToken cancel) { m_dmc = DynamicMemoryCloud.Instance; if (m_from != null) { await DoReplication(); } await DoUpdateChunkTable(); // At this stage, the data has been safely placed into target replicas. }
public HealthMonitor(CancellationToken token, INameService namesvc, CloudIndex idx, IHealthManager healthmgr, int redundancy) { m_cancel = token; m_namesvc = namesvc; m_healthmgr = healthmgr; m_idx = idx; m_redundancy = redundancy; m_mc = DynamicMemoryCloud.Instance; m_part_ev = new AsyncManualResetEvent(false); m_cloud_ev = new AsyncManualResetEvent(false); m_parthealthproc = Utils.Daemon(m_cancel, "PartitionHealthMonitor", 20000, PartitionHealthMonitorProc); m_rephealthproc = Utils.Daemon(m_cancel, "ReplicaHealthMonitor", 20000, ReplicaHealthMonitorProc); m_cloudhealthproc = Utils.Daemon(m_cancel, "MemoryCloudHealthMonitor", 20000, MemoryCloudHealthMonitorProc); }
public static async Task StartServiceAsync(string serviceTypeName) { var ready = DynamicMemoryCloud.WaitReadyAsync(); var start = ServiceRuntime.RegisterServiceAsync(serviceTypeName, context => new GraphEngineService(context)); await start.ConfigureAwait(false); await ready.ConfigureAwait(false); var my_initial_role = GraphEngineStatefulServiceRuntime.Instance.Role; if (my_initial_role != ReplicaRole.Primary) { await Task.Delay(Timeout.Infinite); } }