\Drupal\strata Engine

Assembles the pipeline from configuration.

Every part of the engine is independently constructible and independently tested; this is the one place that reads settings and decides which parts a given site gets.

Nothing is built until it is asked for, and each piece is built once. A request that captures but never flushes therefore never constructs a storage provider or a cipher.

Summary

Methods
Properties
Constants
__construct
provider
tiers
tierMap
placementIndex
tierMigrator
tierPlacementRebuilder
tierRequirements
providerStats
providerStatStore
persistProviderStats
tierStats
frameIndex
budgetGuard
budgetAssessment
journal
commitIndex
ledger
notifier
providerIds
site
cipher
keyRing
keyRotation
codecs
objectStore
chainDepthPolicy
reanchorer
dictionaries
dictionaryTrainer
dictionaryPass
activeDictionary
segmentWriter
segmentReader
baseWriter
baseReader
basePolicy
subjectIndex
commitLog
refStore
branchStore
branchIndex
mergeBase
merger
verifier
replayer
preflight
logicalRestore
reconciler
keyspaceDiscovery
addKeyspaceSource
restoreAccess
physicalRestore
addRestoreStrategy
codeCapture
projectRoot
levelPolicy
reachability
recompressor
compactor
fileCapture
mediaStore
rollup
archiveExporter
archiveImporter
timeline
series
priceTable
diffBuilder
storageExplorer
drillIndex
drillRunner
metricSampler
anomalyDetector
tracer
telemetryExporter
telemetryPass
repairPass
reindexer
flushPolicy
flusher
reset
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
buildTier
buildProvider
relocated
reportLostCodec
circuitBreaker
keyProvider
keyProviderFor
localPath
level
settings
provider
tiers
providerStats
tierStats
placementIndex
providerStatStore
cipher
codecs
store
dictionaryStore
telemetry
tracer
keyspaceSources
restoreStrategies
configFactory
journal
index
commitIndex
ledger
lease
logger
audit
entityTypeManager
state
keyValue
database
scope
classifications
site
currentUser
notifier
time
keys
providers
http
No private constants found

Properties

$provider

$provider : ?\Drupal\strata\Storage\StorageProviderInterface

The storage provider, once resolved.

Type

StorageProviderInterface|null

$tiers

$tiers : ?\Drupal\strata\Tier\TieredProvider

The tiered router, once resolved, or NULL when the site writes to one bucket.

Type

TieredProvider|null

$providerStats

$providerStats : ?\Drupal\strata\Storage\ProviderStats

What the store has been asked to do this process.

Deliberately not cleared by Engine::reset(): a settings change does not un-issue the requests that were already made, and the same accumulator is handed to the provider built afterwards.

Type

ProviderStats|null

$tierStats

$tierStats : array

What each tier has been asked to do this process, keyed by tier name.

Not cleared by Engine::reset(), for the reason the total is not.

Type

array<string, ProviderStats> —

$placementIndex

$placementIndex : ?\Drupal\strata\Tier\PlacementIndexInterface

The placement index, once built.

Type

PlacementIndexInterface|null

$providerStatStore

$providerStatStore : ?\Drupal\strata\Storage\ProviderStatStore

The per-day record of store traffic, once built.

Type

ProviderStatStore|null

$cipher

$cipher : ?\Drupal\strata\Crypto\CipherInterface

The cipher, once resolved.

Type

CipherInterface|null

$codecs

$codecs : ?\Drupal\strata\Codec\CodecRegistry

The codec registry, once built.

Type

CodecRegistry|null

$store

$store : ?\Drupal\strata\Cas\ObjectStore

The object store, once built.

Type

ObjectStore|null

$dictionaryStore

$dictionaryStore : ?\Drupal\strata\Codec\Dictionary\DictionaryStore

The dictionary store, once built.

Type

DictionaryStore|null

$telemetry

$telemetry : ?\Drupal\strata\Telemetry\OtlpExporter

The telemetry exporter, once built.

Type

OtlpExporter|null

$tracer

$tracer : ?\Drupal\strata\Telemetry\Tracer

The tracer, once built.

Held rather than rebuilt because spans accumulate in it, and a second tracer would start with an empty buffer and export half the request.

Type

Tracer|null

$keyspaceSources

$keyspaceSources : list<\Drupal\strata\Capture\Classifier\KeyspaceSourceInterface>

Keyspace sources contributed by submodules.

Type

array<int, KeyspaceSourceInterface> —

