Esempio n. 1
0
File: big.go Progetto: ngaut/ddtxn
func (b *Big) Populate(s *ddtxn.Store, ex *ddtxn.ETransaction) {
	for i := 0; i < int(b.ni); i++ {
		k := ddtxn.BidKey(uint64(i))
		s.CreateKey(k, int32(0), ddtxn.SUM)
	}
	for i := 0; i < b.np; i++ {
		k := ddtxn.ProductKey(i)
		s.CreateKey(k, int32(0), ddtxn.SUM)
	}
}
Esempio n. 2
0
File: buy.go Progetto: ngaut/ddtxn
func (b *Buy) Populate(s *ddtxn.Store, ex *ddtxn.ETransaction) {
	for i := 0; i < b.nbidders; i++ {
		k := ddtxn.ProductKey(i)
		s.CreateKey(k, int32(0), ddtxn.SUM)
	}
	dlog.Printf("Created %v products; np: %v\n", b.nbidders, b.nproducts)
	for i := 0; i < b.nbidders; i++ {
		k := ddtxn.UserKey(uint64(i))
		s.CreateKey(k, "x", ddtxn.WRITE)
	}
	dlog.Printf("Created %v bidders\n", b.nbidders)
	dlog.Printf("Done with Populate")
}