Exemple #1
0
// DecodeHandleFromRowKey decodes the string form a row key and returns an int64.
func DecodeHandleFromRowKey(rk string) (int64, error) {
	vals, err := kv.DecodeValue([]byte(rk))
	if err != nil {
		return 0, errors.Trace(err)
	}
	return vals[1].(int64), nil
}
Exemple #2
0
// DecodeValue implements table.Table DecodeValue interface.
func (t *Table) DecodeValue(data []byte, col *column.Col) (interface{}, error) {
	values, err := kv.DecodeValue(data)
	if err != nil {
		return nil, errors.Trace(err)
	}

	return t.unflatten(values[0], col)
}