private void AddToStore(CustomerLastNameIndexKey k, uint cid) { if (!this.tempStore.ContainsKey(k)) { this.tempStore[k] = new List <uint>(); } this.tempStore[k].Add(cid); }
void BuildAuxIndex(TpccTableKey k, TpccTablePayload v) { var cpk = k as CustomerPkey; var cpl = v as CustomerPayload; Debug.Assert(k != null && v != null); var lastNameKey = CustomerLastNameIndexKey.FromPKeyAndPayload(cpk, cpl); uint cid = cpk.C_ID; AddToStore(lastNameKey, cid); }
public override int SaveTo(VersionDb versionDb) { CreateTable(versionDb, TpccTable.Instance(TableType.CUSTOMER_INDEX)); int recordCount = 0; SyncExecution txExec = new SyncExecution(versionDb); foreach (var kv in this.tempStore) { CustomerLastNameIndexKey lastNameKey = kv.Key; List <uint> cids = kv.Value; txExec.Start(); txExec.Insert( lastNameKey, CustomerLastNamePayloads.FromList(cids)); txExec.Commit(); ++recordCount; } return(recordCount); }