$restoreStrategies

$restoreStrategies : list<\Drupal\strata\Restore\RestoreStrategyInterface>

Restore strategies contributed by submodules.

Type

array<int, RestoreStrategyInterface> —

$configFactory

$configFactory : \Drupal\Core\Config\ConfigFactoryInterface

Type

ConfigFactoryInterface

$journal

$journal : \Drupal\strata\Journal\JournalInterface

Type

JournalInterface

$commitIndex

$commitIndex : \Drupal\strata\Tree\CommitIndex

Type

CommitIndex

$lease

$lease : \Drupal\strata\Flush\Lease

Type

Lease

$logger

$logger : \Psr\Log\LoggerInterface

Type

LoggerInterface

$audit

$audit : \Drupal\strata\Restore\RestoreAudit

Type

RestoreAudit

$entityTypeManager

$entityTypeManager : \Drupal\Core\Entity\EntityTypeManagerInterface

Type

EntityTypeManagerInterface

$state

$state : \Drupal\Core\State\StateInterface

Type

StateInterface

$keyValue

$keyValue : \Drupal\Core\KeyValueStore\KeyValueFactoryInterface

Type

KeyValueFactoryInterface

$database

$database : \Drupal\Core\Database\Connection

Type

Connection

$scope

$scope : \Drupal\strata\Capture\CaptureScope

Type

CaptureScope

$classifications

$classifications : \Drupal\strata\Capture\Classifier\ClassificationRegistry

Type

ClassificationRegistry

$site

$site : \Drupal\strata\Site\SiteContext

Type

SiteContext

$currentUser

$currentUser : \Drupal\Core\Session\AccountProxyInterface

Type

AccountProxyInterface

$notifier

$notifier : \Drupal\strata\Event\Notifier

Type

Notifier

$time

$time : \Drupal\Component\Datetime\TimeInterface

Type

TimeInterface

$keys

$keys : ?\Drupal\key\KeyRepositoryInterface

Type

KeyRepositoryInterface|null

$http

$http : ?\GuzzleHttp\ClientInterface

Type

ClientInterface|null

Methods

__construct()

__construct(\Drupal\Core\Config\ConfigFactoryInterface  $configFactory, \Drupal\strata\Journal\JournalInterface  $journal, \Drupal\strata\Cas\FrameIndexInterface  $index, \Drupal\strata\Tree\CommitIndex  $commitIndex, \Drupal\strata\Health\HealthLedgerInterface  $ledger, \Drupal\strata\Flush\Lease  $lease, \Psr\Log\LoggerInterface  $logger, \Drupal\strata\Restore\RestoreAudit  $audit, \Drupal\Core\Entity\EntityTypeManagerInterface  $entityTypeManager, \Drupal\Core\State\StateInterface  $state, \Drupal\Core\KeyValueStore\KeyValueFactoryInterface  $keyValue, \Drupal\Core\Database\Connection  $database, \Drupal\strata\Capture\CaptureScope  $scope, \Drupal\strata\Capture\Classifier\ClassificationRegistry  $classifications, \Drupal\strata\Site\SiteContext  $site, \Drupal\Core\Session\AccountProxyInterface  $currentUser, \Drupal\strata\Event\Notifier  $notifier = new \Drupal\strata\Event\Notifier(), \Drupal\Component\Datetime\TimeInterface  $time = new \Drupal\Component\Datetime\Time(), \Drupal\key\KeyRepositoryInterface|null  $keys = null, \Drupal\strata\Storage\StorageProviderManager|null  $providers = null, \GuzzleHttp\ClientInterface|null  $http = null) : mixed

Constructs an engine.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $configFactory

Where settings are read from.

\Drupal\strata\Journal\JournalInterface $journal

The journal a flush drains.

\Drupal\strata\Cas\FrameIndexInterface $index

The deduplication index.

\Drupal\strata\Tree\CommitIndex $commitIndex

The local index over the commit log.

\Drupal\strata\Health\HealthLedgerInterface $ledger

Where a verify pass records what it found.

\Drupal\strata\Flush\Lease $lease

Keeps two flushes from overlapping.

\Psr\Log\LoggerInterface $logger

Records what a flush did.

\Drupal\strata\Restore\RestoreAudit $audit

Where a restore records who did what.

\Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager

Loads and saves the entities a logical restore writes into.

\Drupal\Core\State\StateInterface $state

Where a logical restore writes state values back.

\Drupal\Core\KeyValueStore\KeyValueFactoryInterface $keyValue

