MAX_NAME
MAX_NAME = 48
Longest name a target may carry.
The ProviderStatStore provider column is 64 characters and the name is written into it, so a longer name would be truncated there and two tiers could collide on one row.
Which bucket one tier writes to.
A tier is not a new kind of store. It is an existing provider pointed at a different location, so everything a provider already reports - its capabilities, its reachability, its request counts - keeps working unchanged. Only two things vary between tiers of the same provider in practice, and both are here: the bucket or directory, and the storage class objects land in.
The name is what a per-tier request count is filed under in ProviderStatStore, so it has to be unique, short and safe in a database column. It is normalised the same way a site id is, for the same reason.
__construct(string $name, string $provider, string $location = '', string $storageClass = '') : mixed
Constructs a target.
| string | $name | Short unique token such as "near" or "year", used as the label and as the per-tier key in ProviderStatStore. |
| string | $provider | Registered provider id the tier is built from, such as "local" or "s3". |
| string | $location | Bucket name for an object store, or directory for the local provider. An empty string uses whatever that provider is already configured with, which is what a single-tier site wants. |
| string | $storageClass | Storage class objects in this tier are written with, or an empty string for the endpoint default. Honoured only where Capabilities::$storageClasses is true; a provider that cannot store one refuses the write rather than dropping it. |
When the name is empty, longer than TierTarget::MAX_NAME, or normalises to nothing, or when the provider id is empty.
address() : string
The provider and location together, as one comparable token.
Two tiers pointing at the same bucket would make a move a no-op and a replica a claim about durability that is not true, so TierMap refuses a ladder where this repeats.
Something such as "s3:strata-cold".
fromSettings(array$row, int $index) : self
Builds a target from one settings row.
| array |
$row | One entry of the |
| int | $index | Position on the ladder, used to name a row that did not name itself. |
When the row names no provider.
The target.