Exemplo n.º 1
0
// Changes 'b' to a short string >= 'b'
//
// Used to minimize the size of index blocks and other data structures.
func (v *eventStreamComparer) Successor(b []byte) []byte {
	keyB, err := newEventStoreKey(b)
	if err != nil {
		log.Println("A key could not be deserialized:")
		log.Println(string(b))

		// Always a safe result
		return b
	}
	bcomp := comparer.BytesComparer{}
	successor := eventStoreKey{
		bcomp.Successor(keyB.groupKey),
		nil,
		nil,
	}
	return successor.toBytes()
}