Where a logical restore writes key-value entries back.

\Drupal\Core\Database\Connection $database

The database the reconciler inspects.

\Drupal\strata\Capture\CaptureScope $scope

Decides which tables the reconciler watches.

\Drupal\strata\Capture\Classifier\ClassificationRegistry $classifications

Holds what each part of the ephemeral keyspace has been decided to be.

\Drupal\strata\Site\SiteContext $site

Which site's history this engine reads and writes, so several can share one bucket.

\Drupal\Core\Session\AccountProxyInterface $currentUser

Attributes a restore to whoever ran it.

\Drupal\strata\Event\Notifier $notifier

Announces what the pipeline did.

\Drupal\Component\Datetime\TimeInterface $time

The clock an archive and a drill are stamped from.

\Drupal\key\KeyRepositoryInterface|null $keys

Supplies the encryption key, or NULL when the key module is absent.

\Drupal\strata\Storage\StorageProviderManager|null $providers

Providers contributed by submodules, or NULL to use only the built-in ones.

\GuzzleHttp\ClientInterface|null $http

The client telemetry is exported with, or NULL to build one.

Returns

mixed —

provider()

provider() : \Drupal\strata\Storage\StorageProviderInterface

The configured storage provider.

Throws

\RuntimeException

When the configured provider is not registered, or the local provider has no directory.

Returns

\Drupal\strata\Storage\StorageProviderInterface —

The provider.

tiers()

tiers() : \Drupal\strata\Tier\TieredProvider|null

The tiered router, when the site spreads history across several buckets.

Returns

\Drupal\strata\Tier\TieredProvider|null —

The router, or NULL when the site writes to one bucket. Built by Engine::provider(), so asking for it resolves the provider first.

tierMap()

tierMap() : \Drupal\strata\Tier\TierMap|null

The storage ladder from configuration.

Throws

\RuntimeException

When the configured ladder is not one this can honour - a repeated bucket, a threshold that does not increase, a tier naming no provider. Refused here rather than at the first flush.

Returns

\Drupal\strata\Tier\TierMap|null —

The ladder, or NULL when tiering is off or fewer than two tiers are configured. One tier is what an untiered site already does, so it stays on the single-provider path.

placementIndex()

placementIndex() : \Drupal\strata\Tier\PlacementIndexInterface

Where each object lives.

Returns

\Drupal\strata\Tier\PlacementIndexInterface —

The index.

tierMigrator()

tierMigrator() : \Drupal\strata\Tier\TierMigrator|null

A migration pass that moves aged objects into the tier they belong in.

Returns

\Drupal\strata\Tier\TierMigrator|null —

The pass, or NULL when the site writes to one bucket.

tierPlacementRebuilder()

tierPlacementRebuilder() : \Drupal\strata\Tier\TierPlacementRebuilder|null

A pass that rebuilds the placement index by listing every tier.

Returns

\Drupal\strata\Tier\TierPlacementRebuilder|null —

The pass, or NULL when the site writes to one bucket.

tierRequirements()

tierRequirements() : \Drupal\strata\Tier\TierRequirements|null

A pass that answers which tiers a restore would need.

Returns

\Drupal\strata\Tier\TierRequirements|null —

The pass, or NULL when the site writes to one bucket and every restore needs it.

providerStats()

providerStats() : \Drupal\strata\Storage\ProviderStats

What the store has been asked to do so far this process.

One accumulator per engine, shared by every part that reaches the store, so a flush and the verify that follows it appear on the same bill. Engine::persistProviderStats() moves it into ProviderStatStore, which is the only place the figures survive the process.

Returns

\Drupal\strata\Storage\ProviderStats —

The accumulator.

providerStatStore()

providerStatStore() : \Drupal\strata\Storage\ProviderStatStore

The per-day record of what every store was asked to do.

Returns

\Drupal\strata\Storage\ProviderStatStore —

The store.

persistProviderStats()

persistProviderStats() : int

Moves this process's request counts into the per-day record and starts a new window.

Safe to call when nothing has touched the store: an empty accumulator writes no row, so a request that captured but never flushed costs no query. Called on terminate, so the figures a report reads include the flush that just happened rather than the one before it.

On a tiered store each tier is filed under its own name as well, which is what makes "the far buckets are barely touched" a figure an operator can read rather than a design claim. The total is still filed under the provider id, so a report that never heard of tiers keeps working.

Returns

int —

How many operation rows were written.

