Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PmdbWriteKV(), WriteKV(), PmdbLookupKey(), PmdbReadKV() & ReadKV() -- Parameters Need Improvements #5

Open
00pauln00 opened this issue Dec 19, 2023 · 1 comment
Assignees
Labels
help wanted Extra attention is needed

Comments

@00pauln00
Copy link
Owner

00pauln00 commented Dec 19, 2023

func PmdbWriteKV(app_id unsafe.Pointer, pmdb_handle unsafe.Pointer, key string, key_len int64, 
                               value string, value_len int64, gocolfamily string) int {
  1. Can we not simply use PumiceDBServer.PmdbCbArgs instead of the first 2 parameters? This would reduce the parameter list and prevent the passing of 2 unsafe.Pointers.
  2. key and value need to be of type []byte.

Here's an example from https://github.com/linxGnu/grocksdb/blob/master/write_batch.go

// Put queues a key-value pair.
func (wb *WriteBatch) Put(key, value []byte) {
	cKey := refGoBytes(key)
	cValue := refGoBytes(value)
	C.rocksdb_writebatch_put(wb.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
}

On the read side, PmdbReadKV() and friends (including LookupKey()) should use PumiceDBServer.PmdbCbArgs instead of unsafe.Pointer and []byte instead of string.

func PmdbWriteKV(app_id unsafe.Pointer, pmdb_handle unsafe.Pointer, key string,

@00pauln00 00pauln00 added the help wanted Extra attention is needed label Dec 19, 2023
@00pauln00 00pauln00 changed the title PmdbWriteKV() and WriteKV() Parameters Need Improvements PmdbWriteKV(), WriteKV(), PmdbLookupKey(), PmdbReadKV() & ReadKV() -- Parameters Need Improvements Dec 19, 2023
@ashwini-8 ashwini-8 self-assigned this Jan 4, 2024
@ashwini-8
Copy link
Collaborator

pushed changes to this branch
#6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants