| 121 | } |
| 122 | |
| 123 | func (o *Oracle) commit(src *api.TxnContext) error { |
| 124 | o.Lock() |
| 125 | defer o.Unlock() |
| 126 | |
| 127 | if o.hasConflict(src) { |
| 128 | return x.ErrConflict |
| 129 | } |
| 130 | // We store src.Keys as string to ensure compatibility with all the various language clients we |
| 131 | // have. But, really they are just uint64s encoded as strings. We use base 36 during creation of |
| 132 | // these keys in FillContext in posting/mvcc.go. |
| 133 | for _, k := range src.Keys { |
| 134 | ki, err := strconv.ParseUint(k, 36, 64) |
| 135 | if err != nil { |
| 136 | glog.Errorf("Got error while parsing conflict key %q: %v\n", k, err) |
| 137 | continue |
| 138 | } |
| 139 | o.keyCommit.Set(ki, src.CommitTs) // CommitTs is handed out before calling this func. |
| 140 | } |
| 141 | return nil |
| 142 | } |
| 143 | |
| 144 | func (o *Oracle) currentState() *pb.OracleDelta { |
| 145 | o.AssertRLock() |