tierStats()

tierStats() : array<string,\Drupal\strata\Storage\ProviderStats>

What each tier has been asked to do so far this process.

Returns

array

Tier name keyed to its accumulator, empty until a tiered provider has been built.

frameIndex()

frameIndex() : \Drupal\strata\Cas\FrameIndexInterface

The deduplication index.

Read by the pages that report what the store holds.

Returns

\Drupal\strata\Cas\FrameIndexInterface —

The index.

budgetGuard()

budgetGuard() : \Drupal\strata\Budget\BudgetGuard

The guard that prices this site against the ceilings it set.

Returns

\Drupal\strata\Budget\BudgetGuard —

The guard, holding whichever ceilings are configured. Both zero means no ceiling, which the guard reports as the normal rung rather than as an error.

budgetAssessment()

budgetAssessment(int  $seconds = 2592000) : \Drupal\strata\Budget\BudgetAssessment

What a month of the traffic in a window would cost, and which rung that lands on.

The window comes out of the per-day stat table rather than from this process's accumulator, which holds only what this request has done. Storage is what the frame index says the store holds now.

The rung is held to budget.action: that setting is what the operator chose to happen at the ceiling, and letting the measured rung exceed it would stop capture on a site that asked to be warned.

Parameters

int $seconds

How far back to read. Defaults to thirty days, which is the window the ceilings are set in.

Returns

\Drupal\strata\Budget\BudgetAssessment —

The reading.

journal()

journal() : \Drupal\strata\Journal\JournalInterface

The journal a flush drains.

Read by the status panels, which report what is captured and not yet sealed.

Returns

\Drupal\strata\Journal\JournalInterface —

The journal.

commitIndex()

commitIndex() : \Drupal\strata\Tree\CommitIndex

The local index over the commit log.

Read by the pages that show a commit without needing to fetch it from the bucket.

Returns

\Drupal\strata\Tree\CommitIndex —

The index.

ledger()

ledger() : \Drupal\strata\Health\HealthLedgerInterface

The health ledger.

Read by the dashboard and by a repair action, both of which need the ledger rather than anything that writes to it.

Returns

\Drupal\strata\Health\HealthLedgerInterface —

The ledger.

notifier()

notifier() : \Drupal\strata\Event\Notifier

The notifier every producer announces through.

Returns

\Drupal\strata\Event\Notifier —

The notifier.

providerIds()

providerIds() : list<string>

The provider ids a submodule has contributed.

Read by the settings form, which offers the two built-in providers plus whatever is registered.

Returns

list

The ids, empty when no submodule contributes one.

site()

site() : \Drupal\strata\Site\SiteContext

The site whose history this engine reads and writes.

Returns

\Drupal\strata\Site\SiteContext —

The context.

cipher()

cipher() : \Drupal\strata\Crypto\CipherInterface

The configured cipher.

A site with encryption on and no key configured is refused rather than silently storing plaintext. The bucket would look like a working backup and would not be one.

Throws

\RuntimeException

When encryption is on and no usable key is configured.

Returns

\Drupal\strata\Crypto\CipherInterface —

The cipher.

keyRing()

keyRing() : \Drupal\strata\Crypto\KeyRing

The keys frames are sealed and opened with.

Throws

\RuntimeException

When no active key is configured, or one is the wrong length.

Returns

\Drupal\strata\Crypto\KeyRing —

The active key plus any retired keys still configured.

keyRotation()

keyRotation() : \Drupal\strata\Crypto\KeyRotation

A rotation pass over the frames still sealed under a retired key.

Throws

\RuntimeException

When encryption is off, since there is then nothing to rotate.

Returns

\Drupal\strata\Crypto\KeyRotation —

The pass.

codecs()

codecs() : \Drupal\strata\Codec\CodecRegistry

The codec registry, following the configured codec where this host can run it.

Availability is a property of the host and a host changes: a PHP rebuilt without ext-zstd, a container image swapped, a move between two servers. CodecRegistry::prefer() refuses a codec it cannot write frames with, which suits a form deciding whether a choice can be honoured; here the raise would reach every report page and every flush at once. So a pinned codec the host cannot run falls back to the write preference and records a finding. The store is unaffected either way: every reader stays registered, so frames written under the old codec still decode.

Returns

\Drupal\strata\Codec\CodecRegistry —

The registry, holding every codec this release ships.

objectStore()

objectStore() : \Drupal\strata\Cas\ObjectStore

The object store payloads go through.

