public void BuildCollect(TableKey tableKey, Transaction.RecordAccessed recordAccessed) { if (tableHasListener) { ChangeRecordCollector recordCollector = new ChangeRecordCollector(tableKey, table, recordAccessed); records.Add(tableKey.Key, recordCollector); } }
public void BuildCollect(TableKey tableKey, Transaction.RecordAccessed recordAccessed) { if (false == tables.TryGetValue(tableKey.TableId, out var tableCollector)) { tableCollector = new ChangeTableCollector(tableKey); tables.Add(tableKey.TableId, tableCollector); } tableCollector.BuildCollect(tableKey, recordAccessed); }
public ChangeRecordCollector(TableKey tableKey, Table table, Transaction.RecordAccessed recordAccessed) { this.recordAccessed = recordAccessed; key = tableKey.Key; // 记录发生了覆盖或者删除,也需要把listener建立好,以便后面Notify。但是就不需要收集log和note了。参见下面的 CollectChanged. Dictionary <int, HashSet <ChangeListener> > tmp = table.ChangeListenerMap.mapCopy; foreach (var e in tmp) { ChangeVariableCollector cvc = table.CreateChangeVariableCollector(e.Key); if (null != cvc) // 忽略掉不正确的 variableId,也许注册的时候加个检查更好,先这样了。 { variables.Add(e.Key, cvc); cvc.listeners = e.Value; } } }
internal abstract void Commit(Transaction.RecordAccessed accessed);