2019-07-08 19:12:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generic interface for object stores with key encoding methods.
|
|
|
|
|
*
|
|
|
|
|
* @ingroup Cache
|
|
|
|
|
* @since 1.34
|
|
|
|
|
*/
|
|
|
|
|
interface IStoreKeyEncoder {
|
|
|
|
|
/**
|
objectcache: make BagOStuff key encoding more consistent
Add "generic" key methods for quickly deriving keys from
key component lists in a bijective manor. This is useful
for BagOStuff classes that wrap other BagOStuff instances
or for parsing keys to get stats.
Make the proxy BagOStuff classes (ReplicatedBagOStuff,
MultiWriteBagOStuff, CachedBagOStuff) use "generic" keys
so that they can convert to appropriate keys when making
backing cache instance method calls.
Make EmptyBagOStuff, HashBagOStuff, APCUBagOStuff,
RedisBagOStuff, and RESTBagOStuff use "generic" keys rather
than those of MediumSpecificBagOStuff::makeKeyInternal().
This lets proxy BagOStuff classes bypass key conversions
when used with instances of these classes as backing stores.
Also:
* Fix missing incr(), incrWithInit(), and decr() return
values in MultiWriteBagOStuff.
* Make MultiWriteBagOfStuff, ReplicatedBagOStuff, and
CachedBagOStuff use similar backend method forwarding
styles by using a new BagOStuff method.
* Improved various related bits of documentation.
Bug: T250239
Bug: T235705
Change-Id: I1eb897c2cea3f5b756dd1e3c457b7cbd817599f5
2020-04-14 23:17:45 +00:00
|
|
|
* Make a cache key using the "global" keyspace for the given components
|
2019-07-08 19:12:16 +00:00
|
|
|
*
|
2020-12-28 22:34:29 +00:00
|
|
|
* Encoding is limited to the escaping of delimiter (":") and escape ("%") characters.
|
|
|
|
|
* Any backend-specific encoding should be delegated to methods that use the network.
|
|
|
|
|
*
|
|
|
|
|
* @param string $collection Key collection name component
|
|
|
|
|
* @param string|int ...$components Additional, ordered, key components for entity IDs
|
|
|
|
|
* @return string Colon-separated, keyspace-prepended, ordered list of encoded components
|
2019-07-08 19:12:16 +00:00
|
|
|
*/
|
2020-12-28 22:34:29 +00:00
|
|
|
public function makeGlobalKey( $collection, ...$components );
|
2019-07-08 19:12:16 +00:00
|
|
|
|
|
|
|
|
/**
|
objectcache: make BagOStuff key encoding more consistent
Add "generic" key methods for quickly deriving keys from
key component lists in a bijective manor. This is useful
for BagOStuff classes that wrap other BagOStuff instances
or for parsing keys to get stats.
Make the proxy BagOStuff classes (ReplicatedBagOStuff,
MultiWriteBagOStuff, CachedBagOStuff) use "generic" keys
so that they can convert to appropriate keys when making
backing cache instance method calls.
Make EmptyBagOStuff, HashBagOStuff, APCUBagOStuff,
RedisBagOStuff, and RESTBagOStuff use "generic" keys rather
than those of MediumSpecificBagOStuff::makeKeyInternal().
This lets proxy BagOStuff classes bypass key conversions
when used with instances of these classes as backing stores.
Also:
* Fix missing incr(), incrWithInit(), and decr() return
values in MultiWriteBagOStuff.
* Make MultiWriteBagOfStuff, ReplicatedBagOStuff, and
CachedBagOStuff use similar backend method forwarding
styles by using a new BagOStuff method.
* Improved various related bits of documentation.
Bug: T250239
Bug: T235705
Change-Id: I1eb897c2cea3f5b756dd1e3c457b7cbd817599f5
2020-04-14 23:17:45 +00:00
|
|
|
* Make a cache key using the default keyspace for the given components
|
2019-07-08 19:12:16 +00:00
|
|
|
*
|
2020-12-28 22:34:29 +00:00
|
|
|
* Encoding is limited to the escaping of delimiter (":") and escape ("%") characters.
|
|
|
|
|
* Any backend-specific encoding should be delegated to methods that use the network.
|
|
|
|
|
*
|
|
|
|
|
* @param string $collection Key collection name component
|
|
|
|
|
* @param string|int ...$components Additional, ordered, key components for entity IDs
|
|
|
|
|
* @return string Colon-separated, keyspace-prepended, ordered list of encoded components
|
2019-07-08 19:12:16 +00:00
|
|
|
*/
|
2020-12-28 22:34:29 +00:00
|
|
|
public function makeKey( $collection, ...$components );
|
2019-07-08 19:12:16 +00:00
|
|
|
}
|