Returns

\Drupal\strata\Cas\ObjectStore —

The store.

chainDepthPolicy()

chainDepthPolicy() : \Drupal\strata\Delta\ChainDepthPolicy|null

The delta chain cap from configuration.

Returns

\Drupal\strata\Delta\ChainDepthPolicy|null —

The policy, or NULL when delta coding is switched off, which stores every frame standalone.

reanchorer()

reanchorer() : \Drupal\strata\Delta\Reanchorer

A re-anchoring pass over the chains in the index.

Returns

\Drupal\strata\Delta\Reanchorer —

The pass.

dictionaries()

dictionaries() : \Drupal\strata\Codec\Dictionary\DictionaryStore

The dictionary store over the configured provider.

Returns

\Drupal\strata\Codec\Dictionary\DictionaryStore —

The store.

dictionaryTrainer()

dictionaryTrainer() : \Drupal\strata\Codec\Dictionary\DictionaryTrainer

A trainer scoring candidates through the codec this host will actually use.

Returns

\Drupal\strata\Codec\Dictionary\DictionaryTrainer —

The trainer.

dictionaryPass()

dictionaryPass() : \Drupal\strata\Codec\Dictionary\DictionaryPass

A training pass over what the store already holds.

Returns

\Drupal\strata\Codec\Dictionary\DictionaryPass —

The pass.

activeDictionary()

activeDictionary() : \Drupal\strata\Codec\Dictionary\DictionaryRef|null

The dictionary new frames are compressed against.

One dictionary per store rather than one per realm, because a frame is addressed by its content and a store that chose a dictionary per operation would compress the same bytes two ways and store them twice. The entity realm is the one that matters - it is the overwhelming majority of operations - so its dictionary is the one that is loaded.

Returns

\Drupal\strata\Codec\Dictionary\DictionaryRef|null —

The reference, or NULL when dictionaries are off, unsupported, or none has been trained.

segmentWriter()

segmentWriter() : \Drupal\strata\Segment\SegmentWriter

A segment writer over the configured store.

Returns

\Drupal\strata\Segment\SegmentWriter —

The writer.

segmentReader()

segmentReader() : \Drupal\strata\Segment\SegmentReader

A segment reader over the configured store.

Returns

\Drupal\strata\Segment\SegmentReader —

The reader.

baseWriter()

baseWriter() : \Drupal\strata\Tree\BaseWriter

A writer for the base anchors a replay starts from.

Returns

\Drupal\strata\Tree\BaseWriter —

The writer.

baseReader()

baseReader() : \Drupal\strata\Tree\BaseReader

A reader over the base anchors.

Returns

\Drupal\strata\Tree\BaseReader —

The reader.

basePolicy()

basePolicy() : \Drupal\strata\Tree\BasePolicy

The anchor policy from configuration.

Returns

\Drupal\strata\Tree\BasePolicy —

The policy.

subjectIndex()

subjectIndex() : \Drupal\strata\Tree\SubjectIndex

The local index of where every subject was last stored.

Returns

\Drupal\strata\Tree\SubjectIndex —

The index.

commitLog()

commitLog() : \Drupal\strata\Tree\CommitLog

The commit log over the configured store.

Returns

\Drupal\strata\Tree\CommitLog —

The log.

refStore()

refStore() : \Drupal\strata\Tree\RefStore

The ref store over the configured provider.

Returns

\Drupal\strata\Tree\RefStore —

The store.

branchStore()

branchStore() : \Drupal\strata\Branch\BranchStore

The branch store over the configured provider.

Returns

\Drupal\strata\Branch\BranchStore —

The store.

branchIndex()

branchIndex() : \Drupal\strata\Branch\BranchIndex

The local index of what branches this site holds.

Returns

\Drupal\strata\Branch\BranchIndex —

The index.

mergeBase()

mergeBase() : \Drupal\strata\Branch\MergeBase

A merge base finder over the local commit index.

Returns

\Drupal\strata\Branch\MergeBase —

The finder.

merger()

merger() : \Drupal\strata\Branch\Merger

A merger over the configured store.

Returns

\Drupal\strata\Branch\Merger —

The merger, which branches, lists and merges the configuration realm.

verifier()

verifier() : \Drupal\strata\Verify\Verifier

A verifier over the configured store.

Returns

\Drupal\strata\Verify\Verifier —

A verifier wired to the storage tripwires and the persistent ledger.

replayer()

replayer() : \Drupal\strata\Restore\Replayer

