예제 #1
0
func (t *transaction) getKey(sel KeySelector, snapshot int) FutureKey {
	key := sel.Key.FDBKey()
	return &futureKey{future: newFuture(C.fdb_transaction_get_key(t.ptr, byteSliceToPtr(key), C.int(len(key)), C.fdb_bool_t(boolToInt(sel.OrEqual)), C.int(sel.Offset), C.fdb_bool_t(snapshot)))}
}
예제 #2
0
func (t *transaction) doGetRange(r Range, options RangeOptions, snapshot bool, iteration int) futureKeyValueArray {
	begin, end := r.FDBRangeKeySelectors()
	bsel := begin.FDBKeySelector()
	esel := end.FDBKeySelector()
	bkey := bsel.Key.FDBKey()
	ekey := esel.Key.FDBKey()

	return futureKeyValueArray{newFuture(C.fdb_transaction_get_range(t.ptr, byteSliceToPtr(bkey), C.int(len(bkey)), C.fdb_bool_t(boolToInt(bsel.OrEqual)), C.int(bsel.Offset), byteSliceToPtr(ekey), C.int(len(ekey)), C.fdb_bool_t(boolToInt(esel.OrEqual)), C.int(esel.Offset), C.int(options.Limit), C.int(0), C.FDBStreamingMode(options.Mode-1), C.int(iteration), C.fdb_bool_t(boolToInt(snapshot)), C.fdb_bool_t(boolToInt(options.Reverse))))}
}
예제 #3
0
func (t *transaction) get(key []byte, snapshot int) FutureByteSlice {
	return &futureByteSlice{future: newFuture(C.fdb_transaction_get(t.ptr, byteSliceToPtr(key), C.int(len(key)), C.fdb_bool_t(snapshot)))}
}
예제 #4
0
func (t *transaction) getKey(sel KeySelector, snapshot int) FutureKey {
	key := sel.Key.ToFDBKey()
	f := &future{C.fdb_transaction_get_key(t.ptr, byteSliceToPtr(key), C.int(len(key)), C.fdb_bool_t(boolToInt(sel.OrEqual)), C.int(sel.Offset), C.fdb_bool_t(snapshot))}
	runtime.SetFinalizer(f, (*future).destroy)
	return FutureKey{&futureKey{future: f}}
}
예제 #5
0
func (t *transaction) doGetRange(r Range, options RangeOptions, snapshot bool, iteration int) futureKeyValueArray {
	begin := r.BeginKeySelector()
	bkey := begin.Key.ToFDBKey()
	end := r.EndKeySelector()
	ekey := end.Key.ToFDBKey()
	f := &future{C.fdb_transaction_get_range(t.ptr, byteSliceToPtr(bkey), C.int(len(bkey)), C.fdb_bool_t(boolToInt(begin.OrEqual)), C.int(begin.Offset), byteSliceToPtr(ekey), C.int(len(ekey)), C.fdb_bool_t(boolToInt(end.OrEqual)), C.int(end.Offset), C.int(options.Limit), C.int(0), C.FDBStreamingMode(options.Mode-1), C.int(iteration), C.fdb_bool_t(boolToInt(snapshot)), C.fdb_bool_t(boolToInt(options.Reverse)))}
	runtime.SetFinalizer(f, (*future).destroy)
	return futureKeyValueArray{f}
}
예제 #6
0
func (t *transaction) get(key []byte, snapshot int) FutureValue {
	f := &future{C.fdb_transaction_get(t.ptr, byteSliceToPtr(key), C.int(len(key)), C.fdb_bool_t(snapshot))}
	runtime.SetFinalizer(f, (*future).destroy)
	return FutureValue{&futureValue{future: f}}
}