Ejemplo n.º 1
0
func get(c *table.Context, done chan *table.Call, zop bool, rowKey, colKey []byte) {
	var err error
	var value []byte
	var score int64
	if zop {
		if done == nil {
			value, score, _, err = c.ZGet(0, rowKey, colKey, 0)
		} else {
			_, err = c.GoZGet(0, rowKey, colKey, 0, done)
		}
	} else {
		if done == nil {
			value, score, _, err = c.Get(0, rowKey, colKey, 0)
		} else {
			_, err = c.GoGet(0, rowKey, colKey, 0, done)
		}
	}
	if err != nil {
		fmt.Printf("Get failed: %s\n", err)
		os.Exit(1)
	}

	if *verbose != 0 && done == nil {
		fmt.Printf("rowKey: %2s, colKey: %s, value: %s, score:%d\n",
			string(rowKey), string(colKey), string(value), score)
	}
}