A replayer over the configured store.

Returns

\Drupal\strata\Restore\Replayer —

The replayer.

preflight()

preflight() : \Drupal\strata\Restore\Preflight

A preflight over the configured store.

Returns

\Drupal\strata\Restore\Preflight —

The preflight.

logicalRestore()

logicalRestore() : \Drupal\strata\Restore\LogicalRestore

A logical restore over the configured store.

Returns

\Drupal\strata\Restore\LogicalRestore —

The restore.

reconciler()

reconciler() : \Drupal\strata\Capture\Reconciler

The reconciler.

Returns

\Drupal\strata\Capture\Reconciler —

A reconciler over the site's own database.

keyspaceDiscovery()

keyspaceDiscovery() : \Drupal\strata\Capture\Classifier\KeyspaceDiscovery

A keyspace discovery pass over whatever sources are registered.

The database source is always present, since a site's default cache and key-value backends are tables. Submodules add their own by tagging a service, so a site with strata_redis gets both.

Returns

\Drupal\strata\Capture\Classifier\KeyspaceDiscovery —

The discovery pass.

addKeyspaceSource()

addKeyspaceSource(\Drupal\strata\Capture\Classifier\KeyspaceSourceInterface  $source) : void

Adds a keyspace source contributed by a submodule.

Collected from the container by tag, so a submodule contributes one without this class knowing what backends exist.

Parameters

\Drupal\strata\Capture\Classifier\KeyspaceSourceInterface $source

The source.

Returns

void —

restoreAccess()

restoreAccess() : \Drupal\strata\Access\RestoreAccess

The restore access checker, configured with the site's approval policy.

Returns

\Drupal\strata\Access\RestoreAccess —

The checker.

physicalRestore()

physicalRestore() : \Drupal\strata\Restore\PhysicalRestore

The physical restore, with the strategies this host can run.

Both shipped strategies are registered whether or not the driver supports them, because an operator asking why the swap is unavailable needs it listed with its reason rather than absent.

Returns

\Drupal\strata\Restore\PhysicalRestore —

The restore.

addRestoreStrategy()

addRestoreStrategy(\Drupal\strata\Restore\RestoreStrategyInterface  $strategy) : void

Adds a restore strategy contributed by a submodule.

Parameters

\Drupal\strata\Restore\RestoreStrategyInterface $strategy

The strategy.

Returns

void —

codeCapture()

codeCapture() : \Drupal\strata\Code\CodeCapture

A code capture pass over the project root.

Returns

\Drupal\strata\Code\CodeCapture —

The pass.

projectRoot()

projectRoot() : string

The directory the site's code and lockfiles live under.

Configured rather than derived. The docroot and the composer root are the same directory on some installs and one level apart on the drupal/recommended-project layout, and guessing wrong means walking the wrong tree - or walking vendor/ as if it were the site's own code.

Returns

string —

The configured root, or Drupal's own root when nothing is configured.

levelPolicy()

levelPolicy() : \Drupal\strata\Compaction\LevelPolicy

The retention ladder from configuration.

Returns

\Drupal\strata\Compaction\LevelPolicy —

The policy.

reachability()

reachability() : \Drupal\strata\Compaction\Reachability

A reachability set over the configured store.

Returns

\Drupal\strata\Compaction\Reachability —

The set, unwalked until it is asked a question.

recompressor()

recompressor() : \Drupal\strata\Compaction\Recompressor

A recompressor at the configured compaction level.

Returns

\Drupal\strata\Compaction\Recompressor —

The recompressor.

compactor()

compactor() : \Drupal\strata\Compaction\Compactor

The compactor.

Returns

\Drupal\strata\Compaction\Compactor —

A compactor wired to the configured store and retention ladder.

fileCapture()

fileCapture() : \Drupal\strata\File\FileCapture

A file capture over the configured store.

Returns

\Drupal\strata\File\FileCapture —

The capture.

mediaStore()

mediaStore(\Drupal\strata\File\BlockSplitter|null  $splitter = null) : \Drupal\strata\File\MediaStore

The block store file content is written to.

Parameters

\Drupal\strata\File\BlockSplitter|null $splitter

The splitter to use, or NULL to build one from configuration.

Returns

\Drupal\strata\File\MediaStore —

The store.

rollup()

rollup() : \Drupal\strata\Compaction\Rollup

A rollup pass over the retention ladder.

Returns

\Drupal\strata\Compaction\Rollup —

The pass.

