This is the cl-replica Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:19:37 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-replica
Library for hash-table replication via epidemic algorithms
Dr.-Ing. Igor Sokolov
BSD
1.0.0
packages.lisp
(file).
vector-clock.lisp
(file).
network-io.lisp
(file).
hashtable-ops.lisp
(file).
api.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-replica/cl-replica.asd
cl-replica/packages.lisp
cl-replica/vector-clock.lisp
cl-replica/network-io.lisp
cl-replica/hashtable-ops.lisp
cl-replica/api.lisp
cl-replica/vector-clock.lisp
packages.lisp
(file).
cl-replica
(system).
compare-and-update
(function).
concurrent-access
(condition).
init-timestamp
(function).
make-timestamp
(function).
promote-timestamp
(function).
timestamp
(structure).
timestamp-vclock
(reader).
(setf timestamp-vclock)
(writer).
timestamp<=
(function).
copy-timestamp
(function).
timestamp-p
(function).
ts-1
(reader method).
ts-2
(reader method).
vec-length
(function).
cl-replica/network-io.lisp
packages.lisp
(file).
cl-replica
(system).
connect-to-remote-peer
(function).
make-network-settings
(function).
network-settings-cache-being-processed
(reader).
(setf network-settings-cache-being-processed)
(writer).
network-settings-client-buffer-size
(reader).
(setf network-settings-client-buffer-size)
(writer).
network-settings-encryption-fns
(reader).
(setf network-settings-encryption-fns)
(writer).
network-settings-header-bytes
(reader).
(setf network-settings-header-bytes)
(writer).
network-settings-htable-entry-size
(reader).
(setf network-settings-htable-entry-size)
(writer).
network-settings-max-n-of-tcp-connections
(reader).
(setf network-settings-max-n-of-tcp-connections)
(writer).
network-settings-remove-obsolete-keys-interval
(reader).
(setf network-settings-remove-obsolete-keys-interval)
(writer).
network-settings-server-buffer-size
(reader).
(setf network-settings-server-buffer-size)
(writer).
network-settings-share-cache-interval-in-sec
(reader).
(setf network-settings-share-cache-interval-in-sec)
(writer).
network-settings-stop-hash-table-cleaning
(reader).
(setf network-settings-stop-hash-table-cleaning)
(writer).
network-settings-stop-sync
(reader).
(setf network-settings-stop-sync)
(writer).
network-settings-stop-tcp-client
(reader).
(setf network-settings-stop-tcp-client)
(writer).
network-settings-stop-tcp-server
(reader).
(setf network-settings-stop-tcp-server)
(writer).
network-settings-stop-udp-server
(reader).
(setf network-settings-stop-udp-server)
(writer).
network-settings-tcp-client-reconnection-attempts
(reader).
(setf network-settings-tcp-client-reconnection-attempts)
(writer).
network-settings-tcp-client-try-reconnect-after
(reader).
(setf network-settings-tcp-client-try-reconnect-after)
(writer).
network-settings-time-to-wait-if-no-data
(reader).
(setf network-settings-time-to-wait-if-no-data)
(writer).
network-settings-trailing-bytes
(reader).
(setf network-settings-trailing-bytes)
(writer).
network-settings-udp-socket
(reader).
(setf network-settings-udp-socket)
(writer).
send-echo
(function).
send-update
(function).
start-server
(function).
stop-communication
(function).
address
(reader method).
as-keyword
(function).
cannot-build-lisp-object-from-string
(condition).
checkout-decoder
(function).
copy-decoder
(function).
copy-network-settings
(function).
data
(reader method).
decode
(function).
decode-buffer
(function).
decoder
(structure).
decoder-acc
(reader).
(setf decoder-acc)
(writer).
decoder-acc-min-size
(reader).
(setf decoder-acc-min-size)
(writer).
decoder-decrypt-fn
(reader).
(setf decoder-decrypt-fn)
(writer).
decoder-header-bytes
(reader).
(setf decoder-header-bytes)
(writer).
decoder-header-size
(reader).
(setf decoder-header-size)
(writer).
decoder-p
(function).
decoder-prev-buffer-head
(reader).
(setf decoder-prev-buffer-head)
(writer).
decoder-prev-buffer-trail
(reader).
(setf decoder-prev-buffer-trail)
(writer).
decoder-trailing-bytes
(reader).
(setf decoder-trailing-bytes)
(writer).
decoder-trailing-size
(reader).
(setf decoder-trailing-size)
(writer).
decrypt
(function).
encode
(function).
encrypt
(function).
ensure-no-msg-makers
(function).
error-msg
(reader method).
error-msg
(reader method).
handle-connection
(function).
idx
(reader method).
init-decoder
(function).
make-decoder
(function).
marker
(reader method).
msg-markers-found-in-data
(condition).
network-address-parse-error
(condition).
network-settings
(structure).
network-settings-p
(function).
obj-to-str
(function).
operation
(reader method).
parse-buffer
(function).
parse-network-address
(function).
split-string-by-delimiter
(function).
start-tcp-server
(function).
start-udp-server
(function).
str-to-obj
(function).
try-connect-until-success
(function).
cl-replica/hashtable-ops.lisp
packages.lisp
(file).
vector-clock.lisp
(file).
cl-replica
(system).
apply-updates-from-other-nodes
(function).
cache-being-shared
(condition).
gethash-shared-no-lock
(function).
gvalue-dbind
(macro).
init-gvalue
(function).
make-shared-hash-table
(function).
newhash-shared-no-lock
(function).
remhash-shared-no-lock
(function).
remove-obsolete-keys
(function).
share-cache-periodically
(function).
shared-hash-table-clients-socket-pool
(reader).
(setf shared-hash-table-clients-socket-pool)
(writer).
shared-hash-table-destroyed-p
(reader).
(setf shared-hash-table-destroyed-p)
(writer).
shared-hash-table-last-keys-modified
(reader).
(setf shared-hash-table-last-keys-modified)
(writer).
shared-hash-table-last-keys-modified-max-length
(reader).
(setf shared-hash-table-last-keys-modified-max-length)
(writer).
shared-hash-table-lock
(reader).
(setf shared-hash-table-lock)
(writer).
shared-hash-table-number-of-nodes
(reader).
(setf shared-hash-table-number-of-nodes)
(writer).
shared-hash-table-other-nodes
(reader).
(setf shared-hash-table-other-nodes)
(writer).
shared-hash-table-server-input-queue
(reader).
(setf shared-hash-table-server-input-queue)
(writer).
shared-hash-table-server-socket
(reader).
(setf shared-hash-table-server-socket)
(writer).
shared-hash-table-table
(reader).
(setf shared-hash-table-table)
(writer).
shared-hash-table-this-node
(reader).
(setf shared-hash-table-this-node)
(writer).
shared-hash-table-this-node-idx
(reader).
(setf shared-hash-table-this-node-idx)
(writer).
sort-for-consistency
(function).
call-fn-in-interruptable-thread
(macro).
clean-shared-hash-table
(function).
copy-shared-hash-table
(function).
data
(reader method).
malformed-data
(condition).
msg
(reader method).
nshuffle
(function).
provide-cache
(function).
shared-hash-table
(structure).
shared-hash-table-p
(function).
cl-replica/api.lisp
packages.lisp
(file).
hashtable-ops.lisp
(file).
vector-clock.lisp
(file).
network-io.lisp
(file).
cl-replica
(system).
clrhash-shared
(function).
destroy-shared-htable
(function).
(setf gethash-shared)
(setf expander).
gethash-shared
(function).
maphash-shared
(function).
newhash-shared
(function).
remhash-shared
(function).
share-hash-table
(function).
dbind-with-mutex
(macro).
start-all-network-threads
(function).
stop-all-network-threads
(function).
Packages are listed by definition order.
cl-replica.hashtable-ops
cl-replica.network-io
.
cl-replica.vector-clock
.
common-lisp
.
apply-updates-from-other-nodes
(function).
cache-being-shared
(condition).
gethash-shared-no-lock
(function).
gvalue-dbind
(macro).
init-gvalue
(function).
make-shared-hash-table
(function).
newhash-shared-no-lock
(function).
remhash-shared-no-lock
(function).
remove-obsolete-keys
(function).
share-cache-periodically
(function).
shared-hash-table-clients-socket-pool
(reader).
(setf shared-hash-table-clients-socket-pool)
(writer).
shared-hash-table-destroyed-p
(reader).
(setf shared-hash-table-destroyed-p)
(writer).
shared-hash-table-last-keys-modified
(reader).
(setf shared-hash-table-last-keys-modified)
(writer).
shared-hash-table-last-keys-modified-max-length
(reader).
(setf shared-hash-table-last-keys-modified-max-length)
(writer).
shared-hash-table-lock
(reader).
(setf shared-hash-table-lock)
(writer).
shared-hash-table-number-of-nodes
(reader).
(setf shared-hash-table-number-of-nodes)
(writer).
shared-hash-table-other-nodes
(reader).
(setf shared-hash-table-other-nodes)
(writer).
shared-hash-table-server-input-queue
(reader).
(setf shared-hash-table-server-input-queue)
(writer).
shared-hash-table-server-socket
(reader).
(setf shared-hash-table-server-socket)
(writer).
shared-hash-table-table
(reader).
(setf shared-hash-table-table)
(writer).
shared-hash-table-this-node
(reader).
(setf shared-hash-table-this-node)
(writer).
shared-hash-table-this-node-idx
(reader).
(setf shared-hash-table-this-node-idx)
(writer).
sort-for-consistency
(function).
call-fn-in-interruptable-thread
(macro).
clean-shared-hash-table
(function).
copy-shared-hash-table
(function).
data
(generic reader).
malformed-data
(condition).
msg
(generic reader).
nshuffle
(function).
provide-cache
(function).
shared-hash-table
(structure).
shared-hash-table-p
(function).
cl-replica.vector-clock
common-lisp
.
compare-and-update
(function).
concurrent-access
(condition).
init-timestamp
(function).
make-timestamp
(function).
promote-timestamp
(function).
timestamp
(structure).
timestamp-vclock
(reader).
(setf timestamp-vclock)
(writer).
timestamp<=
(function).
copy-timestamp
(function).
timestamp-p
(function).
ts-1
(generic reader).
ts-2
(generic reader).
vec-length
(function).
cl-replica
cl-replica.hashtable-ops
.
cl-replica.network-io
.
cl-replica.vector-clock
.
common-lisp
.
clrhash-shared
(function).
destroy-shared-htable
(function).
(setf gethash-shared)
(setf expander).
gethash-shared
(function).
maphash-shared
(function).
newhash-shared
(function).
remhash-shared
(function).
share-hash-table
(function).
dbind-with-mutex
(macro).
start-all-network-threads
(function).
stop-all-network-threads
(function).
cl-replica.network-io
common-lisp
.
connect-to-remote-peer
(function).
make-network-settings
(function).
network-settings-cache-being-processed
(reader).
(setf network-settings-cache-being-processed)
(writer).
network-settings-client-buffer-size
(reader).
(setf network-settings-client-buffer-size)
(writer).
network-settings-encryption-fns
(reader).
(setf network-settings-encryption-fns)
(writer).
network-settings-header-bytes
(reader).
(setf network-settings-header-bytes)
(writer).
network-settings-htable-entry-size
(reader).
(setf network-settings-htable-entry-size)
(writer).
network-settings-max-n-of-tcp-connections
(reader).
(setf network-settings-max-n-of-tcp-connections)
(writer).
network-settings-remove-obsolete-keys-interval
(reader).
(setf network-settings-remove-obsolete-keys-interval)
(writer).
network-settings-server-buffer-size
(reader).
(setf network-settings-server-buffer-size)
(writer).
network-settings-share-cache-interval-in-sec
(reader).
(setf network-settings-share-cache-interval-in-sec)
(writer).
network-settings-stop-hash-table-cleaning
(reader).
(setf network-settings-stop-hash-table-cleaning)
(writer).
network-settings-stop-sync
(reader).
(setf network-settings-stop-sync)
(writer).
network-settings-stop-tcp-client
(reader).
(setf network-settings-stop-tcp-client)
(writer).
network-settings-stop-tcp-server
(reader).
(setf network-settings-stop-tcp-server)
(writer).
network-settings-stop-udp-server
(reader).
(setf network-settings-stop-udp-server)
(writer).
network-settings-tcp-client-reconnection-attempts
(reader).
(setf network-settings-tcp-client-reconnection-attempts)
(writer).
network-settings-tcp-client-try-reconnect-after
(reader).
(setf network-settings-tcp-client-try-reconnect-after)
(writer).
network-settings-time-to-wait-if-no-data
(reader).
(setf network-settings-time-to-wait-if-no-data)
(writer).
network-settings-trailing-bytes
(reader).
(setf network-settings-trailing-bytes)
(writer).
network-settings-udp-socket
(reader).
(setf network-settings-udp-socket)
(writer).
send-echo
(function).
send-update
(function).
start-server
(function).
stop-communication
(function).
address
(generic reader).
as-keyword
(function).
cannot-build-lisp-object-from-string
(condition).
checkout-decoder
(function).
copy-decoder
(function).
copy-network-settings
(function).
data
(generic reader).
decode
(function).
decode-buffer
(function).
decoder
(structure).
decoder-acc
(reader).
(setf decoder-acc)
(writer).
decoder-acc-min-size
(reader).
(setf decoder-acc-min-size)
(writer).
decoder-decrypt-fn
(reader).
(setf decoder-decrypt-fn)
(writer).
decoder-header-bytes
(reader).
(setf decoder-header-bytes)
(writer).
decoder-header-size
(reader).
(setf decoder-header-size)
(writer).
decoder-p
(function).
decoder-prev-buffer-head
(reader).
(setf decoder-prev-buffer-head)
(writer).
decoder-prev-buffer-trail
(reader).
(setf decoder-prev-buffer-trail)
(writer).
decoder-trailing-bytes
(reader).
(setf decoder-trailing-bytes)
(writer).
decoder-trailing-size
(reader).
(setf decoder-trailing-size)
(writer).
decrypt
(function).
encode
(function).
encrypt
(function).
ensure-no-msg-makers
(function).
error-msg
(generic reader).
handle-connection
(function).
idx
(generic reader).
init-decoder
(function).
make-decoder
(function).
marker
(generic reader).
msg-markers-found-in-data
(condition).
network-address-parse-error
(condition).
network-settings
(structure).
network-settings-p
(function).
obj-to-str
(function).
operation
(generic reader).
parse-buffer
(function).
parse-network-address
(function).
split-string-by-delimiter
(function).
start-tcp-server
(function).
start-udp-server
(function).
str-to-obj
(function).
try-connect-until-success
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Destructures gvalue and binds its component to vars
gethash-shared
(function).
newhash-shared
(function).
Returns node on which one can all send-update
API to stop all threads inside the shared hash table. A simple hash-table is returned.
Constructs a hash-table shared value from normal value
Deletes key from h-table by setting del-p flag.
See Demers et al., Epidemic Algorithms for Replicated Database Maintenance (1989)
to understand why one cannot simply delete a key-value pair from a replicated
database.
Connects to own tcp server and sends a dummy message.
Is used to promote server loops by one iteration forward in order to let them close the socket.
Send gvalue data to another node
Nondestructively converts hash-table <key,value> into:
1. hash-table <key, #(value, death-certificate, timestamp)>
2. cache (list key timestamp)
and returns shared-hash-table-object.
lock
.
Sort the list of ips.
Throwing this error blocks the API and informs a caller that
an application cannot perform any operation on the shared-hash-table.
Without this explicit condition, the application would be silently
blocked by the mutex inside #’provide-cache. Explicit block is much better
because the application has a possibility to use error handlers
error
.
error
.
When delay >> 1, (sleep delay) would block the thread for a long time.
This macro solves that problem by splitting delay into n-segments time intervals
and by checking stop-flag n-segments times withing the delay.
D-bind variables in vars to h-table-obj structure, acquire the lock, do the job in @body and release the lock
Decodes and then resets the internal buffer (acc) of decoder
Implements two-step buffer decoder
acc
.
Throws error if message markers are found in message
Accumulate buffer content until critical mass is reached. Then decode it.
Recursively traverses buffer and tries hard to find message frames separated by
starting (header-bytes) and terminating (trailing-bytes) sequencies.
The algorithm works well even if
- small buffer size is used
- buffer contains junk data bytes from previous calls
- buffer contains ill-positioned message markers
However, if the buffer size is really tiny, some messages can get lost.
Note: buffer-size and trailing-size are provided as arguments and not calculated inside
the function because a caller knows these values.
Parses tcp://192.168.1.1:5550 to (values :tcp #(192 168 1 1) 5550)
Provides last keys modified in an extended form [(key timestamp) -> (list key value death-cert timestamp )]
Lisp-is-cool-> (Lisp is cool) as strings. Delimiterp is a predicate.
API for activating inter nodes communication
API for disabling inter-nodes communication
Calculates the length of the vector
network-address-parse-error
)) ¶malformed-data
)) ¶data
.
cannot-build-lisp-object-from-string
)) ¶data
.
cannot-build-lisp-object-from-string
)) ¶network-address-parse-error
)) ¶msg-markers-found-in-data
)) ¶idx
.
msg-markers-found-in-data
)) ¶malformed-data
)) ¶msg
.
msg-markers-found-in-data
)) ¶concurrent-access
)) ¶ts-1
.
concurrent-access
)) ¶ts-2
.
error
.
error
.
error
.
error
.
structure-object
.
structure-object
.
structure-object
.
(sb-thread:make-mutex)
Jump to: | (
A C D E F G H I M N O P R S T V |
---|
Jump to: | (
A C D E F G H I M N O P R S T V |
---|
Jump to: | A C D E H I L M N O P R S T U V |
---|
Jump to: | A C D E H I L M N O P R S T U V |
---|
Jump to: | A C D F H M N P S T V |
---|
Jump to: | A C D F H M N P S T V |
---|