This is the cl-naive-store Reference Manual, version 2021.5.18, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:15:49 2024 GMT+0.
cl-naive-store/cl-naive-store.asd
cl-naive-store.naive-core/cl-naive-store.naive-core.asd
cl-naive-store.document-types/cl-naive-store.document-types.asd
cl-naive-store.definitions/cl-naive-store.definitions.asd
cl-naive-store.naive-documents/cl-naive-store.naive-documents.asd
cl-naive-store.naive-indexed/cl-naive-store.naive-indexed.asd
cl-naive-store.naive-merkle/cl-naive-store.naive-merkle.asd
cl-naive-store.naive-core/src/naive-store/packages.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/package.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/common.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/files.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/logs.lisp
cl-naive-store.naive-core/src/naive-store/naive-core.lisp
cl-naive-store.naive-core/src/naive-store/documents.lisp
cl-naive-store.naive-core/src/naive-store/blob.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/naive-core.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/parse-document.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/persist-document.lisp
cl-naive-store.naive-core/src/naive-store/load.lisp
cl-naive-store.naive-core/src/naive-store/query.lisp
cl-naive-store.naive-core/src/naive-store/maintenance.lisp
cl-naive-store.document-types/src/document-types/packages.lisp
cl-naive-store.document-types/src/document-types/document-types.lisp
cl-naive-store.definitions/src/definitions/packages.lisp
cl-naive-store.definitions/src/definitions/definitions.lisp
cl-naive-store.naive-documents/src/naive-documents/packages.lisp
cl-naive-store.naive-documents/src/naive-documents/documents-impl/package.lisp
cl-naive-store.naive-documents/src/naive-documents/naive-documents.lisp
cl-naive-store.naive-documents/src/naive-documents/documents-impl/parse-document.lisp
cl-naive-store.naive-documents/src/naive-documents/documents-impl/persist-document.lisp
cl-naive-store.naive-documents/src/naive-documents/document-types.lisp
cl-naive-store.naive-documents/src/naive-documents/documents.lisp
cl-naive-store.naive-documents/src/naive-documents/indexed.lisp
cl-naive-store.naive-documents/src/naive-documents/query.lisp
cl-naive-store.naive-documents/src/naive-documents/export.lisp
cl-naive-store.naive-documents/src/naive-documents/export-csv.lisp
cl-naive-store.naive-documents/src/naive-documents/export-json.lisp
cl-naive-store.naive-indexed/src/naive-indexed/packages.lisp
cl-naive-store.naive-indexed/src/naive-indexed/naive-indexed.lisp
cl-naive-store.naive-indexed/src/naive-indexed/indexed-impl.lisp
cl-naive-store.naive-indexed/src/naive-indexed/parse-document.lisp
cl-naive-store.naive-indexed/src/naive-indexed/query.lisp
cl-naive-store.naive-merkle/src/naive-merkle/package.lisp
cl-naive-store.naive-merkle/src/naive-merkle/merkle.lisp
The main system appears first, followed by any subsystem dependency.
cl-naive-store
cl-naive-store.naive-core
cl-naive-store.document-types
cl-naive-store.definitions
cl-naive-store.naive-documents
cl-naive-store.naive-indexed
cl-naive-store.naive-merkle
cl-naive-store
This is a persisted, in memory (lazy loading) document store for Common Lisp.
Phil Marneweck
MIT
2021.5.18
cl-naive-store.naive-core
(system).
cl-naive-store.document-types
(system).
cl-naive-store.definitions
(system).
cl-naive-store.naive-documents
(system).
cl-naive-store.naive-indexed
(system).
cl-naive-store.naive-merkle
(system).
cl-naive-store.naive-core
This is a naive, persisted, in memory (lazy loading) data store for Common Lisp.
Phil Marneweck
MIT
2021.5.18
cl-fad
(system).
split-sequence
(system).
uuid
(system).
local-time
(system).
cl-getx
(system).
cl-murmurhash
(system).
ironclad
(system).
lparallel
(system).
cl-cpus
(system).
bordeaux-threads
(system).
src/naive-store/packages.lisp
(file).
src/naive-store/naive-impl/package.lisp
(file).
src/naive-store/naive-impl/common.lisp
(file).
src/naive-store/naive-impl/files.lisp
(file).
src/naive-store/naive-impl/logs.lisp
(file).
src/naive-store/naive-core.lisp
(file).
src/naive-store/documents.lisp
(file).
src/naive-store/blob.lisp
(file).
src/naive-store/naive-impl/naive-core.lisp
(file).
src/naive-store/naive-impl/parse-document.lisp
(file).
src/naive-store/naive-impl/persist-document.lisp
(file).
src/naive-store/load.lisp
(file).
src/naive-store/query.lisp
(file).
src/naive-store/maintenance.lisp
(file).
cl-naive-store.document-types
This is a naive, persisted, in memory (lazy loading) data store for Common Lisp.
Phil Marneweck
MIT
2021.5.18
cl-naive-store.naive-core
(system).
cl-naive-store.definitions
This is a naive, declaritive implementation of the entities that make up a naive store.
Phil Marneweck
MIT
2023.7.22
cl-naive-store.naive-core
(system).
cl-naive-store.document-types
(system).
src/definitions/packages.lisp
(file).
src/definitions/definitions.lisp
(file).
cl-naive-store.naive-documents
This is a naive, persisted, in memory (lazy loading) data store for Common Lisp.
Phil Marneweck
MIT
2021.5.18
cl-naive-store.naive-core
(system).
cl-naive-store.naive-indexed
(system).
cl-naive-store.document-types
(system).
src/naive-documents/packages.lisp
(file).
src/naive-documents/documents-impl/package.lisp
(file).
src/naive-documents/naive-documents.lisp
(file).
src/naive-documents/documents-impl/parse-document.lisp
(file).
src/naive-documents/documents-impl/persist-document.lisp
(file).
src/naive-documents/document-types.lisp
(file).
src/naive-documents/documents.lisp
(file).
src/naive-documents/indexed.lisp
(file).
src/naive-documents/query.lisp
(file).
src/naive-documents/export.lisp
(file).
src/naive-documents/export-csv.lisp
(file).
src/naive-documents/export-json.lisp
(file).
cl-naive-store.naive-indexed
This is a naive, persisted, in memory (lazy loading) data store for Common Lisp.
Phil Marneweck
MIT
2021.5.18
cl-naive-store.naive-core
(system).
src/naive-indexed/packages.lisp
(file).
src/naive-indexed/naive-indexed.lisp
(file).
src/naive-indexed/indexed-impl.lisp
(file).
src/naive-indexed/parse-document.lisp
(file).
src/naive-indexed/query.lisp
(file).
cl-naive-store.naive-merkle
This is a naive, persisted, in memory (lazy loading) data store for Common Lisp.
Phil Marneweck
MIT
2021.5.18
cl-naive-store.naive-documents
(system).
src/naive-merkle/package.lisp
(file).
src/naive-merkle/merkle.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-naive-store/cl-naive-store.asd
cl-naive-store.naive-core/cl-naive-store.naive-core.asd
cl-naive-store.document-types/cl-naive-store.document-types.asd
cl-naive-store.definitions/cl-naive-store.definitions.asd
cl-naive-store.naive-documents/cl-naive-store.naive-documents.asd
cl-naive-store.naive-indexed/cl-naive-store.naive-indexed.asd
cl-naive-store.naive-merkle/cl-naive-store.naive-merkle.asd
cl-naive-store.naive-core/src/naive-store/packages.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/package.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/common.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/files.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/logs.lisp
cl-naive-store.naive-core/src/naive-store/naive-core.lisp
cl-naive-store.naive-core/src/naive-store/documents.lisp
cl-naive-store.naive-core/src/naive-store/blob.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/naive-core.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/parse-document.lisp
cl-naive-store.naive-core/src/naive-store/naive-impl/persist-document.lisp
cl-naive-store.naive-core/src/naive-store/load.lisp
cl-naive-store.naive-core/src/naive-store/query.lisp
cl-naive-store.naive-core/src/naive-store/maintenance.lisp
cl-naive-store.document-types/src/document-types/packages.lisp
cl-naive-store.document-types/src/document-types/document-types.lisp
cl-naive-store.definitions/src/definitions/packages.lisp
cl-naive-store.definitions/src/definitions/definitions.lisp
cl-naive-store.naive-documents/src/naive-documents/packages.lisp
cl-naive-store.naive-documents/src/naive-documents/documents-impl/package.lisp
cl-naive-store.naive-documents/src/naive-documents/naive-documents.lisp
cl-naive-store.naive-documents/src/naive-documents/documents-impl/parse-document.lisp
cl-naive-store.naive-documents/src/naive-documents/documents-impl/persist-document.lisp
cl-naive-store.naive-documents/src/naive-documents/document-types.lisp
cl-naive-store.naive-documents/src/naive-documents/documents.lisp
cl-naive-store.naive-documents/src/naive-documents/indexed.lisp
cl-naive-store.naive-documents/src/naive-documents/query.lisp
cl-naive-store.naive-documents/src/naive-documents/export.lisp
cl-naive-store.naive-documents/src/naive-documents/export-csv.lisp
cl-naive-store.naive-documents/src/naive-documents/export-json.lisp
cl-naive-store.naive-indexed/src/naive-indexed/packages.lisp
cl-naive-store.naive-indexed/src/naive-indexed/naive-indexed.lisp
cl-naive-store.naive-indexed/src/naive-indexed/indexed-impl.lisp
cl-naive-store.naive-indexed/src/naive-indexed/parse-document.lisp
cl-naive-store.naive-indexed/src/naive-indexed/query.lisp
cl-naive-store.naive-merkle/src/naive-merkle/package.lisp
cl-naive-store.naive-merkle/src/naive-merkle/merkle.lisp
cl-naive-store/cl-naive-store.asd
cl-naive-store
(system).
cl-naive-store.naive-core/cl-naive-store.naive-core.asd
cl-naive-store.naive-core
(system).
cl-naive-store.document-types/cl-naive-store.document-types.asd
cl-naive-store.document-types
(system).
cl-naive-store.definitions/cl-naive-store.definitions.asd
cl-naive-store.definitions
(system).
cl-naive-store.naive-documents/cl-naive-store.naive-documents.asd
cl-naive-store.naive-documents
(system).
cl-naive-store.naive-indexed/cl-naive-store.naive-indexed.asd
cl-naive-store.naive-indexed
(system).
cl-naive-store.naive-merkle/cl-naive-store.naive-merkle.asd
cl-naive-store.naive-merkle
(system).
cl-naive-store.naive-core/src/naive-store/packages.lisp
cl-naive-store.naive-core
(system).
cl-naive-store.naive-core/src/naive-store/naive-impl/package.lisp
src/naive-store/packages.lisp
(file).
cl-naive-store.naive-core
(system).
cl-naive-store.naive-core/src/naive-store/naive-impl/common.lisp
cl-naive-store.naive-core
(system).
%loading-shard%
(special variable).
*disable-parallel-p*
(special variable).
*lock*
(special variable).
do-sequence
(macro).
empty-p
(function).
frmt
(function).
get-query-cache
(function).
gethash-safe
(generic function).
(setf gethash-safe)
(generic function).
make-mac
(generic function).
map-append
(function).
maphash-collect
(function).
plist-to-pairs
(function).
plist-to-values
(function).
remhash-safe
(generic function).
set-query-cache
(function).
trim-whitespace
(function).
*mac-key*
(special variable).
*query-cache*
(special variable).
call-do-sequence
(function).
cl-naive-store.naive-core/src/naive-store/naive-impl/files.lisp
cl-naive-store.naive-core
(system).
file-to-string
(function).
sexp-from-file
(function).
(setf sexp-from-file)
(function).
with-file-lock
(macro).
with-open-file-lock
(macro).
write-to-file
(function).
write-list-items-to-file
(function).
write-to-stream
(function).
cl-naive-store.naive-core/src/naive-store/naive-impl/logs.lisp
cl-naive-store.naive-core
(system).
*break-on-error-log*
(special variable).
*debug-log-p*
(special variable).
debug-log
(function).
write-log
(function).
*break-on-debug-log*
(special variable).
*now*
(special variable).
*short-months*
(special variable).
*std-lock*
(special variable).
*time-zone*
(special variable).
format-date-time
(function).
format-universal-date-time
(function).
get-temp
(function).
iso-timestamp-now
(function).
short-month-name
(function).
cl-naive-store.naive-core/src/naive-store/naive-core.lisp
cl-naive-store.naive-core
(system).
add-collection
(generic function).
add-store
(generic function).
clear-collection
(generic function).
collection
(class).
collection-class
(reader method).
(setf collection-class)
(writer method).
collections
(reader method).
(setf collections)
(writer method).
data-loaded-p
(generic function).
document-shard-mac
(function).
documents
(method).
documents
(reader method).
(setf documents)
(writer method).
ensure-location
(generic function).
get-collection
(generic function).
get-collection-from-def
(generic function).
get-shard
(generic function).
get-store
(generic function).
get-store-from-def
(function).
keys
(reader method).
(setf keys)
(writer method).
load-data
(generic function).
location
(reader method).
location
(reader method).
location
(reader method).
location
(reader method).
(setf location)
(writer method).
(setf location)
(writer method).
(setf location)
(writer method).
(setf location)
(writer method).
lock
(reader method).
(setf lock)
(writer method).
mac
(reader method).
(setf mac)
(writer method).
make-shard
(generic function).
match-shard
(function).
name
(reader method).
name
(reader method).
(setf name)
(writer method).
(setf name)
(writer method).
persist
(generic function).
persist-collection
(function).
persist-collection-def
(generic function).
print-object
(method).
print-object
(method).
print-object
(method).
remove-collection
(generic function).
shard
(class).
shards
(reader method).
(setf shards)
(writer method).
short-mac
(generic function).
status
(generic function).
(setf status)
(generic function).
store
(reader method).
(setf store)
(writer method).
store
(class).
store-class
(reader method).
(setf store-class)
(writer method).
stores
(reader method).
(setf stores)
(writer method).
universe
(reader method).
(setf universe)
(writer method).
universe
(class).
*shards-cache-lock*
(special variable).
*shards-macs-cache-lock*
(special variable).
get-shard-cache-safe%
(function).
get-shard-mac-cache-safe%
(function).
set-shard-cache-safe%
(function).
set-shard-mac-cache-safe%
(function).
shard-elements
(reader method).
(setf shard-elements)
(writer method).
shards-cache%
(reader method).
(setf shards-cache%)
(writer method).
shards-macs-cache%
(reader method).
(setf shards-macs-cache%)
(writer method).
cl-naive-store.naive-core/src/naive-store/documents.lisp
src/naive-store/naive-core.lisp
(file).
cl-naive-store.naive-core
(system).
add-document
(generic function).
delete-document
(generic function).
deleted-p
(generic function).
(setf deleted-p)
(generic function).
document-values
(generic function).
existing-document
(generic function).
key-values
(generic function).
persist-document
(generic function).
remove-document
(generic function).
ensure-shard
(function).
cl-naive-store.naive-core/src/naive-store/blob.lisp
src/naive-store/documents.lisp
(file).
cl-naive-store.naive-core
(system).
blob
(structure).
blob-file-ext
(reader).
(setf blob-file-ext)
(writer).
blob-file-type
(reader).
(setf blob-file-type)
(writer).
blob-location
(reader).
(setf blob-location)
(writer).
blob-p
(function).
blob-raw
(reader).
(setf blob-raw)
(writer).
blob-ref-p
(function).
blob-string-value
(function).
(setf getx)
(method).
getx
(method).
make-blob
(function).
read-blob
(function).
write-blob
(function).
blob-parent-accessor
(reader).
(setf blob-parent-accessor)
(writer).
blob-ref-values
(function).
copy-blob
(function).
reference-form
(method).
cl-naive-store.naive-core/src/naive-store/naive-impl/naive-core.lisp
cl-naive-store.naive-core
(system).
get-collection*
(function).
get-store*
(function).
cl-naive-store.naive-core/src/naive-store/naive-impl/parse-document.lisp
cl-naive-store.naive-core
(system).
compose-document
(generic function).
compose-parse
(generic function).
compose-special
(generic function).
find-document-by-hash
(generic function).
load-document-reference-collection
(function).
type-of-sexp
(generic function).
cl-naive-store.naive-core/src/naive-store/naive-impl/persist-document.lisp
cl-naive-store.naive-core
(system).
persist-delete-document
(generic function).
persist-form
(generic function).
persist-parse
(generic function).
type-of-doc-element
(generic function).
cl-naive-store.naive-core/src/naive-store/load.lisp
cl-naive-store.naive-core
(system).
find-collection-definitions
(function).
load-data
(method).
load-store
(generic function).
load-stores
(generic function).
*files*
(special variable).
find-collection-files
(function).
find-store-definitions
(function).
load-collections
(generic function).
load-shard
(generic function).
load-shards
(function).
cl-naive-store.naive-core/src/naive-store/query.lisp
src/naive-store/naive-core.lisp
(file).
cl-naive-store.naive-core
(system).
naive-reduce
(generic function).
query-data
(generic function).
query-document
(generic function).
*query-lock*
(special variable).
cl-naive-store.naive-core/src/naive-store/maintenance.lisp
cl-naive-store.naive-core
(system).
sanitize-data-file
(generic function).
sanitize-universe
(generic function).
cl-naive-store.document-types/src/document-types/packages.lisp
cl-naive-store.document-types
(system).
cl-naive-store.document-types/src/document-types/document-types.lisp
src/document-types/packages.lisp
(file).
cl-naive-store.document-types
(system).
add-collection
(method).
add-document-type
(generic function).
attributes
(reader method).
(setf attributes)
(writer method).
document-of-type-p
(generic function).
document-type
(reader method).
(setf document-type)
(writer method).
document-type
(class).
document-type-class
(reader method).
(setf document-type-class)
(writer method).
document-type-collection-mixin
(class).
document-type-store-mixin
(class).
document-types
(reader method).
(setf document-types)
(writer method).
element
(class).
element-class
(reader method).
(setf element-class)
(writer method).
elements
(reader method).
(setf elements)
(writer method).
get-attribute
(generic function).
get-collection-from-def
(method).
get-document-type
(generic function).
get-document-type-from-def
(generic function).
get-element
(generic function).
(setf getx)
(method).
getx
(method).
(setf getx)
(method).
getx
(method).
key-p
(reader method).
(setf key-p)
(writer method).
key-values
(method).
label
(reader method).
(setf label)
(writer method).
load-store
(method).
name
(reader method).
name
(reader method).
(setf name)
(writer method).
(setf name)
(writer method).
persist
(method).
persist-collection-def
(method).
store
(reader method).
(setf store)
(writer method).
concrete-type
(reader method).
(setf concrete-type)
(writer method).
load-store-collections
(method).
load-store-document-types
(function).
values-from-key-elements%
(function).
cl-naive-store.definitions/src/definitions/packages.lisp
cl-naive-store.definitions
(system).
cl-naive-store.definitions/src/definitions/definitions.lisp
src/definitions/packages.lisp
(file).
cl-naive-store.definitions
(system).
create-multiverse
(function).
build-adjacency-list
(function).
create-collections
(function).
create-document-types
(function).
depth-first-search
(function).
get-collection-names
(function).
get-collections-dependencies
(function).
get-document-types
(function).
get-referenced-types
(function).
get-topological-order
(function).
sublist-in-order-p
(function).
topological-sort
(function).
walk-data-filter
(function).
cl-naive-store.naive-documents/src/naive-documents/packages.lisp
cl-naive-store.naive-documents
(system).
cl-naive-store.naive-documents/src/naive-documents/documents-impl/package.lisp
cl-naive-store.naive-documents
(system).
cl-naive-store.naive-documents/src/naive-documents/naive-documents.lisp
cl-naive-store.naive-documents
(system).
document
(structure).
document-changes
(reader).
(setf document-changes)
(writer).
document-collection
(reader).
(setf document-collection)
(writer).
document-collection
(class).
document-deleted-p
(reader).
(setf document-deleted-p)
(writer).
document-document-type
(reader).
(setf document-document-type)
(writer).
document-elements
(reader).
(setf document-elements)
(writer).
document-hash
(reader).
(setf document-hash)
(writer).
document-p
(function).
document-store
(reader).
(setf document-store)
(writer).
document-store
(class).
document-values
(method).
document-versions
(reader).
(setf document-versions)
(writer).
getxn
(generic function).
getxo
(generic function).
hash
(method).
(setf hash)
(method).
key-values
(method).
make-document
(function).
murmurhash
(method).
place-exists-p
(method).
copy-document
(function).
document-list-p
(function).
document-persisted-p
(reader).
(setf document-persisted-p)
(writer).
exists-p
(method).
key-values%%
(function).
cl-naive-store.naive-documents/src/naive-documents/documents-impl/parse-document.lisp
cl-naive-store.naive-documents
(system).
compose-document
(method).
compose-special
(method).
compose-special
(method).
compose-special
(method).
type-of-sexp
(method).
document-values-p
(function).
cl-naive-store.naive-documents/src/naive-documents/documents-impl/persist-document.lisp
cl-naive-store.naive-documents
(system).
persist-form
(method).
persist-form
(method).
persist-form
(method).
persist-form
(method).
persist-parse
(method).
type-of-doc-element
(method).
cl-naive-store.naive-documents/src/naive-documents/document-types.lisp
cl-naive-store.naive-documents
(system).
cl-naive-store.naive-documents/src/naive-documents/documents.lisp
cl-naive-store.naive-documents
(system).
deleted-p
(method).
(setf deleted-p)
(method).
persist-document
(method).
check-keys-and-synq
(function).
persist-merge-document
(function).
reference-documents-equal-p
(function).
cl-naive-store.naive-documents/src/naive-documents/indexed.lisp
cl-naive-store.naive-documents
(system).
index-values
(method).
cl-naive-store.naive-documents/src/naive-documents/query.lisp
src/naive-documents/indexed.lisp
(file).
cl-naive-store.naive-documents
(system).
(setf digx)
(method).
digx
(method).
find-equalp-document
(function).
(setf getx)
(method).
getx
(method).
*change-control-p*
(special variable).
find-document-by-value
(function).
naive-dig
(function).
set-naive-dig
(function).
cl-naive-store.naive-documents/src/naive-documents/export.lisp
src/naive-documents/indexed.lisp
(file).
cl-naive-store.naive-documents
(system).
documents-to-plist
(function).
document-pair-to-plist
(function).
parse-document
(function).
cl-naive-store.naive-documents/src/naive-documents/export-csv.lisp
src/naive-documents/export.lisp
(file).
cl-naive-store.naive-documents
(system).
document-list-to-csv
(function).
treemap-csv
(function).
write-pair-csv
(function).
cl-naive-store.naive-documents/src/naive-documents/export-json.lisp
src/naive-documents/export.lisp
(file).
cl-naive-store.naive-documents
(system).
document-list-to-json
(function).
lambda-p
(function).
treemap-json
(function).
write-pair-json
(function).
cl-naive-store.naive-indexed/src/naive-indexed/packages.lisp
cl-naive-store.naive-indexed
(system).
cl-naive-store.naive-indexed/src/naive-indexed/naive-indexed.lisp
src/naive-indexed/packages.lisp
(file).
cl-naive-store.naive-indexed
(system).
*do-partial-indexing*
(special variable).
add-document
(method).
add-index
(generic function).
clear-documents
(method).
existing-document
(method).
get-shard
(method).
hash
(generic function).
(setf hash)
(generic function).
index-lookup-hash
(generic function).
index-lookup-values
(generic function).
indexed-collection-mixin
(class).
indexes
(reader method).
(setf indexes)
(writer method).
key-value-index
(reader method).
(setf key-value-index)
(writer method).
make-shard
(method).
remove-document
(method).
remove-index
(generic function).
hash-index
(reader method).
(setf hash-index)
(writer method).
indexed-shard
(class).
try-better-value-match
(function).
cl-naive-store.naive-indexed/src/naive-indexed/indexed-impl.lisp
cl-naive-store.naive-indexed
(system).
index-values
(generic function).
push-value-index
(generic function).
remove-value-index
(generic function).
hash-values
(function).
populate-partial-value-index
(function).
populate-value-index
(function).
remove-index-values
(function).
remove-partial-value-index
(function).
cl-naive-store.naive-indexed/src/naive-indexed/parse-document.lisp
cl-naive-store.naive-indexed
(system).
compose-special
(method).
find-document-by-hash
(method).
cl-naive-store.naive-indexed/src/naive-indexed/query.lisp
cl-naive-store.naive-indexed
(system).
naive-reduce
(method).
query-data
(method).
*index-query-lock*
(special variable).
indexed-values
(function).
cl-naive-store.naive-merkle/src/naive-merkle/package.lisp
cl-naive-store.naive-merkle
(system).
cl-naive-store.naive-merkle/src/naive-merkle/merkle.lisp
src/naive-merkle/package.lisp
(file).
cl-naive-store.naive-merkle
(system).
branch
(function).
calc
(function).
calc-branch
(function).
calc-document
(function).
children
(reader method).
(setf children)
(writer method).
leaf-p
(function).
make-document-hash
(function).
make-hash
(function).
make-node
(function).
map-tree
(function).
merkle-hash
(reader method).
(setf merkle-hash)
(writer method).
merkle-node
(class).
merkle-sum
(reader method).
(setf merkle-sum)
(writer method).
node-p
(function).
parent
(reader method).
(setf parent)
(writer method).
recalc
(function).
tree-from-reference-tree
(function).
tree-to-reference-tree
(function).
Packages are listed by definition order.
naive-impl
documents-impl
cl-naive-store.definitions
cl-naive-store.naive-indexed
cl-naive-merkle
cl-naive-store.document-types
cl-naive-store.naive-core
indexed-impl
cl-naive-store.naive-documents
naive-impl
cl-getx
.
cl-naive-store.naive-core
.
common-lisp
.
%loading-shard%
(special variable).
*break-on-error-log*
(special variable).
*debug-log-p*
(special variable).
*lock*
(special variable).
compose-document
(generic function).
compose-parse
(generic function).
compose-special
(generic function).
debug-log
(function).
file-to-string
(function).
find-document-by-hash
(generic function).
get-query-cache
(function).
load-document-reference-collection
(function).
make-mac
(generic function).
map-append
(function).
maphash-collect
(function).
persist-delete-document
(generic function).
persist-form
(generic function).
persist-parse
(generic function).
plist-to-pairs
(function).
plist-to-values
(function).
set-query-cache
(function).
sexp-from-file
(function).
(setf sexp-from-file)
(function).
trim-whitespace
(function).
type-of-doc-element
(generic function).
type-of-sexp
(generic function).
with-file-lock
(macro).
with-open-file-lock
(macro).
write-log
(function).
write-to-file
(function).
*break-on-debug-log*
(special variable).
*mac-key*
(special variable).
*now*
(special variable).
*query-cache*
(special variable).
*short-months*
(special variable).
*std-lock*
(special variable).
*time-zone*
(special variable).
call-do-sequence
(function).
format-date-time
(function).
format-universal-date-time
(function).
get-collection*
(function).
get-store*
(function).
get-temp
(function).
iso-timestamp-now
(function).
short-month-name
(function).
write-list-items-to-file
(function).
write-to-stream
(function).
documents-impl
cl-getx
.
cl-naive-store.naive-core
.
cl-naive-store.naive-documents
.
cl-naive-store.naive-indexed
.
common-lisp
.
document-values-p
(function).
cl-naive-store.definitions
cl-getx
.
cl-naive-store.document-types
.
cl-naive-store.naive-core
.
common-lisp
.
create-multiverse
(function).
build-adjacency-list
(function).
create-collections
(function).
create-document-types
(function).
depth-first-search
(function).
get-collection-names
(function).
get-collections-dependencies
(function).
get-document-types
(function).
get-referenced-types
(function).
get-topological-order
(function).
sublist-in-order-p
(function).
topological-sort
(function).
walk-data-filter
(function).
cl-naive-store.naive-indexed
cl-getx
.
cl-naive-store.naive-core
.
common-lisp
.
*do-partial-indexing*
(special variable).
add-index
(generic function).
hash
(generic function).
(setf hash)
(generic function).
hash
(slot).
index-lookup-hash
(generic function).
index-lookup-values
(generic function).
indexed-collection-mixin
(class).
indexes
(generic reader).
(setf indexes)
(generic writer).
key-value-index
(generic reader).
(setf key-value-index)
(generic writer).
remove-index
(generic function).
*index-query-lock*
(special variable).
hash-index
(generic reader).
(setf hash-index)
(generic writer).
indexed-shard
(class).
indexed-values
(function).
try-better-value-match
(function).
cl-naive-merkle
common-lisp
.
branch
(function).
calc
(function).
calc-branch
(function).
calc-document
(function).
children
(generic reader).
(setf children)
(generic writer).
leaf-p
(function).
make-document-hash
(function).
make-hash
(function).
make-node
(function).
map-tree
(function).
merkle-hash
(generic reader).
(setf merkle-hash)
(generic writer).
merkle-node
(class).
merkle-sum
(generic reader).
(setf merkle-sum)
(generic writer).
node-p
(function).
parent
(generic reader).
(setf parent)
(generic writer).
recalc
(function).
tree-from-reference-tree
(function).
tree-to-reference-tree
(function).
cl-naive-store.document-types
cl-getx
.
cl-naive-store.naive-core
.
common-lisp
.
attributes
(generic reader).
(setf attributes)
(generic writer).
document-of-type-p
(generic function).
document-type
(generic reader).
(setf document-type)
(generic writer).
document-type
(class).
document-type
(slot).
document-type-class
(generic reader).
(setf document-type-class)
(generic writer).
document-type-collection-mixin
(class).
document-type-store-mixin
(class).
document-types
(generic reader).
(setf document-types)
(generic writer).
element
(class).
element-class
(generic reader).
(setf element-class)
(generic writer).
elements
(generic reader).
(setf elements)
(generic writer).
elements
(slot).
get-attribute
(generic function).
get-document-type-from-def
(generic function).
get-element
(generic function).
key-p
(generic reader).
(setf key-p)
(generic writer).
label
(generic reader).
(setf label)
(generic writer).
concrete-type
(generic reader).
(setf concrete-type)
(generic writer).
load-store-collections
(generic function).
load-store-document-types
(function).
values-from-key-elements%
(function).
cl-naive-store.naive-core
cl-getx
.
common-lisp
.
*disable-parallel-p*
(special variable).
add-collection
(generic function).
add-document
(generic function).
add-document-type
(generic function).
add-store
(generic function).
blob
(structure).
blob-file-ext
(reader).
(setf blob-file-ext)
(writer).
blob-file-type
(reader).
(setf blob-file-type)
(writer).
blob-location
(reader).
(setf blob-location)
(writer).
blob-p
(function).
blob-raw
(reader).
(setf blob-raw)
(writer).
blob-ref-p
(function).
blob-string-value
(function).
clear-collection
(generic function).
clear-documents
(generic function).
collection
(class).
collection
(slot).
collection-class
(generic reader).
(setf collection-class)
(generic writer).
collections
(generic reader).
(setf collections)
(generic writer).
data-loaded-p
(generic function).
delete-document
(generic function).
deleted-p
(generic function).
(setf deleted-p)
(generic function).
deleted-p
(slot).
do-sequence
(macro).
document-shard-mac
(function).
document-values
(generic function).
documents
(generic function).
(setf documents)
(generic writer).
empty-p
(function).
ensure-location
(generic function).
existing-document
(generic function).
find-collection-definitions
(function).
frmt
(function).
get-collection
(generic function).
get-collection-from-def
(generic function).
get-document-type
(generic function).
get-shard
(generic function).
get-store
(generic function).
get-store-from-def
(function).
gethash-safe
(generic function).
(setf gethash-safe)
(generic function).
key-values
(generic function).
keys
(generic reader).
(setf keys)
(generic writer).
load-data
(generic function).
load-store
(generic function).
load-stores
(generic function).
location
(generic reader).
(setf location)
(generic writer).
lock
(generic reader).
(setf lock)
(generic writer).
mac
(generic reader).
(setf mac)
(generic writer).
make-blob
(function).
make-shard
(generic function).
match-shard
(function).
naive-reduce
(generic function).
name
(slot).
name
(slot).
name
(generic reader).
(setf name)
(generic writer).
persist
(generic function).
persist-collection
(function).
persist-collection-def
(generic function).
persist-document
(generic function).
query-data
(generic function).
query-document
(generic function).
read-blob
(function).
remhash-safe
(generic function).
remove-collection
(generic function).
remove-document
(generic function).
sanitize-data-file
(generic function).
shard
(class).
shards
(generic reader).
(setf shards)
(generic writer).
short-mac
(generic function).
status
(generic function).
(setf status)
(generic function).
store
(slot).
store
(generic reader).
(setf store)
(generic writer).
store
(class).
store
(slot).
store-class
(generic reader).
(setf store-class)
(generic writer).
stores
(generic reader).
(setf stores)
(generic writer).
universe
(generic reader).
(setf universe)
(generic writer).
universe
(class).
write-blob
(function).
*files*
(special variable).
*query-lock*
(special variable).
*shards-cache-lock*
(special variable).
*shards-macs-cache-lock*
(special variable).
blob-parent-accessor
(reader).
(setf blob-parent-accessor)
(writer).
blob-ref-values
(function).
copy-blob
(function).
ensure-shard
(function).
find-collection-files
(function).
find-store-definitions
(function).
get-shard-cache-safe%
(function).
get-shard-mac-cache-safe%
(function).
load-collections
(generic function).
load-shard
(generic function).
load-shards
(function).
reference-form
(generic function).
sanitize-universe
(generic function).
set-shard-cache-safe%
(function).
set-shard-mac-cache-safe%
(function).
shard-elements
(generic reader).
(setf shard-elements)
(generic writer).
shards-cache%
(generic reader).
(setf shards-cache%)
(generic writer).
shards-macs-cache%
(generic reader).
(setf shards-macs-cache%)
(generic writer).
indexed-impl
cl-getx
.
cl-murmurhash
.
cl-naive-store.naive-core
.
cl-naive-store.naive-indexed
.
common-lisp
.
index-values
(generic function).
push-value-index
(generic function).
remove-value-index
(generic function).
hash-values
(function).
populate-partial-value-index
(function).
populate-value-index
(function).
remove-index-values
(function).
remove-partial-value-index
(function).
cl-naive-store.naive-documents
cl-getx
.
cl-naive-store.document-types
.
cl-naive-store.naive-core
.
cl-naive-store.naive-indexed
.
common-lisp
.
document
(structure).
document-changes
(reader).
(setf document-changes)
(writer).
document-collection
(reader).
(setf document-collection)
(writer).
document-collection
(class).
document-deleted-p
(reader).
(setf document-deleted-p)
(writer).
document-document-type
(reader).
(setf document-document-type)
(writer).
document-elements
(reader).
(setf document-elements)
(writer).
document-hash
(reader).
(setf document-hash)
(writer).
document-list-to-csv
(function).
document-list-to-json
(function).
document-p
(function).
document-store
(reader).
(setf document-store)
(writer).
document-store
(class).
document-versions
(reader).
(setf document-versions)
(writer).
documents-to-plist
(function).
find-equalp-document
(function).
getxn
(generic function).
getxo
(generic function).
make-document
(function).
*change-control-p*
(special variable).
check-keys-and-synq
(function).
copy-document
(function).
document-list-p
(function).
document-pair-to-plist
(function).
document-persisted-p
(reader).
(setf document-persisted-p)
(writer).
exists-p
(generic function).
find-document-by-value
(function).
key-values%%
(function).
lambda-p
(function).
naive-dig
(function).
parse-document
(function).
persist-merge-document
(function).
reference-documents-equal-p
(function).
set-naive-dig
(function).
treemap-csv
(function).
treemap-json
(function).
write-pair-csv
(function).
write-pair-json
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Used during the loading of an individual shard. That way no heavy recursive locking has to be done.
Causes a break when logging errors of type :error and :warning.
Switches debug logging or off for debug-log
Depending on the data and how naive-store is used switching of parallel processing could produce better performance. This does not disable parallel loading of shards but it does disable all other parallel processing.
Switching off parallel processing is achieved by ignoring the parallel-p argument of do-sequence when *disable-parallel-p* is t.
So if you are customising cl-naive-store use do-sequence for simple parallel processing or make sure that your customization obeys *disable-parallel-p* where possible.
When this is set to t (which is the default), indexing is done for the individual elements of the indexes as well.
Iterates over the sequence applying body. In the body you can use the element-var and/or the index-var if supplied.
If you set parallel-p then the body is executed asyncronously. Asyncronous excecution places restraints on how special variables can be used within the body.
From lparallel documentation:
To establish permanent dynamic bindings inside workers (thread-local variables), use the :bindings argument to make-kernel, which is an alist of (var-name . value-form) pairs. Each value-form is evaluated inside each worker when it is created. (So if you have two workers, each value-form will be evaluated twice.)
Notes:
Uses loop or lparallel:pdotimes depending on parallel-p value.
To get the best out of do-sequence use the parallel option if the sequence is large (> 1000) or the body is excecution heavy.
Get an exclusive lock on a file. If lock cannot be obtained, keep
trying after waiting a while.
Source: Giovanni Gigante https://sourceforge.net/p/cl-cookbook/patches/8/|#
Opens a file with a file lock and writes to the file.
Returns the value of a blob as a string.
hash
.
Calculating a mac is expensive so caching shard value macs in a hashtable but that hashtable needs to be thread safe so using safe functions to get and set.
Checks if value is null/nil or an empty string..
Reads a file and returns the contents as a string.
NOTES: You could achieve the same with with-output-to-string, but now you dont have to worry about supplying a string that can be written to.
Short hand for (format nil ..).
Tries to find a store definition file on disk and if it does it loads the store into the universe, but it does not load the collections!.
When documents are persisted to file any document values that are referencing an document in a different collection is first sanitized (just enough info to retrieve the document later from where it is stored).
When documents are read from a file the references need to be converted to documents but for that to happen the collection containing the referenced documents need to be loaded first.
Non distructive version of mapcan. Source: On Lisp
Collects the results of a maphash. Pushes to a list by default, use append-p to append instead. NIL results are not collected.
Check filename against a list of shards to find the matching shard.
Persists the documents in a collection in the order that they where added.
Returns a list of key value pairs of a plist.
Returns the values of a plist.
Reads the raw blob contents from file.
Read sexp from file.
Removes white spaces from a string.
Wrties the raw blob contents to file.
Writes errors to location.
Different Types are written to different files,
:error => error.err
:warning => warning.wrn
:debug => debug.dbl
:log => log.lg
Note:
Not writing stuf to .log files because that is what persist uses!!!.
Writes to file using with-open-file-lock.
Adds a collection to a store.
store
) (collection document-type-collection-mixin
)) ¶Uses document type to figure out what the keys of the collection are.
store
) (collection collection
)) ¶Adds a document to the collection, it DOES NOT PERSIST the change, if you want adding with persistance use persist-document or persist the collection as a whole after you have done your adding.
Supply the shard the document should belong to if you can, especially if you have a lot of documents to add to a specific shard. If not supplied the (shard-elements collection) will be used to calculate which shard to use for the document.
add-document returns multiple values:
The first returned value is the actual document supplied.
The second returned value indicates what action was taken ie. was it added newly or was an exiting document replaced.
The third returned value is the replaced document.
NOTES:
In general you should not be calling add-document directly, you should use persist-document. Calling add-document directly is allowed so you can create temporary collections that can be thrown away.
cl-naive-store does not have a update-document function, add-document does both and its behaviour can be complex depending on the key parameters supplied. Also the behaviour can differ for different types of collections. Check the appropriate collection documentation for more details.
indexed-collection-mixin
) document &key shard replace-existing-p update-index-p &allow-other-keys) ¶Duplicates are not allowed for indexed collections!
If the document has no hash and a document with the same keys exists in the collection the supplied document’s hash will be set to that of the existing document. The existing document will then be replaced with the supplied document. This is done to maintain hash consistancy of the store.
If you set replace-existing-p to nil then an existing document wont be replaced by the supplied document. Basically nothing will be done.
Indexes will be updated by default, if you want to stop index updates set update-index-p to nil. Just remember that if the document is really "new" to the collection the indexes will be updated in any case.
collection
) document &key shard handle-duplicates-p replace-existing-p &allow-other-keys) ¶None of the following will have an effect if handle-duplicates = nil.
If a document with the same keys exists in the collection the supplied the existing document will be replaced with the supplied document.
If you set replace-existing-p to nil then an existing document wont be replaced by the supplied document. Basically nothing will be done.
Adds a document-type to a store.
document-type-store-mixin
) (document-type document-type
) &key persist-p) ¶Adds a document to two indexes. The first uses a UUID that will stay with the document for its life time. The UUID is used when persisting the document and is never changed once created. This allows us to change key values without loosing the identify of the original document.
The second is a key value hash index to be used when looking for duplicate documents during persist. If you are not using document-types the order of the keys in the plist matter. To make sure that you dont muck with the order of values/keys in your plists initialize all the possible value pairs with nil so that way the order is set.
A shard must be supplied.
indexed-collection-mixin
) shard document &key key-values &allow-other-keys) ¶Adds a store document to a universe.
Clears documents indexes etc from collection.
indexed-shard
)) ¶The loading of documents happens in a two step process. First documents are read with (*read-eval* nil). Then the sexp representing a raw document is processed to compose the required in memory representation.
document-collection
) shard document-form &key &allow-other-keys) ¶Processes document form for compose-document.
Does special processing to compose a specific type of document or element.
document-collection
) shard sexp (type (eql :blob)
)) ¶document-collection
) shard sexp (type (eql :child-document)
)) ¶document-collection
) shard sexp (type (eql :document)
)) ¶indexed-collection-mixin
) shard sexp (type (eql :document)
)) ¶(eql :reference)
)) ¶(eql :hash-table)
)) ¶(eql :blob)
)) ¶(eql :document)
)) ¶Checks if the data is loaded for the container, be it universe , store or collection.
NOTES:
This physically checks each collection’s underlying concrete data structure for data. This is done because a collection can be empty and still loaded, thus setting a status when loaded became confusing and could be missed by an over loading method.
If you change the underlying container for (shards collection) or the container for (docutments shard) you have to implement data-loaded-p. Your implementation is expected to physically check for document count > 0 and not some status set. Be smart about it you are not expected to return a count so dont waist time counting just check if there is at least one document in the container.
collection
) &key shard-macs &allow-other-keys) ¶Removes a document from the collection, marks the document as deleted and persists the deleted document to disk.
collection
) document &key shard &allow-other-keys) ¶Indicates if a data document has been marked as deleted.
naive-store writes data to file sequentially and when deleting data documents it does not remove a data document from the underlying file it just marks it as deleted.
document-type-collection-mixin
)) ¶document-type-collection-mixin
)) ¶The document-type that this collection contains documents of.
document-type-store-mixin
)) ¶document-type-store-mixin
)) ¶The class that should be used to make document-type documents. IMPL NOTES: To deal with customization of document-type.
document-type-store-mixin
)) ¶document-type-store-mixin
)) ¶List of document-types represented by this store’s collections.
Returns a plist of document values.
NOTES:
Exists to ease the compatibility of various implementation functions. Basically it blurs the line between plists and more complex documents like cl-naive-store.naive-documents document struct.
This helps keep the amount of specializations needed down considerably.
collection
)) ¶document-type
)) ¶document-type
)) ¶The class that should be used to make element documents.
NOTES:
element-class is declaratively specified here so that elements can be dynamicly created when definition type definitions are read from file. See naive-store-documents for usage examples.
document-type
)) ¶document-type
)) ¶Field definitions that represents a data unit.
Tries to find or build path to cl-naive-store files.
collection
)) ¶Finds any documents with the same key values. This could return the exact same document or a similar document.
If a shard is passed in then the search is limited to that shard.
IMPL NOTES:
This is an essential part of loading and persisting documents, take care when implementing.
indexed-collection-mixin
) document &key shard key-values &allow-other-keys) ¶Finds the document that matches the hash.
indexed-collection-mixin
) hash &key shards &allow-other-keys) ¶Returns a collection document if found in the store.
Tries to find the collection definition file on disk and loads it into the store, but it does not load the collection’s data.
document-type-store-mixin
) collection-name) ¶Returns a document-type document if found in the store.
document-type-store-mixin
) type-name) ¶Tries to find the document definition on disk.
Get the shard object by its mac. Shard lookups are done so much that there is no choice but to cache them in a hashtable, but that hashtable needs to be thread safe so using safe functions to get and set.
indexed-collection-mixin
) shard-mac &key &allow-other-keys) ¶Returns a store if found in the universe.
Puts lock around hash get access for those cl implementations that dont have a thread safe hashtable.
Puts lock around hash set access.
Gets changed value made to the document. IE new value.
Gets value ignoring any changes made to the document. IE old value.
Returns the hash identifier for a data document. Data documents need a hash identifier to work with naive-store-indexed. naive-store-indexed will edit the document to add a hash identifier when adding documents to a collection. naive-store-indexed uses a UUID in its default implementation.
Looks up document in UUID hash index. If sharsd is not supplied all loaded shards will be searched.
Will use shards to limit the lookup to specific shards.
indexed-collection-mixin
) hash &key shards &allow-other-keys) ¶Looks up document in key value hash index. If you are not using document-types then the order of values matter.
Will use shards to limit the lookup to specific shards.
indexed-collection-mixin
) values &key shards &allow-other-keys) ¶collection
) values &key shards &allow-other-keys) ¶Returns a set of index values from the values of a data document.
document-collection
) (values document
) &key &allow-other-keys) ¶indexed-collection-mixin
)) ¶indexed-collection-mixin
)) ¶List of index combinations. Also indexes members partially if *partial-indexing* is t, for example ’((:emp-no :surname gender)) is indexed as (:emp-no :surname :gender), (:emp-no :surname), :emp-no, :surname and :gender
element
)) ¶element
)) ¶Indicates that the element is part of the primary key.
Can be used for indexing and document comparison. For example when a new document is persisted naive-store-documents checks for documents with the same index value and then updates the existing document.
indexed-shard
)) ¶indexed-shard
)) ¶Hash table keyed on document key values for quick retrieval of an document. Used when doing key value equality comparisons.
Returns a set of key values from the values of a data document. Checks the collection keys or uses hash.
document-collection
) document &key &allow-other-keys) ¶document-type-collection-mixin
) document &key &allow-other-keys) ¶collection
) values &key &allow-other-keys) ¶collection
)) ¶collection
)) ¶Keys need to be set to handle duplicates, the default is :key if :key is not found in the document then duplicates will occur.
NOTES:
For collections that use cl-naive-document-type there is a fallback the document-type is checked for keys as well and the collection’s keys will be set to the keys set in the document-type elements.
keys
.
document-type
)) ¶document-type
)) ¶Human readable/formated short description.
Loads the data documents of a collection from file or files if sharding is used. If the data is already loaded it wont reload it, if you want the data to be reloaded use force-reload-p.
shard-macs is a list of shard macs to indicate which shards should be used. If no shards are specified all shards will be loaded.
NOTES:
load-data could have been used to load universe or store as well but those have a wealth of other key word parameters to control exactly what to do that makes the load-data signature a nightmare to understand. So separate methods load-stores (for universe) and load-collections (for a store) exists for that.
collection
) &key shard-macs parallel-p &allow-other-keys) ¶Loads the document-types and collections, with or without the actual data documents.
document-type-store-mixin
) &key with-data-p &allow-other-keys) ¶Finds and loads collections a store, with or without data documents.
Loads a whole universe, with or without collections and data documents.
universe
)) ¶universe
)) ¶Directory path to stores.
store
)) ¶store
)) ¶The directory path to the document-type files and collection files for this store.
collection
)) ¶collection
)) ¶The directory path to where files for this collection are stored.
Produces a mac from the value. Mac’s should differ for different values.
NOTES:
This is used to create shard filenames.
indexed-collection-mixin
) shard-mac) ¶Creates an instance of a shard using the supplied mac.
Uses query to select data documents from a collection and applies the function to
those documents returning the result.
NOTES:
Does lazy loading.
indexed-collection-mixin
) &key index-values query function initial-value shards) ¶Extends naive-reduce to be able to take advantage of indexing. Reduce is done on values retrieved by the supplier index.
sequence
) &key query function initial-value &allow-other-keys) ¶hash-table
) &key query function initial-value &allow-other-keys) ¶collection
) &key query function initial-value shards &allow-other-keys) ¶collection
) &key shards &allow-other-keys) ¶Lazy loading data.
document-type
)) ¶document-type
)) ¶String representing a document-type name.
name
.
element
)) ¶element
)) ¶Name of the element. This should be a KEYWORD if you want data portability and some internals might expect a keyword.
name
.
store
)) ¶store
)) ¶Store name.
name
.
collection
)) ¶collection
)) ¶The collection name.
name
.
Writes various store structural objects to
document-type
) &key &allow-other-keys) ¶Persists a document-type definition. Path to file is of this general format /universe/store-name/document-type-name.type.
collection
) &key &allow-other-keys) ¶Persists a collection definition and the documents in a collection. Path to file for data is this general format /universe/store-name/collection-name/collection-name.log.
Persists a collection definition. Path to file is of this general format /universe/store-name/collection-name.col.
document-type-collection-mixin
)) ¶collection
)) ¶Marks document as deleted.
Traverses the document and composes a list representation that is written to file. If the document is new it is added to the collection.
The shard the document should belong to can be passed in as well.
document-collection
) document &key shard allow-key-change-p delete-p file-name file-stream &allow-other-keys) ¶persist-document for document-collection is leniant in what it takes as a document, it can be of type document or a plist.
collection
) document &key shard handle-duplicates-p delete-p file-name file-stream &allow-other-keys) ¶Convert a document element to its list representation.
IMPL NOTES:
specialize element type like this (element-type (eql :blob)). DONT specialize on object type directly because that will break type-of-doc-element. If you specialize element you need to supply your own implementation of type-of-doc-element as well.
document-collection
) shard document (element-type (eql :document)
) &key root parent &allow-other-keys) ¶document-collection
) shard document (element-type (eql :child-document)
) &key root parent &allow-other-keys) ¶document-collection
) shard document (element-type (eql :reference)
) &key root parent &allow-other-keys) ¶document-collection
) shard blob (element-type (eql :blob)
) &key root parent &allow-other-keys) ¶(eql :hash-table)
) &key &allow-other-keys) ¶(eql :reference)
) &key &allow-other-keys) ¶(eql :blob)
) &key &allow-other-keys) ¶(eql :document)
) &key &allow-other-keys) ¶Transcribes document to list form for peristance.
document-collection
) shard element doc &key root parent &allow-other-keys) ¶Uses lists within the key-value-index hash-table to store/group documents that match a key value combination.
On updates of documents could end up with duplicate documents returned by the index lookup. The speed more than makes up for the occasional duplicate for now!
TODO: Implement index-lookup-value that strips out duplicates??
Returns the data that satisfies the query.
NOTES:
Does lazy loading.
indexed-collection-mixin
) &key index-values query shards &allow-other-keys) ¶Extends query-data to be able to take advantage of indexing. Query is done on values retrieved by the supplied index.
hash-table
) &key query &allow-other-keys) ¶sequence
) &key query &allow-other-keys) ¶collection
) &key query shards &allow-other-keys) ¶collection
) &key shards &allow-other-keys) ¶Lazy loading data.
Returns the first last document found, and any others that satisfies the query
NOTES:
Does lazy loading.
hash-table
) &key query &allow-other-keys) ¶list
) &key query &allow-other-keys) ¶collection
) &key query shards &allow-other-keys) ¶collection
) &key shards &allow-other-keys) ¶Lazy loading data.
Puts lock around hash remove access for those cl implementations that dont have a thread safe hashtable.
Removes a collection to a store.
store
) (collection collection
)) ¶Removes an document from the collection and its indexes. See add-document.
indexed-collection-mixin
) document &key shard &allow-other-keys) ¶collection
) document &key shard &allow-other-keys) ¶collection
) document &rest other-keys &key shard &allow-other-keys) ¶Removes a data document from the UUID and key value indexes. A shard must be supplied.
indexed-collection-mixin
) shard document &key &allow-other-keys) ¶Removes a value index.
This removes all the deleted data documents from a collection. When a collection is loaded only the active documents are loaded. Does this by simply writing those active documents out to a new file and then replacing the old file.
collection
) &key &allow-other-keys) ¶collection
)) ¶collection
)) ¶A vector of shards.
NOTES:
Originally naive-store used lists but with the re-introduction of sharding, we chose to also introduce the use of lparrallel to speed up many functions and lparrallel has a preference for arrays.
Return a short string containing a prefix of the MAC
document-type
)) ¶document-type
)) ¶The store that this document-type belongs to.
collection
)) ¶collection
)) ¶The store that this collection belongs to.
universe
)) ¶universe
)) ¶The class that should be used to make stores.
NOTES:
store-class is delcaritively specied here because stores are dynamicly created when definition files are loaded. (see store notes for more about this.).
Reports if the sexp represents a special form.
document-collection
) element) ¶Reports if the sexp represents a special form, like a blob or reference.
document-collection
) document-form) ¶document-type
) accessor &key &allow-other-keys) ¶cl-getx
.
document-type
) accessor &key &allow-other-keys) ¶cl-getx
.
document
) accessor &key change-control-p use-element-definition-p &allow-other-keys) ¶cl-getx
.
document
) accessor &key &allow-other-keys) ¶Usually getx will return the value of an object/place attribute/key. However when we work with documents we would like to get to the actual element values instead, for convenience sake.
Because we mangled getx to give us element values we need a way to get to the original attributes of a document, we do this with the following accessors
:hash = document-hash (remember that you can not use :hash as an element descriptor it is reserved for cl-naive-store)
The convention is to append %% to these accessors, for two reasons. First to show that they are special, accessing meta data not actual values of document. Second to avoid any name clashes with actual data members.
:collection%% = document-collection
:store%% = document-store or (store collection)
:universe%% = (universe store)
:type%% = type
:elements%% = document-elements
:changes%% = document-changes
:versions%% = document-versions
:deleted-p%% = document-deleted-p
cl-getx
.
collection
) stream) ¶Represents a unit of data that is large enough to warent its own file or would cause reading problems for the default naive-store file layout which is essentially plists.
A basic struct that represents a document object. A struct is used because there is meta data that we want to add to the actual document values and there is additional functionality like being able to know what has changed in the values during updates.
store = The store that the document comes from.
collection = The collection that the document comes from.
document-type = The document type specification that describes this document.
hash = The hash/UUID that uniquely identifies this document
elements = The actual key value pairs of the document.
changes = Is used to store setf values when using getx the preffered accessor for values. This helps with comparing of values when persisting.
versions = older key value pairs that represent older versions of the document
deleted-p = indicates that the document was deleted.
persisted-p = indicates that the document has been peristed.
structure-object
.
A collection of documents of a specific document-type.
add-collection
.
add-document
.
data-loaded-p
.
delete-document
.
documents
.
ensure-location
.
index-lookup-values
.
key-values
.
(setf keys)
.
keys
.
load-data
.
load-shard
.
load-shard
.
(setf location)
.
location
.
naive-reduce
.
naive-reduce
.
(setf name)
.
name
.
persist
.
persist-collection-def
.
persist-document
.
print-object
.
query-data
.
query-data
.
query-document
.
query-document
.
remove-collection
.
remove-document
.
remove-document
.
sanitize-data-file
.
(setf shard-elements)
.
shard-elements
.
(setf shards)
.
shards
.
(setf store)
.
store
.
The store that this collection belongs to.
:store
The directory path to where files for this collection are stored.
:location
A vector of shards.
NOTES:
Originally naive-store used lists but with the re-introduction of sharding, we chose to also introduce the use of lparrallel to speed up many functions and lparrallel has a preference for arrays.
vector
(make-array 1 :fill-pointer 0 :adjustable t :initial-element nil)
:shards
Keys need to be set to handle duplicates, the default is :key if :key is not found in the document then duplicates will occur.
NOTES:
For collections that use cl-naive-document-type there is a fallback the document-type is checked for keys as well and the collection’s keys will be set to the keys set in the document-type elements.
(list :key)
:keys
keys
.
shard-elements is a list of document element keywords to use for sharding.
:shard-elements
Document collection class used to specialize on for cl-naive-store.naive-documents.
cl-naive-store.naive-documents specialization of store.
Initarg | Value |
---|---|
:collection-class | (quote document-collection) |
A class that can be use to represent a complex document.
NOTES:
The default implementation of cl-naive-store is unaware of document-types when reading and writing documents to and from file. This was by design, to place as little burden on reading and writing documents. Depending on the use of naive-store a user could customize the reading and writing methods of naive-store to use document-types for validation and file layout specifics.
GUI’s like cl-wfx use these to help with generic rendering of user input screens.
See cl-naive-type-defs:*example-type-defs* for examples of type definitions to get a feel for the intended use.
The store that this document-type belongs to.
:store
The class that should be used to make element documents.
NOTES:
element-class is declaratively specified here so that elements can be dynamicly created when definition type definitions are read from file. See naive-store-documents for usage examples.
:class
(quote cl-naive-store.document-types:element)
:element-class
Human readable/formated short description.
:label
Field definitions that represents a data unit.
:elements
Collection extention to make collection of a specific document-type.
The document-type that this collection contains documents of.
:document-type
The class that should be used to make document-type documents. IMPL NOTES: To deal with customization of document-type.
:class
(quote cl-naive-store.document-types:document-type)
:document-type-class
List of document-types represented by this store’s collections.
:document-types
A definition of an element of a document.
NOTES:
Elements can reference simple types, a complex document or documents based on other document-types.
naive-store can be used as a hierarchical database or a flat databases or a mix.
Name of the element. This should be a KEYWORD if you want data portability and some internals might expect a keyword.
:name
name
.
A user defined "thing" that defines the type specifics of an element.
:concrete-type
Indicates that the element is part of the primary key.
Can be used for indexing and document comparison. For example when a new document is persisted naive-store-documents checks for documents with the same index value and then updates the existing document.
:key-p
A property list of additional element attributes.
:attributes
Collection extension to add very basic indexes.
List of index combinations. Also indexes members partially if *partial-indexing* is t, for example ’((:emp-no :surname gender)) is indexed as (:emp-no :surname :gender), (:emp-no :surname), :emp-no, :surname and :gender
:indexes
Sharding is when you break the physical file that backs the collection into smaller files based on data elements of a document. An instance of a shard class is used to load the documents belonging to the shard into memory.
The file path to this shard is stored.
:location
Documents belonging to shard.
(make-array 1 :fill-pointer 0 :adjustable t :initial-element nil)
:documents
Used internally during the loading of the documents in a shard to help with locking.
:status
Document types and their associated collections are organized into groups called stores.
NOTES:
collection-class and document-type-class is delcaritively specied here because they are dynamicly created when definition files are loaded. The alternative would be defmethod hell where the customizer of naive-store would have to implement a whole lot of methods that do exactly what the provided methods do just to be able to be type specific in other methods where it is actually needed. Alternatively meta classes could be used for element-class but that opens another can of worms.
add-collection
.
add-collection
.
add-store
.
(setf collection-class)
.
collection-class
.
(setf collections)
.
collections
.
data-loaded-p
.
ensure-location
.
get-collection
.
get-collection-from-def
.
get-document-type-from-def
.
load-collections
.
load-store
.
(setf location)
.
location
.
(setf name)
.
name
.
persist
.
print-object
.
query-data
.
query-document
.
remove-collection
.
(setf universe)
.
universe
.
The universe this store belongs to.
:universe
The class that should be used to make collections.
:class
(quote cl-naive-store.naive-core:collection)
:collection-class
List of collections represented by this store.
:collections
The directory path to the document-type files and collection files for this store.
:location
Stores are held by a universe to make up a database.
List of stores contained by this universe.
:stores
The class that should be used to make stores.
NOTES:
store-class is delcaritively specied here because stores are dynamicly created when definition files are loaded. (see store notes for more about this.).
:class
(quote cl-naive-store.naive-core:store)
:store-class
Directory path to stores.
(cl-fad:merge-pathnames-as-directory (user-homedir-pathname) (make-pathname :directory (list :relative "data-universe")))
:location
This was introduced to speedup finding a shard. It is only for internal use!
(make-hash-table :test (quote equalp) :synchronized nil)
:shards-cache%
This was introduced to speedup finding a shard. Calulating macs is expensive. It is only for internal use!
(make-hash-table :test (quote equalp) :synchronized nil)
:shards-macs-cache%
Causes a break when logging errors of type :error and :warning.
Set change tracking when using setf getx for document values. By default it is on.
Used to lod STD to log debug messages safely between threads.
Sums hashes for node branch including root.
Sums hashes excluding root.
Create collections in the specified order of dependencies and add them to the store.
Create document types in the specified order of dependencies and add them to the store.
Returns t if the document is a list of type document.
Checks if plist contains :elements keyword which would indicate the plist represents an document.
Used internally to find or create a new collection.
Used internally to find or create a new store.
Finds and loads the files representing data types for a store.
Returns a new instance of node object representing the hash node.
Walks through the provided plist tree, applies a filter function to all elements that match the given keywords, and returns the results. Matching is done on partail keys i.e. gaps before, after and inbetween keywords in order are ok.
Does not wrap items in ().
Writes to stream with fresh-lines.
merkle-node
)) ¶automatically generated reader method
merkle-node
)) ¶automatically generated writer method
indexed-shard
)) ¶indexed-shard
)) ¶Hash table keyed on document uuid for quick retrieval of an document.
Finds and loads collections of a store, with or without documents.
Loads documents from file.
collection
) shard filename &key &allow-other-keys) ¶collection
) shard filename &key &allow-other-keys) ¶document-type-store-mixin
) &key with-data-p &allow-other-keys) ¶Finds and loads collection definitions for a store, with or without data documents.
merkle-node
)) ¶merkle-node
)) ¶Then original hash of the document.
merkle-node
)) ¶merkle-node
)) ¶Then computed hash of the document
merkle-node
)) ¶automatically generated reader method
merkle-node
)) ¶automatically generated writer method
Sanitize all collections of a universe. See sanitize-data-file for details.
collection
)) ¶collection
)) ¶shard-elements is a list of document element keywords to use for sharding.
Extends shards with indexes.
Hash table keyed on document uuid for quick retrieval of an document.
:hash-index
Hash table keyed on document key values for quick retrieval of an document. Used when doing key value equality comparisons.
:key-value-index
:parent
Then original hash of the document.
:merkle-hash
Then computed hash of the document
:merkle-sum
:children
Jump to: | (
A B C D E F G H I K L M N P Q R S T U V W |
---|
Jump to: | (
A B C D E F G H I K L M N P Q R S T U V W |
---|
Jump to: | %
*
A C D E F H I K L M N P R S U V |
---|
Jump to: | %
*
A C D E F H I K L M N P R S U V |
---|
Jump to: | B C D E F I M N P S U |
---|