Builds the window. It asks nothing of the store until attach().
the realm hooks, the containers, the bound and the registry
Puts an entry the STORE holds: not a write. For a restore and for a row another process wrote.
the realm id
the normalised DN
the entry
Whether any windowed entry of a realm holds an attribute: a change made here first, then the store.
the realm id
the attribute name, lower-cased as stored
true when one does
Asks the store one of directory_queries.js's questions, on the
driver's read pool where the bridge offers it.
the query's name
its arguments
a promise of the answer (null before attach())
Gives the window its bridge, once the store is open, and drops every CLEAN answer given before it — an absence recorded before the store could be asked is not an absence.
the synchronous question to the store
Whether the store can be asked yet.
true once attach() has run
Whether a key has a change here not yet written, or one in flight, or was handed out since the last flush — the states in which a row from another process must wait for the flush rather than replace it.
the realm id
the normalised DN
true when the flush must go first
A realm's count for ldap.maxEntries: the store's, read again when the
last reading is more than ten seconds old, plus this process's own net
since. Stale by at most that much for another process's creates; the
ceiling is a ceiling, not a quota to the entry.
the realm id
the count
The windowed entries strictly under a base holding any of some object
classes (classesUnder, the GIN index over class_keys), asked once
and asynchronously, as this process holds them: findWindowed()'s
answer for a caller that can wait — an LDAP search for groups.
the realm id
the base's normalised DN (a windowed container)
the object classes, lower-cased
the service's own rule, asked of each candidate
a promise of [{ key, entry }], local additions last
Empties a realm: the restore's replaceRealm(). Changes not yet
written are dropped with the rest — a restore is "this is the
directory".
the realm id
What the flush writes for the windowed keys, and the release of every entry handed out and left unchanged.
the journal's keys (without a realm), or null when a write named nothing: then every held and evicted-but-held entry is a candidate
the upserts (entry, json, base) and deletes (base)
The flush wrote what collect() answered: each base is what was sent,
and a key unchanged since is released. A key the store answered
differently for (outcomes) is forgotten, or — changed again since —
given the store's row as its base.
what collect() answered
Optionaloutcomes: { entry?: Entry; key: string; outcome: string; realm: string }[]
the driver's { realm, key, outcome, entry } rows
One numbered page of a parent's direct children in key order, asked
asynchronously (#359). asked counts rows the store answered before
a delete made here dropped one, so a short page is the end of the
container and not a page of deletions.
the realm id
the parent's normalised DN
rows to skip
the page size (at most 1,000)
{ rows, asked }
How many windowed entries under a base the store says hold an attribute.
the realm id
the base's normalised DN
the attribute name, lower-cased as stored
OptionalupTo: numbera promise of the count (0 before attach())
How many entries are strictly under a base and how many of them hold an
attribute, now: the store's two counts in one statement and this
process's changes not yet written (#610). An entry "holds" an attribute
when it carries the NAME with at least one value — what the store's
attr_names says, the only reading of an entry's attributes the
database can make, its values being sealed.
the realm id
the base's normalised DN
the attribute name, lower-cased as stored
{ n, holding }
countHolding(), the store asked asynchronously.
the realm id
the base's normalised DN
the attribute name, lower-cased as stored
a promise of { n, holding }
How many entries are strictly under a base, from the store's count and this process's changes not yet written.
the realm id
the base's normalised DN
the count
Removes a key: a write, pinned until the flush writes it.
the realm id
the normalised DN
true when it held an entry
Drops the held count of every container above a key another process just created, changed or deleted.
the realm id
the changed entry's normalised DN
Calls fn for each RESIDENT entry of a realm: for a walk whose filter
can only match an entry outside the windowed containers.
the realm id
called with each entry and its key
The entries at many keys, as this process holds them: a key held here
(in the window, handed out, or evicted and still held by a caller) is
answered from what is held — an absence or a delete made here included
— and the rest are asked of the store with byKeys, a page at a time,
asynchronously.
the realm id
normalised DNs; a resident key is answered from memory
Optionalcounter: { pages: number; rows: number }
optional; pages and rows are added to
a promise of a Map from each key to its entry, or to null
A realm's count read from the store now, for ldap.maxEntries and for
a report.
the realm id
the count
The facade ldap_server.js holds as entries: the ambient realm's view
for every Map member, realmMap(id) for a named realm, and the window
itself as window.
the facade
The flush failed: the keys it took are still changed, and are taken again by the next one.
what collect() answered
The windowed entries of a realm matching an indexed question, as this process holds them.
the realm id
one of persistence/directory_queries.js's queries
its arguments
the service's own rule, asked of each candidate
Optionalinfo: { readOnly?: boolean; rows?: number }
optional; rows is set to how many rows the store
answered, before any was dropped, so a caller that asked with a limit
can tell a capped answer (#320); readOnly takes each row as the
store answered it where this process holds nothing newer, as
holdersAsync() does, rather than reading it again by key
[{ key, entry }], in key order, local additions last
findWindowed(), asked asynchronously and read-only: the windowed
entries of a realm matching an indexed question and predicate, each
as this process holds it, in the store's key order, the entries changed
here and not yet written that match added last — the order
findWindowed() answers in, so a caller taking the first answer takes
the entry it would have taken.
the realm id
one of persistence/directory_queries.js's queries
its arguments
the service's own rule, asked of each candidate
a promise of [{ key, entry }]
Forgets a key: a row another process wrote or removed, read again when next asked for. A resident key is removed.
the realm id
the normalised DN
true when something was held
The entry at a key, or undefined.
the realm id
the normalised DN
the entry
Whether anything is under a key.
the realm id
the normalised DN
true when something is
Whether a key holds an entry.
the realm id
the normalised DN
true when it does
What this process holds at a key, WITHOUT asking the store (#618): the group index's question "is the entry just written a group", which must never cost a round trip. A resident key is always known (the Map is the whole truth); a windowed key is known when the window, what was handed out since the last flush, or an evicted entry a caller still holds has it — an absence held counts — and is NOT known otherwise.
the realm id
the normalised DN
{ known, entry }; entry null for none
The windowed entries under a base that hold an attribute, as this
process holds them: the store's holders a page at a time, each read back
through the window and asked predicate, and changes made here added.
the realm id
the base's normalised DN (a windowed container, usually)
the attribute name, lower-cased as stored
the service's own rule, asked of each candidate
[{ key, entry }]
The windowed entries under a base that hold an attribute, as this process holds them, asked a page at a time without blocking the event loop between pages.
the realm id
the base's normalised DN (a windowed container, usually)
the attribute name, lower-cased as stored
the service's own rule, asked of each candidate
Optionalcontrol: { stop?: () => any }
optionally { stop }, asked before each page; a truthy
answer (the reason) ends the read with a thrown error whose stopped
is true, so a caller whose budget ran out stops the store too
(#1002: a report's holders read on 8081 outlived its request by
minutes, a page at a time, with nobody waiting for the answer)
a promise of [{ key, entry }]
One page of the windowed entries under a base that hold an attribute, in key order at an offset.
the realm id
the base's normalised DN
the attribute name, lower-cased as stored
holders to skip
the page size
the service's own rule, asked of each row
a promise of { rows: [{ key, entry }], read }, read the
rows the store answered (for a caller paging on)
Whether a key of a realm is windowed: strictly under one of its windowed containers.
the realm id
the normalised DN
true when windowed
keysUnderAsync(), asked synchronously: for a caller that cannot wait.
At most limit + 1 keys and no attribute, so a bounded handful of
statements (one per thousand keys), never a walk.
the realm id
the base's normalised DN (a windowed container)
how many at most
{ rows: [{ key, dn }], more }
The first keys strictly under a base, with their DNs and nothing else,
asked asynchronously a page at a time (keysUnder: no attribute is read
or opened) until limit + 1 are found — as this process holds them: a
key deleted here is left out, and below the cap the entries created
here and not yet written are added.
the realm id
the base's normalised DN (a windowed container)
how many at most
Optionalcounter: { pages: number; rows: number }
optional; pages and rows are added to
a promise of { rows: [{ key, dn }], more }, more when
there were more than limit
Another process changed a key this one is busy with: once this process's flush has let it go — written and merged by the store, or found unchanged — it is dropped, and read again when next asked for. Without this a key merely HANDED OUT when the change arrived would keep the older copy until it was evicted.
the realm id
the normalised DN
The windowed entries strictly under a base whose keys follow afterKey,
at most limit of them, in key order.
the realm id
the base's normalised DN
the last key of the previous page, or ''
the page size
{ rows: [{ key, entry }], more } — more when the store
answered a full page
The entry held at a key, without asking the store and without handing
it out: persistence.js's entryAt() for a windowed key.
the realm id
the normalised DN
the entry, or null
One page of a parent's direct children in rdn_value order, asked
asynchronously (#359). Nothing is put in the LRU. asked is how many
rows the store answered, including ones this process has deleted;
last is the last of those rows' RDN, so a cursor moves past a row
this process no longer holds.
the realm id
the parent's normalised DN
the previous page's last RDN, or ''
the page size (at most 1,000)
Optionaloptions: {offset and needle; with a needle, the caller's
count (matched, total, countCapped), which lets the store read
a needle with few matches through its trigram index (#1310)
{ rows, asked, last }
One page of a realm's entries in the store's key order, asked asynchronously.
the realm id
the last key of the previous page, or ''
the page size (at most 1,000)
Optionaloptions: { offset?: number; origin?: string }
offset (rows past the cursor to skip) and origin
a promise of { rows: [{ key, entry }], more, asked, last }
— asked how many rows the store answered, more when that was a
full page, last the last key it answered (the next page's cursor,
'' for none)
How many entries are strictly under a base: the store's count, read again when the last reading is more than ten seconds old, plus this process's own net since.
the realm id
the base's normalised DN
the count
The resident entries of a realm, keyed: what persistence.js's write
shadow covers. A windowed entry is never in that shadow — the window
holds its own base.
the realm id
[{ key, entry }]
One page of the windowed entries under a base, in key order after a cursor: those holding an attribute, or every one.
the realm id
the base's normalised DN (a windowed container)
the attribute held, lower-cased as stored; '' for every entry under the base
the last key of the page before, or ''
the page size (at most PAGE)
the service's own rule, asked of each row
a promise of { rows: [{ key, entry }], last, read }: last
the last key the store answered (the next page's cursor), read how
many rows it answered
Puts an entry at a key: a write, pinned until the flush writes it.
the realm id
the normalised DN
the entry
How many entries a realm holds, from the store's count of the windowed containers the first time and this process's own net since.
the realm id
the count
The window's figures, for a status page and tests.
the LRU's figures, and the dirty, in-flight, handed-out and evicted-but-held counts
At most limit direct children of a realm's ou=users whose RDN value
contains needle, asked asynchronously (directory_queries.js's
uidContains, 2026-10-20, /portal/delegate). Each row is what this
process holds for its key, or the store's row; asked is how many
rows the store answered, so a caller can tell a full answer from one
the limit cut short.
the realm id
the realm's ou=users, normalised
the substring, lower-cased
the most rows
{ rows, asked }
A Map-shaped view of one realm.
the realm id
the view
Walks a realm's entries at or under a base, lazily.
the realm id
the base's normalised DN, or '' for the whole realm
OptionalreadOnly: boolean
true when the caller edits nothing it is handed
an iterator of [key, entry]
walk(), read-only, with every page asked asynchronously and the event
loop given back between pages: a realm's entries at or under a base,
lazily, so a consumer that stops (a size or time limit) pages no
further.
the realm id
the base's normalised DN, or '' for the whole realm
Optionalcounter: { pages: number; rows: number }
optional; pages and rows are added to as the store
is asked, for a caller (or a test) that reports what it read
an async iterator of [key, entry]
Reads the slots of some windowed keys from the store, asynchronously,
and puts in the window those that nothing here changed meanwhile —
absences included, as slotFor() holds them.
the realm id
normalised DNs; resident or held keys are skipped
a promise of how many slots were put
The directory as a bounded window onto the store, in the shape of
realms.map()(#349).