archiveExporter()

archiveExporter() : \Drupal\strata\Archive\ArchiveExporter

An exporter writing a portable archive of this site's history.

Returns

\Drupal\strata\Archive\ArchiveExporter —

The exporter.

archiveImporter()

archiveImporter() : \Drupal\strata\Archive\ArchiveImporter

An importer loading a portable archive into this site's store.

Returns

\Drupal\strata\Archive\ArchiveImporter —

The importer.

timeline()

timeline() : \Drupal\strata\Timeline\TimelineQuery

A timeline query over the local commit index.

Returns

\Drupal\strata\Timeline\TimelineQuery —

The query.

series()

series() : \Drupal\strata\Metrics\SeriesBuilder

A series builder for the graphs.

Returns

\Drupal\strata\Metrics\SeriesBuilder —

The builder, priced against the configured provider.

priceTable()

priceTable() : \Drupal\strata\Estimate\PriceTable

The price table for the configured provider.

A provider with no published prices falls back to the local table, which charges nothing. An add-on may register any provider id and a site may have none configured at all, and a cost graph that raised on either would take down the page an operator opens to find out what the store is costing them.

Returns

\Drupal\strata\Estimate\PriceTable —

The table, or the local one when no table is shipped for the configured provider.

diffBuilder()

diffBuilder() : \Drupal\strata\Diff\DiffBuilder

A diff builder over the configured store.

Returns

\Drupal\strata\Diff\DiffBuilder —

The builder.

storageExplorer()

storageExplorer() : \Drupal\strata\Explore\StorageExplorer

A storage explorer over the configured store.

Returns

\Drupal\strata\Explore\StorageExplorer —

The explorer.

drillIndex()

drillIndex() : \Drupal\strata\Drill\DrillIndex

The local index of what each restore drill proved.

Returns

\Drupal\strata\Drill\DrillIndex —

The index.

drillRunner()

drillRunner() : \Drupal\strata\Drill\DrillRunner

A restore drill over the configured store.

Returns

\Drupal\strata\Drill\DrillRunner —

The runner.

metricSampler()

metricSampler() : \Drupal\strata\Anomaly\MetricSampler

The metric window anomaly detection reads from.

Returns

\Drupal\strata\Anomaly\MetricSampler —

The sampler.

anomalyDetector()

anomalyDetector() : \Drupal\strata\Anomaly\AnomalyDetector

An anomaly detector over the sampled window.

Returns

\Drupal\strata\Anomaly\AnomalyDetector —

The detector.

tracer()

tracer() : \Drupal\strata\Telemetry\Tracer

A tracer, enabled only when a collector is configured.

Returns

\Drupal\strata\Telemetry\Tracer —

The tracer.

telemetryExporter()

telemetryExporter() : \Drupal\strata\Telemetry\OtlpExporter

An OTLP exporter over the configured collector.

Returns

\Drupal\strata\Telemetry\OtlpExporter —

The exporter, which sends nothing when no endpoint is configured.

telemetryPass()

telemetryPass() : \Drupal\strata\Telemetry\TelemetryPass

A telemetry pass over the local indexes.

Returns

\Drupal\strata\Telemetry\TelemetryPass —

The pass.

repairPass()

repairPass() : \Drupal\strata\Health\RepairPass

The repair pass over the open findings.

The two passes are handed over as closures rather than as objects, so asking what there is to repair costs a query rather than an assembled store: both reindexer() and verifier() build the provider and the cipher, and a site that has not chosen an encryption key cannot build either. Nothing should have to be configured before Strata can say there is nothing to fix.

Returns

\Drupal\strata\Health\RepairPass —

The pass.

reindexer()

reindexer() : \Drupal\strata\Verify\Reindexer

A reindexer over the configured store.

Returns

\Drupal\strata\Verify\Reindexer —

A reindexer that rebuilds both local indexes from the bucket.

flushPolicy()

flushPolicy() : \Drupal\strata\Journal\FlushPolicy

The flush policy from configuration.

Returns

\Drupal\strata\Journal\FlushPolicy —

The policy.

flusher()

flusher() : \Drupal\strata\Flush\Flusher

The flusher.

Returns

\Drupal\strata\Flush\Flusher —

A flusher wired to the configured store.

reset()

reset() : void

Forgets everything resolved so far.

Called after a settings change, and by a long-running command between batches.

Returns

void —

buildTier()

buildTier(\Drupal\strata\Tier\Tier  $tier) : \Drupal\strata\Storage\StorageProviderInterface

