changelog shortlog graph tags branches files raw help

Mercurial > core / changeset: rocksdb writebatch alien routines, just need callback impls then done

changeset 612: 9238c034b97e
parent 611: 57813b8ee029
child 613: 9ffe93dbe9b9
author: Richard Westhaver <ellis@rwest.io>
date: Mon, 19 Aug 2024 20:00:04 -0400
files: lisp/ffi/rocksdb/writebatch.lisp
description: rocksdb writebatch alien routines, just need callback impls then done
     1.1--- a/lisp/ffi/rocksdb/writebatch.lisp	Mon Aug 19 19:25:55 2024 -0400
     1.2+++ b/lisp/ffi/rocksdb/writebatch.lisp	Mon Aug 19 20:00:04 2024 -0400
     1.3@@ -248,6 +248,81 @@
     1.4 (define-alien-routine rocksdb-writebatch-wi-count void
     1.5   (batch (* rocksdb-writebatch-wi)))
     1.6 
     1.7+(define-alien-routine rocksdb-writebatch-wi-put-log-data void
     1.8+  (batch (* rocksdb-writebatch-wi))
     1.9+  (blob (array unsigned-char))
    1.10+  (len size-t))
    1.11+
    1.12+(define-alien-routine rocksdb-writebatch-wi-iterate void
    1.13+  (batch (* rocksdb-writebatch-wi))
    1.14+  (state (* t))
    1.15+  (put (* t)) ;; function
    1.16+  (deleted (* t)) ;; function
    1.17+  )
    1.18+
    1.19+(define-alien-routine rocksdb-writebatch-wi-data (array unsigned-char)
    1.20+  (batch (* rocksdb-writebatch-wi))
    1.21+  (size (* size-t)))
    1.22+
    1.23+(define-alien-routine rocksdb-writebatch-wi-set-save-point void
    1.24+  (batch (* rocksdb-writebatch-wi)))
    1.25+
    1.26+(def-with-errptr rocksdb-writebatch-wi-rollback-to-save-point void
    1.27+  (batch (* rocksdb-writebatch-wi)))
    1.28+
    1.29+(def-with-errptr rocksdb-writebatch-wi-get-from-batch (array unsigned-char)
    1.30+  (batch (* rocksdb-writebatch-wi))
    1.31+  (opts (* rocksdb-options))
    1.32+  (key (array unsigned-char))
    1.33+  (keylen size-t)
    1.34+  (vallen (* size-t)))
    1.35+
    1.36+(def-with-errptr rocksdb-writebatch-wi-get-from-batch-cf (array unsigned-char)
    1.37+  (batch (* rocksdb-writebatch-wi))
    1.38+  (cf (* rocksdb-column-family-handle))
    1.39+  (opts (* rocksdb-options))
    1.40+  (key (array unsigned-char))
    1.41+  (keylen size-t)
    1.42+  (vallen (* size-t)))
    1.43+
    1.44+(def-with-errptr rocksdb-writebatch-wi-get-from-batch-and-db (array unsigned-char)
    1.45+  (batch (* rocksdb-writebatch-wi))
    1.46+  (db (* rocksdb))
    1.47+  (readopts (* rocksdb-readoptions))
    1.48+  (key (array unsigned-char))
    1.49+  (keylen size-t)
    1.50+  (vallen (* size-t)))
    1.51+
    1.52+(def-with-errptr rocksdb-writebatch-wi-get-from-batch-and-db-cf (array unsigned-char)
    1.53+  (batch (* rocksdb-writebatch-wi))
    1.54+  (db (* rocksdb))
    1.55+  (readopts (* rocksdb-readoptions))
    1.56+  (cf (* rocksdb-column-family-handle))
    1.57+  (key (array unsigned-char))
    1.58+  (keylen size-t)
    1.59+  (vallen (* size-t)))
    1.60+
    1.61+(def-with-errptr rocksdb-write-writebatch-wi void
    1.62+  (db (* rocksdb))
    1.63+  (wopts (* rocksdb-writeoptions))
    1.64+  (wbwi (* rocksdb-writebatch-wi)))
    1.65+
    1.66+(define-alien-routine rocksdb-writebatch-wi-create-iterator-with-base (* rocksdb-iterator)
    1.67+  (wbwi (* rocksdb-writebatch-wi))
    1.68+  (base-iterator (* rocksdb-iterator)))
    1.69+
    1.70+(define-alien-routine rocksdb-writebatch-wi-create-iterator-with-base-cf (* rocksdb-iterator)
    1.71+  (wbwi (* rocksdb-writebatch-wi))
    1.72+  (base-iterator (* rocksdb-iterator))
    1.73+  (cf (* rocksdb-column-family-handle)))
    1.74+
    1.75+(def-with-errptr rocksdb-writebatch-wi-update-timestamps void
    1.76+  (wbwi (* rocksdb-writebatch-wi))
    1.77+  (ts (array unsigned-char))
    1.78+  (tslen size-t)
    1.79+  (state (* t))
    1.80+  (get-ts-size (* t))) ;; function
    1.81+
    1.82 (define-alien-routine rocksdb-writebatch-wi-put void
    1.83   (batch (* rocksdb-writebatch-wi))
    1.84   (key (array unsigned-char))
    1.85@@ -283,18 +358,101 @@
    1.86   (values-list-sizes (array size-t)))
    1.87 
    1.88 (define-alien-routine rocksdb-writebatch-wi-merge void
    1.89-  (batch (* rocksdb-writebatch))
    1.90+  (batch (* rocksdb-writebatch-wi))
    1.91   (key (array unsigned-char))
    1.92   (klen size-t)
    1.93   (val (array unsigned-char))
    1.94   (vlen size-t))
    1.95 
    1.96 (define-alien-routine rocksdb-writebatch-wi-merge-cf void
    1.97-  (batch (* rocksdb-writebatch))
    1.98+  (batch (* rocksdb-writebatch-wi))
    1.99   (cf (* rocksdb-column-family-handle))
   1.100   (key (array unsigned-char))
   1.101   (klen size-t)
   1.102   (val (array unsigned-char))
   1.103   (vlen size-t))
   1.104 
   1.105-;; TODO 2024-08-19: 
   1.106+(define-alien-routine rocksdb-writebatch-wi-mergev void
   1.107+  (batch (* rocksdb-writebatch-wi))
   1.108+  (num-keys int)
   1.109+  (keys-list (array (array unsigned-char)))
   1.110+  (keys-list-sizes (array size-t))
   1.111+  (num-values int)
   1.112+  (values-list (array (array unsigned-char)))
   1.113+  (values-list-sizes (array size-t)))
   1.114+
   1.115+(define-alien-routine rocksdb-writebatch-wi-mergev-cf void
   1.116+  (batch (* rocksdb-writebatch-wi))
   1.117+  (cf (* rocksdb-column-family-handle))
   1.118+  (num-keys int)
   1.119+  (keys-list (array (array unsigned-char)))
   1.120+  (keys-list-sizes (array size-t))
   1.121+  (num-values int)
   1.122+  (values-list (array (array unsigned-char)))
   1.123+  (values-list-sizes (array size-t)))
   1.124+
   1.125+(define-alien-routine rocksdb-writebatch-wi-delete void
   1.126+  (batch (* rocksdb-writebatch-wi))
   1.127+  (key (array unsigned-char))
   1.128+  (klen size-t))
   1.129+
   1.130+(define-alien-routine rocksdb-writebatch-wi-singledelete void
   1.131+  (batch (* rocksdb-writebatch-wi))
   1.132+  (key (array unsigned-char))
   1.133+  (klen size-t))
   1.134+
   1.135+(define-alien-routine rocksdb-writebatch-wi-delete-cf void
   1.136+  (batch (* rocksdb-writebatch-wi))
   1.137+  (cf (* rocksdb-column-family-handle))
   1.138+  (key (array unsigned-char))
   1.139+  (klen size-t))
   1.140+
   1.141+(define-alien-routine rocksdb-writebatch-wi-singledelete-cf void
   1.142+  (batch (* rocksdb-writebatch-wi))
   1.143+  (cf (* rocksdb-column-family-handle))
   1.144+  (key (array unsigned-char))
   1.145+  (klen size-t))
   1.146+
   1.147+(define-alien-routine rocksdb-writebatch-wi-deletev void
   1.148+  (batch (* rocksdb-writebatch-wi))
   1.149+  (num-keys int)
   1.150+  (keys-list (array (array unsigned-char)))
   1.151+  (keys-list-sizes (array size-t)))
   1.152+
   1.153+(define-alien-routine rocksdb-writebatch-wi-deletev-cf void
   1.154+  (batch (* rocksdb-writebatch-wi))
   1.155+  (cf (* rocksdb-column-family-handle))
   1.156+  (num-keys int)
   1.157+  (keys-list (array (array unsigned-char)))
   1.158+  (keys-list-sizes (array size-t)))
   1.159+
   1.160+;;; DO NOT USE
   1.161+(define-alien-routine rocksdb-writebatch-wi-delete-range void
   1.162+  (batch (* rocksdb-writebatch-wi))
   1.163+  (start-key (array unsigned-char))
   1.164+  (start-key-len size-t)
   1.165+  (end-key (array unsigned-char))
   1.166+  (end-key-len size-t))
   1.167+
   1.168+(define-alien-routine rocksdb-writebatch-wi-delete-range-cf void
   1.169+  (batch (* rocksdb-writebatch-wi))
   1.170+  (cf (* rocksdb-column-family-handle))
   1.171+  (start-key (array unsigned-char))
   1.172+  (start-key-len size-t)
   1.173+  (end-key (array unsigned-char))
   1.174+  (end-key-len size-t))
   1.175+
   1.176+(define-alien-routine rocksdb-writebatch-wi-delete-rangev void
   1.177+  (batch (* rocksdb-writebatch-wi))
   1.178+  (start-keys-list (array (array unsigned-char)))
   1.179+  (start-keys-list-sizes (array size-t))
   1.180+  (end-keys-list (array (array unsigned-char)))
   1.181+  (end-keys-list-sizes (array size-t)))
   1.182+
   1.183+(define-alien-routine rocksdb-writebatch-wi-delete-rangev-cf void
   1.184+  (batch (* rocksdb-writebatch-wi))
   1.185+  (cf (* rocksdb-column-family-handle))
   1.186+  (start-keys-list (array (array unsigned-char)))
   1.187+  (start-keys-list-sizes (array size-t))
   1.188+  (end-keys-list (array (array unsigned-char)))
   1.189+  (end-keys-list-sizes (array size-t)))