Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3 * Generic interface providing error code and quality-of-service constants for object stores
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 * @ingroup Cache
22 */
23
24namespace Wikimedia\LightweightObjectStore;
25
26/**
27 * Generic interface providing error code and quality-of-service constants for object stores
28 *
29 * @ingroup Cache
30 * @since 1.35
31 */
32interface StorageAwareness {
33    /** No storage medium error */
34    public const ERR_NONE = 0;
35    /** Storage medium failed to yield a complete response to an operation */
36    public const ERR_NO_RESPONSE = 1;
37    /** Storage medium could not be reached to establish a connection */
38    public const ERR_UNREACHABLE = 2;
39    /** Storage medium operation failed due to usage limitations or an I/O error */
40    public const ERR_UNEXPECTED = 3;
41
42    /** @deprecated Since 1.41; Emulation/fallback mode; see QOS_EMULATION_*; higher is better */
43    public const ATTR_EMULATION = 1;
44    /** Durability of writes; see QOS_DURABILITY_* (higher means stronger) */
45    public const ATTR_DURABILITY = 2;
46
47    /** Data is never saved to begin with (blackhole store) */
48    public const QOS_DURABILITY_NONE = 1;
49    /** Data is lost at the end of the current web request or CLI script */
50    public const QOS_DURABILITY_SCRIPT = 2;
51    /** Data is lost once the service storing the data restarts */
52    public const QOS_DURABILITY_SERVICE = 3;
53    /** Data is saved to disk and writes do not usually block on fsync() */
54    public const QOS_DURABILITY_DISK = 4;
55    /** Data is saved to disk and writes usually block on fsync(), like a standard RDBMS */
56    public const QOS_DURABILITY_RDBMS = 5;
57
58    /** Generic "unknown" value; useful for comparisons (always "good enough") */
59    public const QOS_UNKNOWN = INF;
60}