The provider one tier writes to, with its own request counter.

Counted twice on purpose. The inner accumulator is this tier's own bill, which is what makes a far tier's promise of few requests a measurement rather than a claim; the outer is the process total, which is what the budget guard and the telemetry pass read. Counting only the total would leave the per-tier figures estimated, and counting only per tier would leave the guard with nothing.

Parameters

\Drupal\strata\Tier\Tier $tier

The tier.

Throws

\RuntimeException

When the tier's provider is not registered, or cannot address its own location.

Returns

\Drupal\strata\Storage\StorageProviderInterface —

The provider.

buildProvider()

buildProvider(string  $id, \Drupal\strata\Tier\Tier|null  $tier) : \Drupal\strata\Storage\StorageProviderInterface

One raw storage provider, optionally pointed at a tier's own location.

Parameters

string $id

Provider id from configuration.

\Drupal\strata\Tier\Tier|null $tier

The tier to build for, or NULL for the site's single configured destination.

Throws

\RuntimeException

When the id is not registered, the local provider has no directory, or the tier names a location the provider's factory cannot address.

Returns

\Drupal\strata\Storage\StorageProviderInterface —

The provider.

relocated()

relocated(string  $id, \Drupal\strata\Tier\Tier  $tier) : \Drupal\strata\Storage\StorageProviderInterface

A provider pointed at a tier's own bucket or directory.

A provider whose factory cannot take a second location is refused rather than quietly built at the first one. Two tiers sharing a bucket would make a move a delete and a replica a claim about durability that is not true, and the ladder's own validation cannot catch it because the locations differ on paper.

Parameters

string $id

Provider id.

\Drupal\strata\Tier\Tier $tier

The tier.

Throws

\RuntimeException

When the provider cannot be pointed at the tier's location.

Returns

\Drupal\strata\Storage\StorageProviderInterface —

The provider.

reportLostCodec()

reportLostCodec(string  $pinned, \Drupal\strata\Codec\CodecRegistry  $registry) : void

Says that the configured codec is gone and what is being written instead.

WARN rather than ERROR because severity picks the repair rung and everything at ERROR and above runs an unattended pass. Nothing automatic installs a PHP extension, and the store is not damaged: frames written under the old codec still read, and new ones are written under a codec that works.

Parameters

string $pinned

The codec id configuration asks for.

\Drupal\strata\Codec\CodecRegistry $registry

The registry as this host built it.

Returns

void —

circuitBreaker()

circuitBreaker() : \Drupal\strata\Health\CircuitBreaker

The breaker that stops a repair rung retrying a fault that keeps failing.

Both dials are clamped rather than passed through. CircuitBreaker refuses a threshold below one and a negative cooldown, the form's #min does not reach drush config:set, and the raise would land inside a cron stage where it would take the rest of the run with it.

Returns

\Drupal\strata\Health\CircuitBreaker —

The breaker, configured as the site asked.

keyProvider()

keyProvider() : \Drupal\strata\Crypto\KeyProviderInterface

The key the cipher seals with.

Throws

\RuntimeException

When no key is configured, the key module is absent, or the key is the wrong length.

Returns

\Drupal\strata\Crypto\KeyProviderInterface —

A provider holding the configured key.

keyProviderFor()

keyProviderFor(string  $id) : \Drupal\strata\Crypto\KeyProviderInterface|null

One key from the key module, by its machine name.

A retired key that has already been deleted resolves to NULL rather than throwing, because a finished rotation is exactly the case where that happens and it must not stop the site reading its own history.

Parameters

string $id

The key entity's machine name.

Returns

\Drupal\strata\Crypto\KeyProviderInterface|null —

The provider, or NULL when the key is absent or holds nothing.

localPath()

localPath() : string

Where the local provider writes.

Returned as configured rather than resolved to a real path. LocalStorage uses plain file functions, which route through any registered stream wrapper, so private://strata works directly and so does the vfs:// root a kernel test runs in. Calling realpath() here would reject both.

Throws

\RuntimeException

When no directory is configured.

Returns

string —

The configured path.

level()

level(string  $which) : int|null

A configured compression level.

Parameters

string $which

Either "flush_level" or "compaction_level".

Returns

int|null —

The level, or NULL for the codec's own default.

settings()

settings() : \Drupal\Core\Config\ImmutableConfig

The module settings.

Returns

\Drupal\Core\Config\ImmutableConfig —

The settings.