This file is indexed.

/usr/share/doc/swift-doc/html/object.html is in swift-doc 2.17.0-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>

    <title>OpenStack Docs: Object</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Bootstrap CSS -->
<link href="_static/css/bootstrap.min.css" rel="stylesheet">

<!-- Pygments CSS -->
<link href="_static/css/native.css" rel="stylesheet">

<!-- Fonts -->
<link href="_static/css/font-awesome.min.css" rel="stylesheet">

<!-- Custom CSS -->
<link href="_static/css/combined.css" rel="stylesheet">
  

  </head>
  <body>

<!-- SOURCE_FILE: https://git.openstack.org/cgit/openstack/swift/tree/doc/source/object.rst -->

 <script type="text/javascript">
    (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
                (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
        e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
    })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

    _st('install','aDn5L_vgZ2yzRcE893kK','2.0.0');
</script>
<nav class="navbar navbar-default" role="navigation">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button class="navbar-toggle" data-target="#bs-example-navbar-collapse-1" data-toggle="collapse" type="button">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <div class="brand-wrapper">
        <a class="navbar-brand" href="index.html"></a>
      </div>
    </div>
  </div>
  <!-- /.container -->
</nav>
    <div class="container docs-book-wrapper">
      <div class="row">
        <div class="col-lg-9 col-md-8 col-sm-8 col-lg-push-3 col-md-push-4 col-sm-push-4">
<div class="row">
  <div class="col-lg-8">
      <h2>Object</h2>
    
  </div>
  <div class="docs-actions">
    
    <a href="db.html"><i class="fa fa-angle-double-left" data-toggle="tooltip" data-placement="top" title="Previous: Account DB and Container DB"></i></a>
    
    
    <a href="misc.html"><i class="fa fa-angle-double-right" data-toggle="tooltip" data-placement="top" title="Next: Misc"></i></a>
    
    <a id="logABugLink1" href="" target="_blank" title="Found an error? Report a bug against this page"><i class="fa fa-bug" data-toggle="tooltip" data-placement="top" title="Report a Bug"></i></a>
    
  </div>
</div>
          <div class="row docs-byline">
            <div class="docs-updated">updated: 2018-02-14 14:24</div>
          </div>
          <div class="row">
            <div class="col-lg-12">
              <div class="docs-body">

  <div class="section" id="object">
<span id="id1"></span><h1>Object<a class="headerlink" href="#object" title="Permalink to this headline"></a></h1>
<div class="section" id="module-swift.obj.auditor">
<span id="id2"></span><span id="object-auditor"></span><h2>Object Auditor<a class="headerlink" href="#module-swift.obj.auditor" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="swift.obj.auditor.AuditorWorker">
<em class="property">class </em><code class="descclassname">swift.obj.auditor.</code><code class="descname">AuditorWorker</code><span class="sig-paren">(</span><em>conf</em>, <em>logger</em>, <em>rcache</em>, <em>devices</em>, <em>zero_byte_only_at_fps=0</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.AuditorWorker" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Walk through file system to audit objects</p>
<dl class="method">
<dt id="swift.obj.auditor.AuditorWorker.audit_all_objects">
<code class="descname">audit_all_objects</code><span class="sig-paren">(</span><em>mode='once'</em>, <em>device_dirs=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.AuditorWorker.audit_all_objects" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.auditor.AuditorWorker.create_recon_nested_dict">
<code class="descname">create_recon_nested_dict</code><span class="sig-paren">(</span><em>top_level_key</em>, <em>device_list</em>, <em>item</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.AuditorWorker.create_recon_nested_dict" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.auditor.AuditorWorker.failsafe_object_audit">
<code class="descname">failsafe_object_audit</code><span class="sig-paren">(</span><em>location</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.AuditorWorker.failsafe_object_audit" title="Permalink to this definition"></a></dt>
<dd><p>Entrypoint to object_audit, with a failsafe generic exception handler.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.auditor.AuditorWorker.object_audit">
<code class="descname">object_audit</code><span class="sig-paren">(</span><em>location</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.AuditorWorker.object_audit" title="Permalink to this definition"></a></dt>
<dd><p>Audits the given object location.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>location</strong> – an audit location
(from diskfile.object_audit_location_generator)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.auditor.AuditorWorker.record_stats">
<code class="descname">record_stats</code><span class="sig-paren">(</span><em>obj_size</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.AuditorWorker.record_stats" title="Permalink to this definition"></a></dt>
<dd><p>Based on config’s object_size_stats will keep track of how many objects
fall into the specified ranges. For example with the following:</p>
<p>object_size_stats = 10, 100, 1024</p>
<p>and your system has 3 objects of sizes: 5, 20, and 10000 bytes the log
will look like: {“10”: 1, “100”: 1, “1024”: 0, “OVER”: 1}</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.auditor.ObjectAuditor">
<em class="property">class </em><code class="descclassname">swift.obj.auditor.</code><code class="descname">ObjectAuditor</code><span class="sig-paren">(</span><em>conf</em>, <em>logger=None</em>, <em>**options</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.ObjectAuditor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">swift.common.daemon.Daemon</span></code></p>
<p>Audit objects.</p>
<dl class="method">
<dt id="swift.obj.auditor.ObjectAuditor.audit_loop">
<code class="descname">audit_loop</code><span class="sig-paren">(</span><em>parent</em>, <em>zbo_fps</em>, <em>override_devices=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.ObjectAuditor.audit_loop" title="Permalink to this definition"></a></dt>
<dd><p>Parallel audit loop</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.auditor.ObjectAuditor.clear_recon_cache">
<code class="descname">clear_recon_cache</code><span class="sig-paren">(</span><em>auditor_type</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.ObjectAuditor.clear_recon_cache" title="Permalink to this definition"></a></dt>
<dd><p>Clear recon cache entries</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.auditor.ObjectAuditor.fork_child">
<code class="descname">fork_child</code><span class="sig-paren">(</span><em>zero_byte_fps=False</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.ObjectAuditor.fork_child" title="Permalink to this definition"></a></dt>
<dd><p>Child execution</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.auditor.ObjectAuditor.run_audit">
<code class="descname">run_audit</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.ObjectAuditor.run_audit" title="Permalink to this definition"></a></dt>
<dd><p>Run the object audit</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.auditor.ObjectAuditor.run_forever">
<code class="descname">run_forever</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.ObjectAuditor.run_forever" title="Permalink to this definition"></a></dt>
<dd><p>Run the object audit until stopped.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.auditor.ObjectAuditor.run_once">
<code class="descname">run_once</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.auditor.ObjectAuditor.run_once" title="Permalink to this definition"></a></dt>
<dd><p>Run the object audit once</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-swift.obj.diskfile">
<span id="object-backend"></span><span id="object-diskfile"></span><h2>Object Backend<a class="headerlink" href="#module-swift.obj.diskfile" title="Permalink to this headline"></a></h2>
<p>Disk File Interface for the Swift Object Server</p>
<p>The <cite>DiskFile</cite>, <cite>DiskFileWriter</cite> and <cite>DiskFileReader</cite> classes combined define
the on-disk abstraction layer for supporting the object server REST API
interfaces (excluding <cite>REPLICATE</cite>). Other implementations wishing to provide
an alternative backend for the object server must implement the three
classes. An example alternative implementation can be found in the
<cite>mem_server.py</cite> and <cite>mem_diskfile.py</cite> modules along size this one.</p>
<p>The <cite>DiskFileManager</cite> is a reference implemenation specific class and is not
part of the backend API.</p>
<p>The remaining methods in this module are considered implementation specific and
are also not considered part of the backend API.</p>
<dl class="class">
<dt id="swift.obj.diskfile.AuditLocation">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">AuditLocation</code><span class="sig-paren">(</span><em>path</em>, <em>device</em>, <em>partition</em>, <em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.AuditLocation" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Represents an object location to be audited.</p>
<p>Other than being a bucket of data, the only useful thing this does is
stringify to a filesystem path so the auditor’s logs look okay.</p>
</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.BaseDiskFile">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">BaseDiskFile</code><span class="sig-paren">(</span><em>mgr</em>, <em>device_path</em>, <em>partition</em>, <em>account=None</em>, <em>container=None</em>, <em>obj=None</em>, <em>_datadir=None</em>, <em>policy=None</em>, <em>use_splice=False</em>, <em>pipe_size=None</em>, <em>use_linkat=False</em>, <em>open_expired=False</em>, <em>next_part_power=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Manage object files.</p>
<p>This specific implementation manages object files on a disk formatted with
a POSIX-compliant file system that supports extended attributes as
metadata on a file or directory.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>The arguments to the constructor are considered implementation
specific. The API does not define the constructor arguments.</p>
<p class="last">The following path format is used for data file locations:
&lt;devices_path/&lt;device_dir&gt;/&lt;datadir&gt;/&lt;partdir&gt;/&lt;suffixdir&gt;/&lt;hashdir&gt;/
&lt;datafile&gt;.&lt;ext&gt;</p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>mgr</strong> – associated DiskFileManager instance</li>
<li><strong>device_path</strong> – path to the target device or drive</li>
<li><strong>partition</strong> – partition on the device in which the object lives</li>
<li><strong>account</strong> – account name for the object</li>
<li><strong>container</strong> – container name for the object</li>
<li><strong>obj</strong> – object name for the object</li>
<li><strong>_datadir</strong> – override the full datadir otherwise constructed here</li>
<li><strong>policy</strong> – the StoragePolicy instance</li>
<li><strong>use_splice</strong> – if true, use zero-copy splice() to send data</li>
<li><strong>pipe_size</strong> – size of pipe buffer used in zero-copy operations</li>
<li><strong>use_linkat</strong> – if True, use open() with linkat() to create obj file</li>
<li><strong>open_expired</strong> – if True, open() will not raise a DiskFileExpired if
object is expired</li>
<li><strong>next_part_power</strong> – the next partition power to be used</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.account">
<code class="descname">account</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.account" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.container">
<code class="descname">container</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.container" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.content_length">
<code class="descname">content_length</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.content_length" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.content_type">
<code class="descname">content_type</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.content_type" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.content_type_timestamp">
<code class="descname">content_type_timestamp</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.content_type_timestamp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFile.create">
<code class="descname">create</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.create" title="Permalink to this definition"></a></dt>
<dd><p>Context manager to create a file. We create a temporary file first, and
then return a DiskFileWriter object to encapsulate the state.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">An implementation is not required to perform on-disk
preallocations even if the parameter is specified. But if it does
and it fails, it must raise a <cite>DiskFileNoSpace</cite> exception.</p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>size</strong> – optional initial size of file to explicitly allocate on
disk</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileNoSpace" title="swift.common.exceptions.DiskFileNoSpace"><strong>DiskFileNoSpace</strong></a> – if a size is specified and allocation fails</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.data_timestamp">
<code class="descname">data_timestamp</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.data_timestamp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFile.delete">
<code class="descname">delete</code><span class="sig-paren">(</span><em>timestamp</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.delete" title="Permalink to this definition"></a></dt>
<dd><p>Delete the object.</p>
<p>This implementation creates a tombstone file using the given
timestamp, and removes any older versions of the object file. Any
file that has an older timestamp than timestamp will be deleted.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">An implementation is free to use or ignore the timestamp
parameter.</p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>timestamp</strong> – timestamp to compare with each file</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileError" title="swift.common.exceptions.DiskFileError"><strong>DiskFileError</strong></a> – this implementation will raise the same
errors as the <cite>create()</cite> method.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.durable_timestamp">
<code class="descname">durable_timestamp</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.durable_timestamp" title="Permalink to this definition"></a></dt>
<dd><p>Provides the timestamp of the newest data file found in the object
directory.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A Timestamp instance, or None if no data file was found.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileNotOpen" title="swift.common.exceptions.DiskFileNotOpen"><strong>DiskFileNotOpen</strong></a> – if the open() method has not been previously
called on this instance.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.fragments">
<code class="descname">fragments</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.fragments" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="swift.obj.diskfile.BaseDiskFile.from_hash_dir">
<em class="property">classmethod </em><code class="descname">from_hash_dir</code><span class="sig-paren">(</span><em>mgr</em>, <em>hash_dir_path</em>, <em>device_path</em>, <em>partition</em>, <em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.from_hash_dir" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFile.get_datafile_metadata">
<code class="descname">get_datafile_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.get_datafile_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Provide the datafile metadata for a previously opened object as a
dictionary. This is metadata that was included when the object was
first PUT, and does not include metadata set by any subsequent POST.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">object’s datafile metadata dictionary</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileNotOpen" title="swift.common.exceptions.DiskFileNotOpen"><strong>DiskFileNotOpen</strong></a> – if the
<code class="xref py py-func docutils literal"><span class="pre">swift.obj.diskfile.DiskFile.open()</span></code> method was not previously
invoked</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFile.get_metadata">
<code class="descname">get_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.get_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Provide the metadata for a previously opened object as a dictionary.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">object’s metadata dictionary</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileNotOpen" title="swift.common.exceptions.DiskFileNotOpen"><strong>DiskFileNotOpen</strong></a> – if the
<code class="xref py py-func docutils literal"><span class="pre">swift.obj.diskfile.DiskFile.open()</span></code> method was not previously
invoked</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFile.get_metafile_metadata">
<code class="descname">get_metafile_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.get_metafile_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Provide the metafile metadata for a previously opened object as a
dictionary. This is metadata that was written by a POST and does not
include any persistent metadata that was set by the original PUT.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">object’s .meta file metadata dictionary, or None if there is
no .meta file</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileNotOpen" title="swift.common.exceptions.DiskFileNotOpen"><strong>DiskFileNotOpen</strong></a> – if the
<code class="xref py py-func docutils literal"><span class="pre">swift.obj.diskfile.DiskFile.open()</span></code> method was not previously
invoked</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.manager">
<code class="descname">manager</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.manager" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.obj">
<code class="descname">obj</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.obj" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFile.open">
<code class="descname">open</code><span class="sig-paren">(</span><em>modernize=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.open" title="Permalink to this definition"></a></dt>
<dd><p>Open the object.</p>
<p>This implementation opens the data file representing the object, reads
the associated metadata in the extended attributes, additionally
combining metadata from fast-POST <cite>.meta</cite> files.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>modernize</strong> – if set, update this diskfile to the latest format.
Currently, this means adding metadata checksums if none are
present.</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">An implementation is allowed to raise any of the following
exceptions, but is only required to raise <cite>DiskFileNotExist</cite> when
the object representation does not exist.</p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first simple">
<li><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileCollision" title="swift.common.exceptions.DiskFileCollision"><strong>DiskFileCollision</strong></a> – on name mis-match with metadata</li>
<li><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileNotExist" title="swift.common.exceptions.DiskFileNotExist"><strong>DiskFileNotExist</strong></a> – if the object does not exist</li>
<li><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileDeleted" title="swift.common.exceptions.DiskFileDeleted"><strong>DiskFileDeleted</strong></a> – if the object was previously deleted</li>
<li><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileQuarantined" title="swift.common.exceptions.DiskFileQuarantined"><strong>DiskFileQuarantined</strong></a> – if while reading metadata of the file
some data did pass cross checks</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">itself for use as a context manager</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFile.read_metadata">
<code class="descname">read_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.read_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Return the metadata for an object without requiring the caller to open
the object first.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">metadata dictionary for an object</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileError" title="swift.common.exceptions.DiskFileError"><strong>DiskFileError</strong></a> – this implementation will raise the same
errors as the <cite>open()</cite> method.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFile.reader">
<code class="descname">reader</code><span class="sig-paren">(</span><em>keep_cache=False</em>, <em>_quarantine_hook=&lt;function &lt;lambda&gt;&gt;</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.reader" title="Permalink to this definition"></a></dt>
<dd><p>Return a <a class="reference internal" href="misc.html#swift.common.swob.Response" title="swift.common.swob.Response"><code class="xref py py-class docutils literal"><span class="pre">swift.common.swob.Response</span></code></a> class compatible
“<cite>app_iter</cite>” object as defined by
<a class="reference internal" href="#swift.obj.diskfile.DiskFileReader" title="swift.obj.diskfile.DiskFileReader"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.DiskFileReader</span></code></a>.</p>
<p>For this implementation, the responsibility of closing the open file
is passed to the <a class="reference internal" href="#swift.obj.diskfile.DiskFileReader" title="swift.obj.diskfile.DiskFileReader"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.DiskFileReader</span></code></a> object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>keep_cache</strong> – caller’s preference for keeping data read in the
OS buffer cache</li>
<li><strong>_quarantine_hook</strong> – 1-arg callable called when obj quarantined;
the arg is the reason for quarantine.
Default is to ignore it.
Not needed by the REST layer.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a <a class="reference internal" href="#swift.obj.diskfile.DiskFileReader" title="swift.obj.diskfile.DiskFileReader"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.DiskFileReader</span></code></a> object</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.reader_cls">
<code class="descname">reader_cls</code><em class="property"> = None</em><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.reader_cls" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.timestamp">
<code class="descname">timestamp</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.timestamp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFile.write_metadata">
<code class="descname">write_metadata</code><span class="sig-paren">(</span><em>metadata</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.write_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Write a block of metadata to an object without requiring the caller to
create the object first. Supports fast-POST behavior semantics.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>metadata</strong> – dictionary of metadata to be associated with the
object</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileError" title="swift.common.exceptions.DiskFileError"><strong>DiskFileError</strong></a> – this implementation will raise the same
errors as the <cite>create()</cite> method.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFile.writer_cls">
<code class="descname">writer_cls</code><em class="property"> = None</em><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFile.writer_cls" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.BaseDiskFileManager">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">BaseDiskFileManager</code><span class="sig-paren">(</span><em>conf</em>, <em>logger</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Management class for devices, providing common place for shared parameters
and methods not provided by the DiskFile class (which primarily services
the object server REST API layer).</p>
<p>The <cite>get_diskfile()</cite> method is how this implementation creates a <cite>DiskFile</cite>
object.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This class is reference implementation specific and not part of the
pluggable on-disk backend API.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">TODO(portante): Not sure what the right name to recommend here, as
“manager” seemed generic enough, though suggestions are welcome.</p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>conf</strong> – caller provided configuration object</li>
<li><strong>logger</strong> – caller provided logger</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.cleanup_ondisk_files">
<code class="descname">cleanup_ondisk_files</code><span class="sig-paren">(</span><em>hsh_path</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.cleanup_ondisk_files" title="Permalink to this definition"></a></dt>
<dd><p>Clean up on-disk files that are obsolete and gather the set of valid
on-disk files for an object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>hsh_path</strong> – object hash path</li>
<li><strong>frag_index</strong> – if set, search for a specific fragment index .data
file, otherwise accept the first valid .data file</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a dict that may contain: valid on disk files keyed by their
filename extension; a list of obsolete files stored under the
key ‘obsolete’; a list of files remaining in the directory,
reverse sorted, stored under the key ‘files’.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.consolidate_hashes">
<code class="descname">consolidate_hashes</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.consolidate_hashes" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.construct_dev_path">
<code class="descname">construct_dev_path</code><span class="sig-paren">(</span><em>device</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.construct_dev_path" title="Permalink to this definition"></a></dt>
<dd><p>Construct the path to a device without checking if it is mounted.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>device</strong> – name of target device</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">full path to the device</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFileManager.diskfile_cls">
<code class="descname">diskfile_cls</code><em class="property"> = None</em><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.diskfile_cls" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.get_dev_path">
<code class="descname">get_dev_path</code><span class="sig-paren">(</span><em>device</em>, <em>mount_check=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.get_dev_path" title="Permalink to this definition"></a></dt>
<dd><p>Return the path to a device, first checking to see if either it
is a proper mount point, or at least a directory depending on
the mount_check configuration option.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>device</strong> – name of target device</li>
<li><strong>mount_check</strong> – whether or not to check mountedness of device.
Defaults to bool(self.mount_check).</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">full path to the device, None if the path to the device is
not a proper mount point or directory.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.get_diskfile">
<code class="descname">get_diskfile</code><span class="sig-paren">(</span><em>device</em>, <em>partition</em>, <em>account</em>, <em>container</em>, <em>obj</em>, <em>policy</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.get_diskfile" title="Permalink to this definition"></a></dt>
<dd><p>Returns a BaseDiskFile instance for an object based on the object’s
partition, path parts and policy.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>device</strong> – name of target device</li>
<li><strong>partition</strong> – partition on device in which the object lives</li>
<li><strong>account</strong> – account name for the object</li>
<li><strong>container</strong> – container name for the object</li>
<li><strong>obj</strong> – object name for the object</li>
<li><strong>policy</strong> – the StoragePolicy instance</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.get_diskfile_from_audit_location">
<code class="descname">get_diskfile_from_audit_location</code><span class="sig-paren">(</span><em>audit_location</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.get_diskfile_from_audit_location" title="Permalink to this definition"></a></dt>
<dd><p>Returns a BaseDiskFile instance for an object at the given
AuditLocation.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>audit_location</strong> – object location to be audited</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.get_diskfile_from_hash">
<code class="descname">get_diskfile_from_hash</code><span class="sig-paren">(</span><em>device</em>, <em>partition</em>, <em>object_hash</em>, <em>policy</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.get_diskfile_from_hash" title="Permalink to this definition"></a></dt>
<dd><p>Returns a DiskFile instance for an object at the given
object_hash. Just in case someone thinks of refactoring, be
sure DiskFileDeleted is <em>not</em> raised, but the DiskFile
instance representing the tombstoned object is returned
instead.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>device</strong> – name of target device</li>
<li><strong>partition</strong> – partition on the device in which the object lives</li>
<li><strong>object_hash</strong> – the hash of an object path</li>
<li><strong>policy</strong> – the StoragePolicy instance</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileNotExist" title="swift.common.exceptions.DiskFileNotExist"><strong>DiskFileNotExist</strong></a> – if the object does not exist</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">an instance of BaseDiskFile</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.get_hashes">
<code class="descname">get_hashes</code><span class="sig-paren">(</span><em>device</em>, <em>partition</em>, <em>suffixes</em>, <em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.get_hashes" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>device</strong> – name of target device</li>
<li><strong>partition</strong> – partition name</li>
<li><strong>suffixes</strong> – a list of suffix directories to be recalculated</li>
<li><strong>policy</strong> – the StoragePolicy instance</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a dictionary that maps suffix directories</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.get_ondisk_files">
<code class="descname">get_ondisk_files</code><span class="sig-paren">(</span><em>files</em>, <em>datadir</em>, <em>verify=True</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.get_ondisk_files" title="Permalink to this definition"></a></dt>
<dd><p>Given a simple list of files names, determine the files that constitute
a valid fileset i.e. a set of files that defines the state of an
object, and determine the files that are obsolete and could be deleted.
Note that some files may fall into neither category.</p>
<p>If a file is considered part of a valid fileset then its info dict will
be added to the results dict, keyed by &lt;extension&gt;_info. Any files that
are no longer required will have their info dicts added to a list
stored under the key ‘obsolete’.</p>
<p>The results dict will always contain entries with keys ‘ts_file’,
‘data_file’ and ‘meta_file’. Their values will be the fully qualified
path to a file of the corresponding type if there is such a file in the
valid fileset, or None.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>files</strong> – a list of file names.</li>
<li><strong>datadir</strong> – directory name files are from.</li>
<li><strong>verify</strong> – if True verify that the ondisk file contract has not
been violated, otherwise do not verify.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
<dt>a dict that will contain keys:</dt>
<dd><p class="first last">ts_file   -&gt; path to a .ts file or None
data_file -&gt; path to a .data file or None
meta_file -&gt; path to a .meta file or None
ctype_file -&gt; path to a .meta file or None</p>
</dd>
<dt>and may contain keys:</dt>
<dd><p class="first last">ts_info   -&gt; a file info dict for a .ts file
data_info -&gt; a file info dict for a .data file
meta_info -&gt; a file info dict for a .meta file
ctype_info -&gt; a file info dict for a .meta file which
contains the content-type value
unexpected -&gt; a list of file paths for unexpected
files
possible_reclaim -&gt; a list of file info dicts for possible
reclaimable files
obsolete  -&gt; a list of file info dicts for obsolete files</p>
</dd>
</dl>
</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.invalidate_hash">
<code class="descname">invalidate_hash</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.invalidate_hash" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.make_on_disk_filename">
<code class="descname">make_on_disk_filename</code><span class="sig-paren">(</span><em>timestamp</em>, <em>ext=None</em>, <em>ctype_timestamp=None</em>, <em>*a</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.make_on_disk_filename" title="Permalink to this definition"></a></dt>
<dd><p>Returns filename for given timestamp.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>timestamp</strong> – the object timestamp, an instance of
<a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a></li>
<li><strong>ext</strong> – an optional string representing a file extension to be
appended to the returned file name</li>
<li><strong>ctype_timestamp</strong> – an optional content-type timestamp, an instance
of <a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a></li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a file name</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.object_audit_location_generator">
<code class="descname">object_audit_location_generator</code><span class="sig-paren">(</span><em>device_dirs=None</em>, <em>auditor_type='ALL'</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.object_audit_location_generator" title="Permalink to this definition"></a></dt>
<dd><p>Yield an AuditLocation for all objects stored under device_dirs.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>device_dirs</strong> – directory of target device</li>
<li><strong>auditor_type</strong> – either ALL or ZBF</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.parse_on_disk_filename">
<code class="descname">parse_on_disk_filename</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.parse_on_disk_filename" title="Permalink to this definition"></a></dt>
<dd><p>Parse an on disk file name.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> – the file name including extension</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a dict, with keys for timestamp, ext and ctype_timestamp:<ul class="simple">
<li>timestamp is a <a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a></li>
<li>ctype_timestamp is a <a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a> or
None for .meta files, otherwise None</li>
<li>ext is a string, the file extension including the leading dot or
the empty string if the filename has no extension.</li>
</ul>
<p>Subclasses may override this method to add further keys to the
returned dict.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileError" title="swift.common.exceptions.DiskFileError"><strong>DiskFileError</strong></a> – if any part of the filename is not able to be
validated.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.pickle_async_update">
<code class="descname">pickle_async_update</code><span class="sig-paren">(</span><em>device</em>, <em>account</em>, <em>container</em>, <em>obj</em>, <em>data</em>, <em>timestamp</em>, <em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.pickle_async_update" title="Permalink to this definition"></a></dt>
<dd><p>Write data describing a container update notification to a pickle file
in the async_pending directory.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>device</strong> – name of target device</li>
<li><strong>account</strong> – account name for the object</li>
<li><strong>container</strong> – container name for the object</li>
<li><strong>obj</strong> – object name for the object</li>
<li><strong>data</strong> – update data to be written to pickle file</li>
<li><strong>timestamp</strong> – a Timestamp</li>
<li><strong>policy</strong> – the StoragePolicy instance</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.quarantine_renamer">
<code class="descname">quarantine_renamer</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.quarantine_renamer" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.replication_lock">
<code class="descname">replication_lock</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.replication_lock" title="Permalink to this definition"></a></dt>
<dd><p>A context manager that will lock on the device given, if
configured to do so.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>device</strong> – name of target device</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.ReplicationLockTimeout" title="swift.common.exceptions.ReplicationLockTimeout"><strong>ReplicationLockTimeout</strong></a> – If the lock on the device
cannot be granted within the configured timeout.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.yield_hashes">
<code class="descname">yield_hashes</code><span class="sig-paren">(</span><em>device</em>, <em>partition</em>, <em>policy</em>, <em>suffixes=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.yield_hashes" title="Permalink to this definition"></a></dt>
<dd><p>Yields tuples of (hash_only, timestamps) for object
information stored for the given device, partition, and
(optionally) suffixes. If suffixes is None, all stored
suffixes will be searched for object hashes. Note that if
suffixes is not None but empty, such as [], then nothing will
be yielded.</p>
<p>timestamps is a dict which may contain items mapping:</p>
<ul class="simple">
<li>ts_data -&gt; timestamp of data or tombstone file,</li>
<li>ts_meta -&gt; timestamp of meta file, if one exists</li>
<li><dl class="first docutils">
<dt>ts_ctype -&gt; timestamp of meta file containing most recent</dt>
<dd>content-type value, if one exists</dd>
</dl>
</li>
</ul>
<p>where timestamps are instances of
<a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>device</strong> – name of target device</li>
<li><strong>partition</strong> – partition name</li>
<li><strong>policy</strong> – the StoragePolicy instance</li>
<li><strong>suffixes</strong> – optional list of suffix directories to be searched</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileManager.yield_suffixes">
<code class="descname">yield_suffixes</code><span class="sig-paren">(</span><em>device</em>, <em>partition</em>, <em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileManager.yield_suffixes" title="Permalink to this definition"></a></dt>
<dd><p>Yields tuples of (full_path, suffix_only) for suffixes stored
on the given device and partition.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>device</strong> – name of target device</li>
<li><strong>partition</strong> – partition name</li>
<li><strong>policy</strong> – the StoragePolicy instance</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.BaseDiskFileReader">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">BaseDiskFileReader</code><span class="sig-paren">(</span><em>fp</em>, <em>data_file</em>, <em>obj_size</em>, <em>etag</em>, <em>disk_chunk_size</em>, <em>keep_cache_size</em>, <em>device_path</em>, <em>logger</em>, <em>quarantine_hook</em>, <em>use_splice</em>, <em>pipe_size</em>, <em>diskfile</em>, <em>keep_cache=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileReader" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Encapsulation of the WSGI read context for servicing GET REST API
requests. Serves as the context manager object for the
<a class="reference internal" href="#swift.obj.diskfile.DiskFile" title="swift.obj.diskfile.DiskFile"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.DiskFile</span></code></a> class’s
<code class="xref py py-func docutils literal"><span class="pre">swift.obj.diskfile.DiskFile.reader()</span></code> method.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The quarantining behavior of this method is considered implementation
specific, and is not required of the API.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The arguments to the constructor are considered implementation
specific. The API does not define the constructor arguments.</p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>fp</strong> – open file object pointer reference</li>
<li><strong>data_file</strong> – on-disk data file name for the object</li>
<li><strong>obj_size</strong> – verified on-disk size of the object</li>
<li><strong>etag</strong> – expected metadata etag value for entire file</li>
<li><strong>disk_chunk_size</strong> – size of reads from disk in bytes</li>
<li><strong>keep_cache_size</strong> – maximum object size that will be kept in cache</li>
<li><strong>device_path</strong> – on-disk device path, used when quarantining an obj</li>
<li><strong>logger</strong> – logger caller wants this object to use</li>
<li><strong>quarantine_hook</strong> – 1-arg callable called w/reason when quarantined</li>
<li><strong>use_splice</strong> – if true, use zero-copy splice() to send data</li>
<li><strong>pipe_size</strong> – size of pipe buffer used in zero-copy operations</li>
<li><strong>diskfile</strong> – the diskfile creating this DiskFileReader instance</li>
<li><strong>keep_cache</strong> – should resulting reads be kept in the buffer cache</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileReader.app_iter_range">
<code class="descname">app_iter_range</code><span class="sig-paren">(</span><em>start</em>, <em>stop</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileReader.app_iter_range" title="Permalink to this definition"></a></dt>
<dd><p>Returns an iterator over the data file for range (start, stop)</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileReader.app_iter_ranges">
<code class="descname">app_iter_ranges</code><span class="sig-paren">(</span><em>ranges</em>, <em>content_type</em>, <em>boundary</em>, <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileReader.app_iter_ranges" title="Permalink to this definition"></a></dt>
<dd><p>Returns an iterator over the data file for a set of ranges</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileReader.can_zero_copy_send">
<code class="descname">can_zero_copy_send</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileReader.can_zero_copy_send" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileReader.close">
<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileReader.close" title="Permalink to this definition"></a></dt>
<dd><p>Close the open file handle if present.</p>
<p>For this specific implementation, this method will handle quarantining
the file if necessary.</p>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFileReader.manager">
<code class="descname">manager</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileReader.manager" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileReader.zero_copy_send">
<code class="descname">zero_copy_send</code><span class="sig-paren">(</span><em>wsockfd</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileReader.zero_copy_send" title="Permalink to this definition"></a></dt>
<dd><p>Does some magic with splice() and tee() to move stuff from disk to
network without ever touching userspace.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>wsockfd</strong> – file descriptor (integer) of the socket out which to
send data</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.BaseDiskFileWriter">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">BaseDiskFileWriter</code><span class="sig-paren">(</span><em>name</em>, <em>datadir</em>, <em>fd</em>, <em>tmppath</em>, <em>bytes_per_sync</em>, <em>diskfile</em>, <em>next_part_power</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileWriter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Encapsulation of the write context for servicing PUT REST API
requests. Serves as the context manager object for the
<a class="reference internal" href="#swift.obj.diskfile.DiskFile" title="swift.obj.diskfile.DiskFile"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.DiskFile</span></code></a> class’s
<code class="xref py py-func docutils literal"><span class="pre">swift.obj.diskfile.DiskFile.create()</span></code> method.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">It is the responsibility of the
<code class="xref py py-func docutils literal"><span class="pre">swift.obj.diskfile.DiskFile.create()</span></code> method context manager to
close the open file descriptor.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The arguments to the constructor are considered implementation
specific. The API does not define the constructor arguments.</p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> – name of object from REST API</li>
<li><strong>datadir</strong> – on-disk directory object will end up in on
<a class="reference internal" href="#swift.obj.diskfile.DiskFileWriter.put" title="swift.obj.diskfile.DiskFileWriter.put"><code class="xref py py-func docutils literal"><span class="pre">swift.obj.diskfile.DiskFileWriter.put()</span></code></a></li>
<li><strong>fd</strong> – open file descriptor of temporary file to receive data</li>
<li><strong>tmppath</strong> – full path name of the opened file descriptor</li>
<li><strong>bytes_per_sync</strong> – number bytes written between sync calls</li>
<li><strong>diskfile</strong> – the diskfile creating this DiskFileWriter instance</li>
<li><strong>next_part_power</strong> – the next partition power to be used</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileWriter.commit">
<code class="descname">commit</code><span class="sig-paren">(</span><em>timestamp</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileWriter.commit" title="Permalink to this definition"></a></dt>
<dd><p>Perform any operations necessary to mark the object as durable. For
replication policy type this is a no-op.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>timestamp</strong> – object put timestamp, an instance of
<a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFileWriter.manager">
<code class="descname">manager</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileWriter.manager" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileWriter.put">
<code class="descname">put</code><span class="sig-paren">(</span><em>metadata</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileWriter.put" title="Permalink to this definition"></a></dt>
<dd><p>Finalize writing the file on disk.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>metadata</strong> – dictionary of metadata to be associated with the
object</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.BaseDiskFileWriter.put_succeeded">
<code class="descname">put_succeeded</code><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileWriter.put_succeeded" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.BaseDiskFileWriter.write">
<code class="descname">write</code><span class="sig-paren">(</span><em>chunk</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.BaseDiskFileWriter.write" title="Permalink to this definition"></a></dt>
<dd><p>Write a chunk of data to disk. All invocations of this method must
come before invoking the :func:</p>
<p>For this implementation, the data is written into a temporary file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>chunk</strong> – the chunk of data to write as a string object</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">the total number of bytes written to an object</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.DiskFile">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">DiskFile</code><span class="sig-paren">(</span><em>mgr</em>, <em>device_path</em>, <em>partition</em>, <em>account=None</em>, <em>container=None</em>, <em>obj=None</em>, <em>_datadir=None</em>, <em>policy=None</em>, <em>use_splice=False</em>, <em>pipe_size=None</em>, <em>use_linkat=False</em>, <em>open_expired=False</em>, <em>next_part_power=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.DiskFile" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#swift.obj.diskfile.BaseDiskFile" title="swift.obj.diskfile.BaseDiskFile"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.BaseDiskFile</span></code></a></p>
<dl class="attribute">
<dt id="swift.obj.diskfile.DiskFile.reader_cls">
<code class="descname">reader_cls</code><a class="headerlink" href="#swift.obj.diskfile.DiskFile.reader_cls" title="Permalink to this definition"></a></dt>
<dd><p>alias of <a class="reference internal" href="#swift.obj.diskfile.DiskFileReader" title="swift.obj.diskfile.DiskFileReader"><code class="xref py py-class docutils literal"><span class="pre">DiskFileReader</span></code></a></p>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.DiskFile.writer_cls">
<code class="descname">writer_cls</code><a class="headerlink" href="#swift.obj.diskfile.DiskFile.writer_cls" title="Permalink to this definition"></a></dt>
<dd><p>alias of <a class="reference internal" href="#swift.obj.diskfile.DiskFileWriter" title="swift.obj.diskfile.DiskFileWriter"><code class="xref py py-class docutils literal"><span class="pre">DiskFileWriter</span></code></a></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.DiskFileManager">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">DiskFileManager</code><span class="sig-paren">(</span><em>conf</em>, <em>logger</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.DiskFileManager" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#swift.obj.diskfile.BaseDiskFileManager" title="swift.obj.diskfile.BaseDiskFileManager"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.BaseDiskFileManager</span></code></a></p>
<dl class="attribute">
<dt id="swift.obj.diskfile.DiskFileManager.diskfile_cls">
<code class="descname">diskfile_cls</code><a class="headerlink" href="#swift.obj.diskfile.DiskFileManager.diskfile_cls" title="Permalink to this definition"></a></dt>
<dd><p>alias of <a class="reference internal" href="#swift.obj.diskfile.DiskFile" title="swift.obj.diskfile.DiskFile"><code class="xref py py-class docutils literal"><span class="pre">DiskFile</span></code></a></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.DiskFileReader">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">DiskFileReader</code><span class="sig-paren">(</span><em>fp</em>, <em>data_file</em>, <em>obj_size</em>, <em>etag</em>, <em>disk_chunk_size</em>, <em>keep_cache_size</em>, <em>device_path</em>, <em>logger</em>, <em>quarantine_hook</em>, <em>use_splice</em>, <em>pipe_size</em>, <em>diskfile</em>, <em>keep_cache=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.DiskFileReader" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#swift.obj.diskfile.BaseDiskFileReader" title="swift.obj.diskfile.BaseDiskFileReader"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.BaseDiskFileReader</span></code></a></p>
</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.DiskFileRouter">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">DiskFileRouter</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.DiskFileRouter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<dl class="attribute">
<dt id="swift.obj.diskfile.DiskFileRouter.policy_type_to_manager_cls">
<code class="descname">policy_type_to_manager_cls</code><em class="property"> = {'erasure_coding': &lt;class 'swift.obj.diskfile.ECDiskFileManager'&gt;, 'replication': &lt;class 'swift.obj.diskfile.DiskFileManager'&gt;}</em><a class="headerlink" href="#swift.obj.diskfile.DiskFileRouter.policy_type_to_manager_cls" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="swift.obj.diskfile.DiskFileRouter.register">
<em class="property">classmethod </em><code class="descname">register</code><span class="sig-paren">(</span><em>policy_type</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.DiskFileRouter.register" title="Permalink to this definition"></a></dt>
<dd><p>Decorator for Storage Policy implementations to register
their DiskFile implementation.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.DiskFileWriter">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">DiskFileWriter</code><span class="sig-paren">(</span><em>name</em>, <em>datadir</em>, <em>fd</em>, <em>tmppath</em>, <em>bytes_per_sync</em>, <em>diskfile</em>, <em>next_part_power</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.DiskFileWriter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#swift.obj.diskfile.BaseDiskFileWriter" title="swift.obj.diskfile.BaseDiskFileWriter"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.BaseDiskFileWriter</span></code></a></p>
<dl class="method">
<dt id="swift.obj.diskfile.DiskFileWriter.put">
<code class="descname">put</code><span class="sig-paren">(</span><em>metadata</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.DiskFileWriter.put" title="Permalink to this definition"></a></dt>
<dd><p>Finalize writing the file on disk.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>metadata</strong> – dictionary of metadata to be associated with the
object</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.ECDiskFile">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">ECDiskFile</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.ECDiskFile" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#swift.obj.diskfile.BaseDiskFile" title="swift.obj.diskfile.BaseDiskFile"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.BaseDiskFile</span></code></a></p>
<dl class="attribute">
<dt id="swift.obj.diskfile.ECDiskFile.durable_timestamp">
<code class="descname">durable_timestamp</code><a class="headerlink" href="#swift.obj.diskfile.ECDiskFile.durable_timestamp" title="Permalink to this definition"></a></dt>
<dd><p>Provides the timestamp of the newest durable file found in the object
directory.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A Timestamp instance, or None if no durable file was found.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileNotOpen" title="swift.common.exceptions.DiskFileNotOpen"><strong>DiskFileNotOpen</strong></a> – if the open() method has not been previously
called on this instance.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.ECDiskFile.fragments">
<code class="descname">fragments</code><a class="headerlink" href="#swift.obj.diskfile.ECDiskFile.fragments" title="Permalink to this definition"></a></dt>
<dd><p>Provides information about all fragments that were found in the object
directory, including fragments without a matching durable file, and
including any fragment chosen to construct the opened diskfile.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A dict mapping &lt;Timestamp instance&gt; -&gt; &lt;list of frag indexes&gt;,
or None if the diskfile has not been opened or no fragments
were found.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.ECDiskFile.purge">
<code class="descname">purge</code><span class="sig-paren">(</span><em>timestamp</em>, <em>frag_index</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.ECDiskFile.purge" title="Permalink to this definition"></a></dt>
<dd><p>Remove a tombstone file matching the specified timestamp or
datafile matching the specified timestamp and fragment index
from the object directory.</p>
<p>This provides the EC reconstructor/ssync process with a way to
remove a tombstone or fragment from a handoff node after
reverting it to its primary node.</p>
<p>The hash will be invalidated, and if empty or invalid the
hsh_path will be removed on next cleanup_ondisk_files.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>timestamp</strong> – the object timestamp, an instance of
<a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a></li>
<li><strong>frag_index</strong> – fragment archive index, must be
a whole number or None.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.ECDiskFile.reader_cls">
<code class="descname">reader_cls</code><a class="headerlink" href="#swift.obj.diskfile.ECDiskFile.reader_cls" title="Permalink to this definition"></a></dt>
<dd><p>alias of <a class="reference internal" href="#swift.obj.diskfile.ECDiskFileReader" title="swift.obj.diskfile.ECDiskFileReader"><code class="xref py py-class docutils literal"><span class="pre">ECDiskFileReader</span></code></a></p>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.diskfile.ECDiskFile.writer_cls">
<code class="descname">writer_cls</code><a class="headerlink" href="#swift.obj.diskfile.ECDiskFile.writer_cls" title="Permalink to this definition"></a></dt>
<dd><p>alias of <a class="reference internal" href="#swift.obj.diskfile.ECDiskFileWriter" title="swift.obj.diskfile.ECDiskFileWriter"><code class="xref py py-class docutils literal"><span class="pre">ECDiskFileWriter</span></code></a></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.ECDiskFileManager">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">ECDiskFileManager</code><span class="sig-paren">(</span><em>conf</em>, <em>logger</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.ECDiskFileManager" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#swift.obj.diskfile.BaseDiskFileManager" title="swift.obj.diskfile.BaseDiskFileManager"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.BaseDiskFileManager</span></code></a></p>
<dl class="attribute">
<dt id="swift.obj.diskfile.ECDiskFileManager.diskfile_cls">
<code class="descname">diskfile_cls</code><a class="headerlink" href="#swift.obj.diskfile.ECDiskFileManager.diskfile_cls" title="Permalink to this definition"></a></dt>
<dd><p>alias of <a class="reference internal" href="#swift.obj.diskfile.ECDiskFile" title="swift.obj.diskfile.ECDiskFile"><code class="xref py py-class docutils literal"><span class="pre">ECDiskFile</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.ECDiskFileManager.make_on_disk_filename">
<code class="descname">make_on_disk_filename</code><span class="sig-paren">(</span><em>timestamp</em>, <em>ext=None</em>, <em>frag_index=None</em>, <em>ctype_timestamp=None</em>, <em>durable=False</em>, <em>*a</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.ECDiskFileManager.make_on_disk_filename" title="Permalink to this definition"></a></dt>
<dd><p>Returns the EC specific filename for given timestamp.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>timestamp</strong> – the object timestamp, an instance of
<a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a></li>
<li><strong>ext</strong> – an optional string representing a file extension to be
appended to the returned file name</li>
<li><strong>frag_index</strong> – a fragment archive index, used with .data extension
only, must be a whole number.</li>
<li><strong>ctype_timestamp</strong> – an optional content-type timestamp, an instance
of <a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a></li>
<li><strong>durable</strong> – if True then include a durable marker in data filename.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a file name</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileError" title="swift.common.exceptions.DiskFileError"><strong>DiskFileError</strong></a> – if ext==’.data’ and the kwarg frag_index is not
a whole number</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.ECDiskFileManager.parse_on_disk_filename">
<code class="descname">parse_on_disk_filename</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.ECDiskFileManager.parse_on_disk_filename" title="Permalink to this definition"></a></dt>
<dd><p>Returns timestamp(s) and other info extracted from a policy specific
file name. For EC policy the data file name includes a fragment index
and possibly a durable marker, both of which which must be stripped off
to retrieve the timestamp.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> – the file name including extension</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
<dt>a dict, with keys for timestamp, frag_index, durable, ext and</dt>
<dd>ctype_timestamp:</dd>
</dl>
<ul class="simple">
<li>timestamp is a <a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a></li>
<li>frag_index is an int or None</li>
<li>ctype_timestamp is a <a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a> or
None for .meta files, otherwise None</li>
<li>ext is a string, the file extension including the leading dot or
the empty string if the filename has no extension</li>
<li>durable is a boolean that is True if the filename is a data file
that includes a durable marker</li>
</ul>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileError" title="swift.common.exceptions.DiskFileError"><strong>DiskFileError</strong></a> – if any part of the filename is not able to be
validated.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.ECDiskFileManager.validate_fragment_index">
<code class="descname">validate_fragment_index</code><span class="sig-paren">(</span><em>frag_index</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.ECDiskFileManager.validate_fragment_index" title="Permalink to this definition"></a></dt>
<dd><p>Return int representation of frag_index, or raise a DiskFileError if
frag_index is not a whole number.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>frag_index</strong> – a fragment archive index</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.ECDiskFileReader">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">ECDiskFileReader</code><span class="sig-paren">(</span><em>fp</em>, <em>data_file</em>, <em>obj_size</em>, <em>etag</em>, <em>disk_chunk_size</em>, <em>keep_cache_size</em>, <em>device_path</em>, <em>logger</em>, <em>quarantine_hook</em>, <em>use_splice</em>, <em>pipe_size</em>, <em>diskfile</em>, <em>keep_cache=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.ECDiskFileReader" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#swift.obj.diskfile.BaseDiskFileReader" title="swift.obj.diskfile.BaseDiskFileReader"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.BaseDiskFileReader</span></code></a></p>
</dd></dl>

<dl class="class">
<dt id="swift.obj.diskfile.ECDiskFileWriter">
<em class="property">class </em><code class="descclassname">swift.obj.diskfile.</code><code class="descname">ECDiskFileWriter</code><span class="sig-paren">(</span><em>name</em>, <em>datadir</em>, <em>fd</em>, <em>tmppath</em>, <em>bytes_per_sync</em>, <em>diskfile</em>, <em>next_part_power</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.ECDiskFileWriter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#swift.obj.diskfile.BaseDiskFileWriter" title="swift.obj.diskfile.BaseDiskFileWriter"><code class="xref py py-class docutils literal"><span class="pre">swift.obj.diskfile.BaseDiskFileWriter</span></code></a></p>
<dl class="method">
<dt id="swift.obj.diskfile.ECDiskFileWriter.commit">
<code class="descname">commit</code><span class="sig-paren">(</span><em>timestamp</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.ECDiskFileWriter.commit" title="Permalink to this definition"></a></dt>
<dd><p>Finalize put by renaming the object data file to include a durable
marker. We do this for EC policy because it requires a 2-phase put
commit confirmation.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>timestamp</strong> – object put timestamp, an instance of
<a class="reference internal" href="misc.html#swift.common.utils.Timestamp" title="swift.common.utils.Timestamp"><code class="xref py py-class docutils literal"><span class="pre">Timestamp</span></code></a></td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileError" title="swift.common.exceptions.DiskFileError"><strong>DiskFileError</strong></a> – if the diskfile frag_index has not been set
(either during initialisation or a call to put())</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.diskfile.ECDiskFileWriter.put">
<code class="descname">put</code><span class="sig-paren">(</span><em>metadata</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.ECDiskFileWriter.put" title="Permalink to this definition"></a></dt>
<dd><p>The only difference between this method and the replication policy
DiskFileWriter method is adding the frag index to the metadata.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>metadata</strong> – dictionary of metadata to be associated with object</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.clear_auditor_status">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">clear_auditor_status</code><span class="sig-paren">(</span><em>devices</em>, <em>auditor_type='ALL'</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.clear_auditor_status" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.consolidate_hashes">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">consolidate_hashes</code><span class="sig-paren">(</span><em>partition_dir</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.consolidate_hashes" title="Permalink to this definition"></a></dt>
<dd><p>Take what’s in hashes.pkl and hashes.invalid, combine them, write the
result back to hashes.pkl, and clear out hashes.invalid.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>partition_dir</strong> – absolute path to partition dir containing hashes.pkl
and hashes.invalid</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a dict, the suffix hashes (if any), the key ‘valid’ will be False
if hashes.pkl is corrupt, cannot be read or does not exist</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.extract_policy">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">extract_policy</code><span class="sig-paren">(</span><em>obj_path</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.extract_policy" title="Permalink to this definition"></a></dt>
<dd><p>Extracts the policy for an object (based on the name of the objects
directory) given the device-relative path to the object. Returns None in
the event that the path is malformed in some way.</p>
<p>The device-relative path is everything after the mount point; for example:</p>
<dl class="docutils">
<dt>/srv/node/d42/objects-5/30/179/</dt>
<dd>485dc017205a81df3af616d917c90179/1401811134.873649.data</dd>
</dl>
<p>would have device-relative path:</p>
<p>objects-5/30/179/485dc017205a81df3af616d917c90179/1401811134.873649.data</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>obj_path</strong> – device-relative path of an object, or the full path</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a <a class="reference internal" href="misc.html#swift.common.storage_policy.BaseStoragePolicy" title="swift.common.storage_policy.BaseStoragePolicy"><code class="xref py py-class docutils literal"><span class="pre">BaseStoragePolicy</span></code></a> or None</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.get_auditor_status">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">get_auditor_status</code><span class="sig-paren">(</span><em>datadir_path</em>, <em>logger</em>, <em>auditor_type</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.get_auditor_status" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.get_part_path">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">get_part_path</code><span class="sig-paren">(</span><em>dev_path</em>, <em>policy</em>, <em>partition</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.get_part_path" title="Permalink to this definition"></a></dt>
<dd><p>Given the device path, policy, and partition, returns the full
path to the partition</p>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.invalidate_hash">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">invalidate_hash</code><span class="sig-paren">(</span><em>suffix_dir</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.invalidate_hash" title="Permalink to this definition"></a></dt>
<dd><p>Invalidates the hash for a suffix_dir in the partition’s hashes file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>suffix_dir</strong> – absolute path to suffix dir whose hash needs
invalidating</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.object_audit_location_generator">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">object_audit_location_generator</code><span class="sig-paren">(</span><em>devices</em>, <em>mount_check=True</em>, <em>logger=None</em>, <em>device_dirs=None</em>, <em>auditor_type='ALL'</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.object_audit_location_generator" title="Permalink to this definition"></a></dt>
<dd><p>Given a devices path (e.g. “/srv/node”), yield an AuditLocation for all
objects stored under that directory if device_dirs isn’t set.  If
device_dirs is set, only yield AuditLocation for the objects under the
entries in device_dirs. The AuditLocation only knows the path to the hash
directory, not to the .data file therein (if any). This is to avoid a
double listdir(hash_dir); the DiskFile object will always do one, so
we don’t.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>devices</strong> – parent directory of the devices to be audited</li>
<li><strong>mount_check</strong> – flag to check if a mount check should be performed
on devices</li>
<li><strong>logger</strong> – a logger object</li>
<li><strong>device_dirs</strong> – a list of directories under devices to traverse</li>
<li><strong>auditor_type</strong> – either ALL or ZBF</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.quarantine_renamer">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">quarantine_renamer</code><span class="sig-paren">(</span><em>device_path</em>, <em>corrupted_file_path</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.quarantine_renamer" title="Permalink to this definition"></a></dt>
<dd><p>In the case that a file is corrupted, move it to a quarantined
area to allow replication to fix it.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name" colspan="2">Params device_path:</th></tr>
<tr class="field-odd field"><td>&#160;</td><td class="field-body">The path to the device the corrupted file is on.</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">Params corrupted_file_path:</th></tr>
<tr class="field-even field"><td>&#160;</td><td class="field-body">The path to the file you want quarantined.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">path (str) of directory the file was moved to</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><strong>OSError</strong> – re-raises non errno.EEXIST / errno.ENOTEMPTY
exceptions from rename</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.read_hashes">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">read_hashes</code><span class="sig-paren">(</span><em>partition_dir</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.read_hashes" title="Permalink to this definition"></a></dt>
<dd><p>Read the existing hashes.pkl</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a dict, the suffix hashes (if any), the key ‘valid’ will be False
if hashes.pkl is corrupt, cannot be read or does not exist</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.read_metadata">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">read_metadata</code><span class="sig-paren">(</span><em>fd</em>, <em>add_missing_checksum=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.read_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Helper function to read the pickled metadata from an object file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>fd</strong> – file descriptor or filename to load the metadata from</li>
<li><strong>add_missing_checksum</strong> – if set and checksum is missing, add it</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">dictionary of metadata</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.relink_paths">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">relink_paths</code><span class="sig-paren">(</span><em>target_path</em>, <em>new_target_path</em>, <em>check_existing=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.relink_paths" title="Permalink to this definition"></a></dt>
<dd><p>Hard-links a file located in target_path using the second path
new_target_path. Creates intermediate directories if required.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>target_path</strong> – current absolute filename</li>
<li><strong>new_target_path</strong> – new absolute filename for the hardlink</li>
<li><strong>check_existing</strong> – if True, check whether the link is already present
before attempting to create a new one</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.strip_self">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">strip_self</code><span class="sig-paren">(</span><em>f</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.strip_self" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper to attach module level functions to base class.</p>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.update_auditor_status">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">update_auditor_status</code><span class="sig-paren">(</span><em>datadir_path</em>, <em>logger</em>, <em>partitions</em>, <em>auditor_type</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.update_auditor_status" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.write_hashes">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">write_hashes</code><span class="sig-paren">(</span><em>partition_dir</em>, <em>hashes</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.write_hashes" title="Permalink to this definition"></a></dt>
<dd><p>Write hashes to hashes.pkl</p>
<p>The updated key is added to hashes before it is written.</p>
</dd></dl>

<dl class="function">
<dt id="swift.obj.diskfile.write_metadata">
<code class="descclassname">swift.obj.diskfile.</code><code class="descname">write_metadata</code><span class="sig-paren">(</span><em>fd</em>, <em>metadata</em>, <em>xattr_size=65536</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.diskfile.write_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Helper function to write pickled metadata for an object file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>fd</strong> – file descriptor or filename to write the metadata</li>
<li><strong>metadata</strong> – metadata to write</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-swift.obj.replicator">
<span id="id3"></span><span id="object-replicator"></span><h2>Object Replicator<a class="headerlink" href="#module-swift.obj.replicator" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="swift.obj.replicator.ObjectReplicator">
<em class="property">class </em><code class="descclassname">swift.obj.replicator.</code><code class="descname">ObjectReplicator</code><span class="sig-paren">(</span><em>conf</em>, <em>logger=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">swift.common.daemon.Daemon</span></code></p>
<p>Replicate objects.</p>
<p>Encapsulates most logic and data needed by the object replication process.
Each call to .replicate() performs one replication pass.  It’s up to the
caller to do this in a loop.</p>
<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.build_replication_jobs">
<code class="descname">build_replication_jobs</code><span class="sig-paren">(</span><em>policy</em>, <em>ips</em>, <em>override_devices=None</em>, <em>override_partitions=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.build_replication_jobs" title="Permalink to this definition"></a></dt>
<dd><p>Helper function for collect_jobs to build jobs for replication
using replication style storage policy</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.check_ring">
<code class="descname">check_ring</code><span class="sig-paren">(</span><em>object_ring</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.check_ring" title="Permalink to this definition"></a></dt>
<dd><p>Check to see if the ring has been updated
:param object_ring: the ring to check</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">boolean indicating whether or not the ring has changed</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.collect_jobs">
<code class="descname">collect_jobs</code><span class="sig-paren">(</span><em>override_devices=None</em>, <em>override_partitions=None</em>, <em>override_policies=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.collect_jobs" title="Permalink to this definition"></a></dt>
<dd><p>Returns a sorted list of jobs (dictionaries) that specify the
partitions, nodes, etc to be rsynced.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>override_devices</strong> – if set, only jobs on these devices
will be returned</li>
<li><strong>override_partitions</strong> – if set, only jobs on these partitions
will be returned</li>
<li><strong>override_policies</strong> – if set, only jobs in these storage
policies will be returned</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.delete_handoff_objs">
<code class="descname">delete_handoff_objs</code><span class="sig-paren">(</span><em>job</em>, <em>delete_objs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.delete_handoff_objs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.delete_partition">
<code class="descname">delete_partition</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.delete_partition" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.detect_lockups">
<code class="descname">detect_lockups</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.detect_lockups" title="Permalink to this definition"></a></dt>
<dd><p>In testing, the pool.waitall() call very occasionally failed to return.
This is an attempt to make sure the replicator finishes its replication
pass in some eventuality.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.heartbeat">
<code class="descname">heartbeat</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.heartbeat" title="Permalink to this definition"></a></dt>
<dd><p>Loop that runs in the background during replication.  It periodically
logs progress.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.kill_coros">
<code class="descname">kill_coros</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.kill_coros" title="Permalink to this definition"></a></dt>
<dd><p>Utility function that kills all coroutines currently running.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.load_object_ring">
<code class="descname">load_object_ring</code><span class="sig-paren">(</span><em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.load_object_ring" title="Permalink to this definition"></a></dt>
<dd><p>Make sure the policy’s rings are loaded.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>policy</strong> – the StoragePolicy instance</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">appropriate ring object</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.replicate">
<code class="descname">replicate</code><span class="sig-paren">(</span><em>override_devices=None</em>, <em>override_partitions=None</em>, <em>override_policies=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.replicate" title="Permalink to this definition"></a></dt>
<dd><p>Run a replication pass</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.rsync">
<code class="descname">rsync</code><span class="sig-paren">(</span><em>node</em>, <em>job</em>, <em>suffixes</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.rsync" title="Permalink to this definition"></a></dt>
<dd><p>Uses rsync to implement the sync method. This was the first
sync method in Swift.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.run_forever">
<code class="descname">run_forever</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.run_forever" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.run_once">
<code class="descname">run_once</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.run_once" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.ssync">
<code class="descname">ssync</code><span class="sig-paren">(</span><em>node</em>, <em>job</em>, <em>suffixes</em>, <em>remote_check_objs=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.ssync" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.stats_line">
<code class="descname">stats_line</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.stats_line" title="Permalink to this definition"></a></dt>
<dd><p>Logs various stats for the currently running replication pass.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.sync">
<code class="descname">sync</code><span class="sig-paren">(</span><em>node</em>, <em>job</em>, <em>suffixes</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.sync" title="Permalink to this definition"></a></dt>
<dd><p>Synchronize local suffix directories from a partition with a remote
node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node</strong> – the “dev” entry for the remote node to sync with</li>
<li><strong>job</strong> – information about the partition being synced</li>
<li><strong>suffixes</strong> – a list of suffixes which need to be pushed</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">boolean and dictionary, boolean indicating success or failure</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.update">
<code class="descname">update</code><span class="sig-paren">(</span><em>job</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.update" title="Permalink to this definition"></a></dt>
<dd><p>High-level method that replicates a single partition.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>job</strong> – a dict containing info about the partition to be replicated</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.replicator.ObjectReplicator.update_deleted">
<code class="descname">update_deleted</code><span class="sig-paren">(</span><em>job</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.replicator.ObjectReplicator.update_deleted" title="Permalink to this definition"></a></dt>
<dd><p>High-level method that replicates a single partition that doesn’t
belong on this node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>job</strong> – a dict containing info about the partition to be replicated</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<span class="target" id="module-swift.obj.ssync_sender"></span><dl class="class">
<dt id="swift.obj.ssync_sender.Sender">
<em class="property">class </em><code class="descclassname">swift.obj.ssync_sender.</code><code class="descname">Sender</code><span class="sig-paren">(</span><em>daemon</em>, <em>node</em>, <em>job</em>, <em>suffixes</em>, <em>remote_check_objs=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.Sender" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Sends SSYNC requests to the object server.</p>
<p>These requests are eventually handled by
<a class="reference internal" href="#module-swift.obj.ssync_receiver" title="swift.obj.ssync_receiver"><code class="xref py py-mod docutils literal"><span class="pre">ssync_receiver</span></code></a> and full documentation about the
process is there.</p>
<dl class="method">
<dt id="swift.obj.ssync_sender.Sender.connect">
<code class="descname">connect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.Sender.connect" title="Permalink to this definition"></a></dt>
<dd><p>Establishes a connection and starts an SSYNC request
with the object server.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.ssync_sender.Sender.disconnect">
<code class="descname">disconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.Sender.disconnect" title="Permalink to this definition"></a></dt>
<dd><p>Closes down the connection to the object server once done
with the SSYNC request.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.ssync_sender.Sender.missing_check">
<code class="descname">missing_check</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.Sender.missing_check" title="Permalink to this definition"></a></dt>
<dd><p>Handles the sender-side of the MISSING_CHECK step of a
SSYNC request.</p>
<p>Full documentation of this can be found at
<a class="reference internal" href="#swift.obj.ssync_receiver.Receiver.missing_check" title="swift.obj.ssync_receiver.Receiver.missing_check"><code class="xref py py-meth docutils literal"><span class="pre">Receiver.missing_check()</span></code></a>.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.ssync_sender.Sender.readline">
<code class="descname">readline</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.Sender.readline" title="Permalink to this definition"></a></dt>
<dd><p>Reads a line from the SSYNC response body.</p>
<p>httplib has no readline and will block on read(x) until x is
read, so we have to do the work ourselves. A bit of this is
taken from Python’s httplib itself.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.ssync_sender.Sender.send_delete">
<code class="descname">send_delete</code><span class="sig-paren">(</span><em>url_path</em>, <em>timestamp</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.Sender.send_delete" title="Permalink to this definition"></a></dt>
<dd><p>Sends a DELETE subrequest with the given information.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.ssync_sender.Sender.send_post">
<code class="descname">send_post</code><span class="sig-paren">(</span><em>url_path</em>, <em>df</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.Sender.send_post" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.ssync_sender.Sender.send_put">
<code class="descname">send_put</code><span class="sig-paren">(</span><em>url_path</em>, <em>df</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.Sender.send_put" title="Permalink to this definition"></a></dt>
<dd><p>Sends a PUT subrequest for the url_path using the source df
(DiskFile) and content_length.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.ssync_sender.Sender.updates">
<code class="descname">updates</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.Sender.updates" title="Permalink to this definition"></a></dt>
<dd><p>Handles the sender-side of the UPDATES step of an SSYNC
request.</p>
<p>Full documentation of this can be found at
<a class="reference internal" href="#swift.obj.ssync_receiver.Receiver.updates" title="swift.obj.ssync_receiver.Receiver.updates"><code class="xref py py-meth docutils literal"><span class="pre">Receiver.updates()</span></code></a>.</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="swift.obj.ssync_sender.decode_wanted">
<code class="descclassname">swift.obj.ssync_sender.</code><code class="descname">decode_wanted</code><span class="sig-paren">(</span><em>parts</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.decode_wanted" title="Permalink to this definition"></a></dt>
<dd><p>Parse missing_check line parts to determine which parts of local
diskfile were wanted by the receiver.</p>
<p>The encoder for parts is
<a class="reference internal" href="#swift.obj.ssync_receiver.encode_wanted" title="swift.obj.ssync_receiver.encode_wanted"><code class="xref py py-func docutils literal"><span class="pre">encode_wanted()</span></code></a></p>
</dd></dl>

<dl class="function">
<dt id="swift.obj.ssync_sender.encode_missing">
<code class="descclassname">swift.obj.ssync_sender.</code><code class="descname">encode_missing</code><span class="sig-paren">(</span><em>object_hash</em>, <em>ts_data</em>, <em>ts_meta=None</em>, <em>ts_ctype=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_sender.encode_missing" title="Permalink to this definition"></a></dt>
<dd><p>Returns a string representing the object hash, its data file timestamp
and the delta forwards to its metafile and content-type timestamps, if
non-zero, in the form:
<code class="docutils literal"><span class="pre">&lt;hash&gt;</span> <span class="pre">&lt;ts_data&gt;</span> <span class="pre">[m:&lt;hex</span> <span class="pre">delta</span> <span class="pre">to</span> <span class="pre">ts_meta&gt;[,t:&lt;hex</span> <span class="pre">delta</span> <span class="pre">to</span> <span class="pre">ts_ctype&gt;]]</span></code></p>
<p>The decoder for this line is
<a class="reference internal" href="#swift.obj.ssync_receiver.decode_missing" title="swift.obj.ssync_receiver.decode_missing"><code class="xref py py-func docutils literal"><span class="pre">decode_missing()</span></code></a></p>
</dd></dl>

<span class="target" id="module-swift.obj.ssync_receiver"></span><dl class="class">
<dt id="swift.obj.ssync_receiver.Receiver">
<em class="property">class </em><code class="descclassname">swift.obj.ssync_receiver.</code><code class="descname">Receiver</code><span class="sig-paren">(</span><em>app</em>, <em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_receiver.Receiver" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Handles incoming SSYNC requests to the object server.</p>
<p>These requests come from the object-replicator daemon that uses
<a class="reference internal" href="#module-swift.obj.ssync_sender" title="swift.obj.ssync_sender"><code class="xref py py-mod docutils literal"><span class="pre">ssync_sender</span></code></a>.</p>
<p>The number of concurrent SSYNC requests is restricted by
use of a replication_semaphore and can be configured with the
object-server.conf [object-server] replication_concurrency
setting.</p>
<p>An SSYNC request is really just an HTTP conduit for
sender/receiver replication communication. The overall
SSYNC request should always succeed, but it will contain
multiple requests within its request and response bodies. This
“hack” is done so that replication concurrency can be managed.</p>
<p>The general process inside an SSYNC request is:</p>
<blockquote>
<div><ol class="arabic simple">
<li>Initialize the request: Basic request validation, mount check,
acquire semaphore lock, etc..</li>
<li>Missing check: Sender sends the hashes and timestamps of
the object information it can send, receiver sends back
the hashes it wants (doesn’t have or has an older
timestamp).</li>
<li>Updates: Sender sends the object information requested.</li>
<li>Close down: Release semaphore lock, etc.</li>
</ol>
</div></blockquote>
<dl class="method">
<dt id="swift.obj.ssync_receiver.Receiver.initialize_request">
<code class="descname">initialize_request</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_receiver.Receiver.initialize_request" title="Permalink to this definition"></a></dt>
<dd><p>Basic validation of request and mount check.</p>
<p>This function will be called before attempting to acquire a
replication semaphore lock, so contains only quick checks.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.ssync_receiver.Receiver.missing_check">
<code class="descname">missing_check</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_receiver.Receiver.missing_check" title="Permalink to this definition"></a></dt>
<dd><p>Handles the receiver-side of the MISSING_CHECK step of a
SSYNC request.</p>
<p>Receives a list of hashes and timestamps of object
information the sender can provide and responds with a list
of hashes desired, either because they’re missing or have an
older timestamp locally.</p>
<p>The process is generally:</p>
<blockquote>
<div><ol class="arabic">
<li><p class="first">Sender sends <cite>:MISSING_CHECK: START</cite> and begins
sending <cite>hash timestamp</cite> lines.</p>
</li>
<li><p class="first">Receiver gets <cite>:MISSING_CHECK: START</cite> and begins
reading the <cite>hash timestamp</cite> lines, collecting the
hashes of those it desires.</p>
</li>
<li><p class="first">Sender sends <cite>:MISSING_CHECK: END</cite>.</p>
</li>
<li><p class="first">Receiver gets <cite>:MISSING_CHECK: END</cite>, responds with
<cite>:MISSING_CHECK: START</cite>, followed by the list of
&lt;wanted_hash&gt; specifiers it collected as being wanted
(one per line), <cite>:MISSING_CHECK: END</cite>, and flushes any
buffers.</p>
<p>Each &lt;wanted_hash&gt; specifier has the form &lt;hash&gt;[ &lt;parts&gt;] where
&lt;parts&gt; is a string containing characters ‘d’ and/or ‘m’
indicating that only data or meta part of object respectively is
required to be sync’d.</p>
</li>
<li><p class="first">Sender gets <cite>:MISSING_CHECK: START</cite> and reads the list
of hashes desired by the receiver until reading
<cite>:MISSING_CHECK: END</cite>.</p>
</li>
</ol>
</div></blockquote>
<p>The collection and then response is so the sender doesn’t
have to read while it writes to ensure network buffers don’t
fill up and block everything.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.ssync_receiver.Receiver.updates">
<code class="descname">updates</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_receiver.Receiver.updates" title="Permalink to this definition"></a></dt>
<dd><p>Handles the UPDATES step of an SSYNC request.</p>
<p>Receives a set of PUT and DELETE subrequests that will be
routed to the object server itself for processing. These
contain the information requested by the MISSING_CHECK step.</p>
<p>The PUT and DELETE subrequests are formatted pretty much
exactly like regular HTTP requests, excepting the HTTP
version on the first request line.</p>
<p>The process is generally:</p>
<blockquote>
<div><ol class="arabic simple">
<li>Sender sends <cite>:UPDATES: START</cite> and begins sending the
PUT and DELETE subrequests.</li>
<li>Receiver gets <cite>:UPDATES: START</cite> and begins routing the
subrequests to the object server.</li>
<li>Sender sends <cite>:UPDATES: END</cite>.</li>
<li>Receiver gets <cite>:UPDATES: END</cite> and sends <cite>:UPDATES:
START</cite> and <cite>:UPDATES: END</cite> (assuming no errors).</li>
<li>Sender gets <cite>:UPDATES: START</cite> and <cite>:UPDATES: END</cite>.</li>
</ol>
</div></blockquote>
<p>If too many subrequests fail, as configured by
replication_failure_threshold and replication_failure_ratio,
the receiver will hang up the request early so as to not
waste any more time.</p>
<p>At step 4, the receiver will send back an error if there were
any failures (that didn’t cause a hangup due to the above
thresholds) so the sender knows the whole was not entirely a
success. This is so the sender knows if it can remove an out
of place partition, for example.</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="swift.obj.ssync_receiver.decode_missing">
<code class="descclassname">swift.obj.ssync_receiver.</code><code class="descname">decode_missing</code><span class="sig-paren">(</span><em>line</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_receiver.decode_missing" title="Permalink to this definition"></a></dt>
<dd><p>Parse a string of the form generated by
<a class="reference internal" href="#swift.obj.ssync_sender.encode_missing" title="swift.obj.ssync_sender.encode_missing"><code class="xref py py-func docutils literal"><span class="pre">encode_missing()</span></code></a> and return a dict
with keys <code class="docutils literal"><span class="pre">object_hash</span></code>, <code class="docutils literal"><span class="pre">ts_data</span></code>, <code class="docutils literal"><span class="pre">ts_meta</span></code>, <code class="docutils literal"><span class="pre">ts_ctype</span></code>.</p>
<p>The encoder for this line is
<a class="reference internal" href="#swift.obj.ssync_sender.encode_missing" title="swift.obj.ssync_sender.encode_missing"><code class="xref py py-func docutils literal"><span class="pre">encode_missing()</span></code></a></p>
</dd></dl>

<dl class="function">
<dt id="swift.obj.ssync_receiver.encode_wanted">
<code class="descclassname">swift.obj.ssync_receiver.</code><code class="descname">encode_wanted</code><span class="sig-paren">(</span><em>remote</em>, <em>local</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.ssync_receiver.encode_wanted" title="Permalink to this definition"></a></dt>
<dd><p>Compare a remote and local results and generate a wanted line.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>remote</strong> – a dict, with ts_data and ts_meta keys in the form
returned by <a class="reference internal" href="#swift.obj.ssync_receiver.decode_missing" title="swift.obj.ssync_receiver.decode_missing"><code class="xref py py-func docutils literal"><span class="pre">decode_missing()</span></code></a></li>
<li><strong>local</strong> – a dict, possibly empty, with ts_data and ts_meta keys
in the form returned <code class="xref py py-meth docutils literal"><span class="pre">Receiver._check_local()</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>The decoder for this line is
<a class="reference internal" href="#swift.obj.ssync_sender.decode_wanted" title="swift.obj.ssync_sender.decode_wanted"><code class="xref py py-func docutils literal"><span class="pre">decode_wanted()</span></code></a></p>
</dd></dl>

</div>
<div class="section" id="module-swift.obj.reconstructor">
<span id="id4"></span><span id="object-reconstructor"></span><h2>Object Reconstructor<a class="headerlink" href="#module-swift.obj.reconstructor" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="swift.obj.reconstructor.ObjectReconstructor">
<em class="property">class </em><code class="descclassname">swift.obj.reconstructor.</code><code class="descname">ObjectReconstructor</code><span class="sig-paren">(</span><em>conf</em>, <em>logger=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">swift.common.daemon.Daemon</span></code></p>
<p>Reconstruct objects using erasure code.  And also rebalance EC Fragment
Archive objects off handoff nodes.</p>
<p>Encapsulates most logic and data needed by the object reconstruction
process. Each call to .reconstruct() performs one pass.  It’s up to the
caller to do this in a loop.</p>
<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.aggregate_recon_update">
<code class="descname">aggregate_recon_update</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.aggregate_recon_update" title="Permalink to this definition"></a></dt>
<dd><p>Aggregate per-disk rcache updates from child workers.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.build_reconstruction_jobs">
<code class="descname">build_reconstruction_jobs</code><span class="sig-paren">(</span><em>part_info</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.build_reconstruction_jobs" title="Permalink to this definition"></a></dt>
<dd><p>Helper function for collect_jobs to build jobs for reconstruction
using EC style storage policy</p>
<p>N.B. If this function ever returns an empty list of jobs the entire
partition will be deleted.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.check_ring">
<code class="descname">check_ring</code><span class="sig-paren">(</span><em>object_ring</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.check_ring" title="Permalink to this definition"></a></dt>
<dd><p>Check to see if the ring has been updated</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>object_ring</strong> – the ring to check</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">boolean indicating whether or not the ring has changed</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.collect_parts">
<code class="descname">collect_parts</code><span class="sig-paren">(</span><em>override_devices=None</em>, <em>override_partitions=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.collect_parts" title="Permalink to this definition"></a></dt>
<dd><p>Helper for getting partitions in the top level reconstructor</p>
<p>In handoffs_only mode primary partitions will not be included in the
returned (possibly empty) list.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.delete_partition">
<code class="descname">delete_partition</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.delete_partition" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.delete_reverted_objs">
<code class="descname">delete_reverted_objs</code><span class="sig-paren">(</span><em>job</em>, <em>objects</em>, <em>frag_index</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.delete_reverted_objs" title="Permalink to this definition"></a></dt>
<dd><p>For EC we can potentially revert only some of a partition
so we’ll delete reverted objects here. Note that we delete
the fragment index of the file we sent to the remote node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>job</strong> – the job being processed</li>
<li><strong>objects</strong> – a dict of objects to be deleted, each entry maps
hash=&gt;timestamp</li>
<li><strong>frag_index</strong> – (int) the fragment index of data files to be deleted</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.detect_lockups">
<code class="descname">detect_lockups</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.detect_lockups" title="Permalink to this definition"></a></dt>
<dd><p>In testing, the pool.waitall() call very occasionally failed to return.
This is an attempt to make sure the reconstructor finishes its
reconstruction pass in some eventuality.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.final_recon_dump">
<code class="descname">final_recon_dump</code><span class="sig-paren">(</span><em>total</em>, <em>override_devices=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.final_recon_dump" title="Permalink to this definition"></a></dt>
<dd><p>Add stats for this worker’s run to recon cache.</p>
<p>When in worker mode (per_disk_stats == True) this worker’s stats are
added per device instead of in the top level keys (aggregation is
serialized in the parent process).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>total</strong> – the runtime of cycle in minutes</li>
<li><strong>override_devices</strong> – (optional) list of device that are being
reconstructed</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.get_local_devices">
<code class="descname">get_local_devices</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.get_local_devices" title="Permalink to this definition"></a></dt>
<dd><p>Returns a set of all local devices in all EC policies.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.get_policy2devices">
<code class="descname">get_policy2devices</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.get_policy2devices" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.get_suffix_delta">
<code class="descname">get_suffix_delta</code><span class="sig-paren">(</span><em>local_suff</em>, <em>local_index</em>, <em>remote_suff</em>, <em>remote_index</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.get_suffix_delta" title="Permalink to this definition"></a></dt>
<dd><p>Compare the local suffix hashes with the remote suffix hashes
for the given local and remote fragment indexes.  Return those
suffixes which should be synced.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>local_suff</strong> – the local suffix hashes (from _get_hashes)</li>
<li><strong>local_index</strong> – the local fragment index for the job</li>
<li><strong>remote_suff</strong> – the remote suffix hashes (from remote
REPLICATE request)</li>
<li><strong>remote_index</strong> – the remote fragment index for the job</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a list of strings, the suffix dirs to sync</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.get_worker_args">
<code class="descname">get_worker_args</code><span class="sig-paren">(</span><em>once=False</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.get_worker_args" title="Permalink to this definition"></a></dt>
<dd><p>Take the set of all local devices for this node from all the EC
policies rings, and distribute them evenly into the number of workers
to be spawned according to the configured worker count. If <cite>devices</cite> is
given in <cite>kwargs</cite> then distribute only those devices.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>once</strong> – False if the worker(s) will be daemonized, True if the
worker(s) will be run once</li>
<li><strong>kwargs</strong> – optional overrides from the command line</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.heartbeat">
<code class="descname">heartbeat</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.heartbeat" title="Permalink to this definition"></a></dt>
<dd><p>Loop that runs in the background during reconstruction.  It
periodically logs progress.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.is_healthy">
<code class="descname">is_healthy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.is_healthy" title="Permalink to this definition"></a></dt>
<dd><p>Check whether rings have changed, and maybe do a recon update.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">False if any ec ring has changed</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.kill_coros">
<code class="descname">kill_coros</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.kill_coros" title="Permalink to this definition"></a></dt>
<dd><p>Utility function that kills all coroutines currently running.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.load_object_ring">
<code class="descname">load_object_ring</code><span class="sig-paren">(</span><em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.load_object_ring" title="Permalink to this definition"></a></dt>
<dd><p>Make sure the policy’s rings are loaded.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>policy</strong> – the StoragePolicy instance</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">appropriate ring object</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.make_rebuilt_fragment_iter">
<code class="descname">make_rebuilt_fragment_iter</code><span class="sig-paren">(</span><em>responses</em>, <em>path</em>, <em>policy</em>, <em>frag_index</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.make_rebuilt_fragment_iter" title="Permalink to this definition"></a></dt>
<dd><p>Turn a set of connections from backend object servers into a generator
that yields up the rebuilt fragment archive for frag_index.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.process_job">
<code class="descname">process_job</code><span class="sig-paren">(</span><em>job</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.process_job" title="Permalink to this definition"></a></dt>
<dd><p>Sync the local partition with the remote node(s) according to
the parameters of the job.  For primary nodes, the SYNC job type
will define both left and right hand sync_to nodes to ssync with
as defined by this primary nodes index in the node list based on
the fragment index found in the partition.  For non-primary
nodes (either handoff revert, or rebalance) the REVERT job will
define a single node in sync_to which is the proper/new home for
the fragment index.</p>
<p>N.B. ring rebalancing can be time consuming and handoff nodes’
fragment indexes do not have a stable order, it’s possible to
have more than one REVERT job for a partition, and in some rare
failure conditions there may even also be a SYNC job for the
same partition - but each one will be processed separately
because each job will define a separate list of node(s) to
‘sync_to’.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Param:</th><td class="field-body">the job dict, with the keys defined in <code class="docutils literal"><span class="pre">_get_job_info</span></code></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.reconstruct">
<code class="descname">reconstruct</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.reconstruct" title="Permalink to this definition"></a></dt>
<dd><p>Run a reconstruction pass</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.reconstruct_fa">
<code class="descname">reconstruct_fa</code><span class="sig-paren">(</span><em>job</em>, <em>node</em>, <em>datafile_metadata</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.reconstruct_fa" title="Permalink to this definition"></a></dt>
<dd><p>Reconstructs a fragment archive - this method is called from ssync
after a remote node responds that is missing this object - the local
diskfile is opened to provide metadata - but to reconstruct the
missing fragment archive we must connect to multiple object servers.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>job</strong> – job from ssync_sender</li>
<li><strong>node</strong> – node that we’re rebuilding to</li>
<li><strong>datafile_metadata</strong> – the datafile metadata to attach to
the rebuilt fragment archive</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a DiskFile like class for use by ssync</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference internal" href="misc.html#swift.common.exceptions.DiskFileError" title="swift.common.exceptions.DiskFileError"><strong>DiskFileError</strong></a> – if the fragment archive cannot be reconstructed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.rehash_remote">
<code class="descname">rehash_remote</code><span class="sig-paren">(</span><em>node</em>, <em>job</em>, <em>suffixes</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.rehash_remote" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.run_forever">
<code class="descname">run_forever</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.run_forever" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.run_once">
<code class="descname">run_once</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.run_once" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.ObjectReconstructor.stats_line">
<code class="descname">stats_line</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.ObjectReconstructor.stats_line" title="Permalink to this definition"></a></dt>
<dd><p>Logs various stats for the currently running reconstruction pass.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.reconstructor.RebuildingECDiskFileStream">
<em class="property">class </em><code class="descclassname">swift.obj.reconstructor.</code><code class="descname">RebuildingECDiskFileStream</code><span class="sig-paren">(</span><em>datafile_metadata</em>, <em>frag_index</em>, <em>rebuilt_fragment_iter</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.RebuildingECDiskFileStream" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>This class wraps the reconstructed fragment archive data and
metadata in the DiskFile interface for ssync.</p>
<dl class="attribute">
<dt id="swift.obj.reconstructor.RebuildingECDiskFileStream.content_length">
<code class="descname">content_length</code><a class="headerlink" href="#swift.obj.reconstructor.RebuildingECDiskFileStream.content_length" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.RebuildingECDiskFileStream.get_datafile_metadata">
<code class="descname">get_datafile_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.RebuildingECDiskFileStream.get_datafile_metadata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.RebuildingECDiskFileStream.get_metadata">
<code class="descname">get_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.RebuildingECDiskFileStream.get_metadata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.reconstructor.RebuildingECDiskFileStream.reader">
<code class="descname">reader</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.RebuildingECDiskFileStream.reader" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="function">
<dt id="swift.obj.reconstructor.parse_override_options">
<code class="descclassname">swift.obj.reconstructor.</code><code class="descname">parse_override_options</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.reconstructor.parse_override_options" title="Permalink to this definition"></a></dt>
<dd><p>Return a dict with keys <cite>override_devices</cite> and <cite>override_partitions</cite> whose
values have been parsed from <cite>kwargs</cite>. If either key is found in <cite>kwargs</cite>
then copy its value from kwargs. Otherwise, if <cite>once</cite> is set in <cite>kwargs</cite>
then parse <cite>devices</cite> and <cite>partitions</cite> keys for the value of
<cite>override_devices</cite> and <cite>override_partitions</cite> respectively.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a dict with keys <cite>override_devices</cite> and <cite>override_partitions</cite></td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-swift.obj.server">
<span id="id5"></span><span id="object-server"></span><h2>Object Server<a class="headerlink" href="#module-swift.obj.server" title="Permalink to this headline"></a></h2>
<p>Object Server for Swift</p>
<dl class="class">
<dt id="swift.obj.server.EventletPlungerString">
<em class="property">class </em><code class="descclassname">swift.obj.server.</code><code class="descname">EventletPlungerString</code><a class="headerlink" href="#swift.obj.server.EventletPlungerString" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">str</span></code></p>
<p>Eventlet won’t send headers until it’s accumulated at least
eventlet.wsgi.MINIMUM_CHUNK_SIZE bytes or the app iter is exhausted. If we
want to send the response body behind Eventlet’s back, perhaps with some
zero-copy wizardry, then we have to unclog the plumbing in eventlet.wsgi
to force the headers out, so we use an EventletPlungerString to empty out
all of Eventlet’s buffers.</p>
</dd></dl>

<dl class="class">
<dt id="swift.obj.server.ObjectController">
<em class="property">class </em><code class="descclassname">swift.obj.server.</code><code class="descname">ObjectController</code><span class="sig-paren">(</span><em>conf</em>, <em>logger=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">swift.common.base_storage_server.BaseStorageServer</span></code></p>
<p>Implements the WSGI application for the Swift Object Server.</p>
<dl class="method">
<dt id="swift.obj.server.ObjectController.DELETE">
<code class="descname">DELETE</code><span class="sig-paren">(</span><em>ctrl</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.DELETE" title="Permalink to this definition"></a></dt>
<dd><p>Handle HTTP DELETE requests for the Swift Object Server.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.GET">
<code class="descname">GET</code><span class="sig-paren">(</span><em>ctrl</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.GET" title="Permalink to this definition"></a></dt>
<dd><p>Handle HTTP GET requests for the Swift Object Server.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.HEAD">
<code class="descname">HEAD</code><span class="sig-paren">(</span><em>ctrl</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.HEAD" title="Permalink to this definition"></a></dt>
<dd><p>Handle HTTP HEAD requests for the Swift Object Server.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.POST">
<code class="descname">POST</code><span class="sig-paren">(</span><em>ctrl</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.POST" title="Permalink to this definition"></a></dt>
<dd><p>Handle HTTP POST requests for the Swift Object Server.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.PUT">
<code class="descname">PUT</code><span class="sig-paren">(</span><em>ctrl</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.PUT" title="Permalink to this definition"></a></dt>
<dd><p>Handle HTTP PUT requests for the Swift Object Server.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.REPLICATE">
<code class="descname">REPLICATE</code><span class="sig-paren">(</span><em>ctrl</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.REPLICATE" title="Permalink to this definition"></a></dt>
<dd><p>Handle REPLICATE requests for the Swift Object Server.  This is used
by the object replicator to get hashes for directories.</p>
<p>Note that the name REPLICATE is preserved for historical reasons as
this verb really just returns the hashes information for the specified
parameters and is used, for example, by both replication and EC.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.SSYNC">
<code class="descname">SSYNC</code><span class="sig-paren">(</span><em>ctrl</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.SSYNC" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.async_update">
<code class="descname">async_update</code><span class="sig-paren">(</span><em>op</em>, <em>account</em>, <em>container</em>, <em>obj</em>, <em>host</em>, <em>partition</em>, <em>contdevice</em>, <em>headers_out</em>, <em>objdevice</em>, <em>policy</em>, <em>logger_thread_locals=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.async_update" title="Permalink to this definition"></a></dt>
<dd><p>Sends or saves an async update.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>op</strong> – operation performed (ex: ‘PUT’, or ‘DELETE’)</li>
<li><strong>account</strong> – account name for the object</li>
<li><strong>container</strong> – container name for the object</li>
<li><strong>obj</strong> – object name</li>
<li><strong>host</strong> – host that the container is on</li>
<li><strong>partition</strong> – partition that the container is on</li>
<li><strong>contdevice</strong> – device name that the container is on</li>
<li><strong>headers_out</strong> – dictionary of headers to send in the container
request</li>
<li><strong>objdevice</strong> – device name that the object is in</li>
<li><strong>policy</strong> – the associated BaseStoragePolicy instance</li>
<li><strong>logger_thread_locals</strong> – The thread local values to be set on the
self.logger to retain transaction
logging information.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.container_update">
<code class="descname">container_update</code><span class="sig-paren">(</span><em>op</em>, <em>account</em>, <em>container</em>, <em>obj</em>, <em>request</em>, <em>headers_out</em>, <em>objdevice</em>, <em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.container_update" title="Permalink to this definition"></a></dt>
<dd><p>Update the container when objects are updated.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>op</strong> – operation performed (ex: ‘PUT’, or ‘DELETE’)</li>
<li><strong>account</strong> – account name for the object</li>
<li><strong>container</strong> – container name for the object</li>
<li><strong>obj</strong> – object name</li>
<li><strong>request</strong> – the original request object driving the update</li>
<li><strong>headers_out</strong> – dictionary of headers to send in the container
request(s)</li>
<li><strong>objdevice</strong> – device name that the object is in</li>
<li><strong>policy</strong> – the BaseStoragePolicy instance</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.delete_at_update">
<code class="descname">delete_at_update</code><span class="sig-paren">(</span><em>op</em>, <em>delete_at</em>, <em>account</em>, <em>container</em>, <em>obj</em>, <em>request</em>, <em>objdevice</em>, <em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.delete_at_update" title="Permalink to this definition"></a></dt>
<dd><p>Update the expiring objects container when objects are updated.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>op</strong> – operation performed (ex: ‘PUT’, or ‘DELETE’)</li>
<li><strong>delete_at</strong> – scheduled delete in UNIX seconds, int</li>
<li><strong>account</strong> – account name for the object</li>
<li><strong>container</strong> – container name for the object</li>
<li><strong>obj</strong> – object name</li>
<li><strong>request</strong> – the original request driving the update</li>
<li><strong>objdevice</strong> – device name that the object is in</li>
<li><strong>policy</strong> – the BaseStoragePolicy instance (used for tmp dir)</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.get_diskfile">
<code class="descname">get_diskfile</code><span class="sig-paren">(</span><em>device</em>, <em>partition</em>, <em>account</em>, <em>container</em>, <em>obj</em>, <em>policy</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.get_diskfile" title="Permalink to this definition"></a></dt>
<dd><p>Utility method for instantiating a DiskFile object supporting a given
REST API.</p>
<p>An implementation of the object server that wants to use a different
DiskFile class would simply over-ride this method to provide that
behavior.</p>
</dd></dl>

<dl class="attribute">
<dt id="swift.obj.server.ObjectController.server_type">
<code class="descname">server_type</code><em class="property"> = 'object-server'</em><a class="headerlink" href="#swift.obj.server.ObjectController.server_type" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.server.ObjectController.setup">
<code class="descname">setup</code><span class="sig-paren">(</span><em>conf</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.ObjectController.setup" title="Permalink to this definition"></a></dt>
<dd><p>Implementation specific setup. This method is called at the very end
by the constructor to allow a specific implementation to modify
existing attributes or add its own attributes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>conf</strong> – WSGI configuration parameter</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="swift.obj.server.app_factory">
<code class="descclassname">swift.obj.server.</code><code class="descname">app_factory</code><span class="sig-paren">(</span><em>global_conf</em>, <em>**local_conf</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.app_factory" title="Permalink to this definition"></a></dt>
<dd><p>paste.deploy app factory for creating WSGI object server apps</p>
</dd></dl>

<dl class="function">
<dt id="swift.obj.server.drain">
<code class="descclassname">swift.obj.server.</code><code class="descname">drain</code><span class="sig-paren">(</span><em>file_like</em>, <em>read_size</em>, <em>timeout</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.drain" title="Permalink to this definition"></a></dt>
<dd><p>Read and discard any bytes from file_like.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>file_like</strong> – file-like object to read from</li>
<li><strong>read_size</strong> – how big a chunk to read at a time</li>
<li><strong>timeout</strong> – how long to wait for a read (use None for no timeout)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference internal" href="misc.html#swift.common.exceptions.ChunkReadTimeout" title="swift.common.exceptions.ChunkReadTimeout"><strong>ChunkReadTimeout</strong></a> – if no chunk was read in time</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swift.obj.server.global_conf_callback">
<code class="descclassname">swift.obj.server.</code><code class="descname">global_conf_callback</code><span class="sig-paren">(</span><em>preloaded_app_conf</em>, <em>global_conf</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.global_conf_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback for swift.common.wsgi.run_wsgi during the global_conf
creation so that we can add our replication_semaphore, used to
limit the number of concurrent SSYNC_REQUESTS across all
workers.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>preloaded_app_conf</strong> – The preloaded conf for the WSGI app.
This conf instance will go away, so
just read from it, don’t write.</li>
<li><strong>global_conf</strong> – The global conf that will eventually be
passed to the app_factory function later.
This conf is created before the worker
subprocesses are forked, so can be useful to
set up semaphores, shared memory, etc.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swift.obj.server.iter_mime_headers_and_bodies">
<code class="descclassname">swift.obj.server.</code><code class="descname">iter_mime_headers_and_bodies</code><span class="sig-paren">(</span><em>wsgi_input</em>, <em>mime_boundary</em>, <em>read_chunk_size</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.server.iter_mime_headers_and_bodies" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-swift.obj.updater">
<span id="id6"></span><span id="object-updater"></span><h2>Object Updater<a class="headerlink" href="#module-swift.obj.updater" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="swift.obj.updater.ObjectUpdater">
<em class="property">class </em><code class="descclassname">swift.obj.updater.</code><code class="descname">ObjectUpdater</code><span class="sig-paren">(</span><em>conf</em>, <em>logger=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.ObjectUpdater" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">swift.common.daemon.Daemon</span></code></p>
<p>Update object information in container listings.</p>
<dl class="method">
<dt id="swift.obj.updater.ObjectUpdater.get_container_ring">
<code class="descname">get_container_ring</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.ObjectUpdater.get_container_ring" title="Permalink to this definition"></a></dt>
<dd><p>Get the container ring.  Load it, if it hasn’t been yet.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.updater.ObjectUpdater.object_sweep">
<code class="descname">object_sweep</code><span class="sig-paren">(</span><em>device</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.ObjectUpdater.object_sweep" title="Permalink to this definition"></a></dt>
<dd><p>If there are async pendings on the device, walk each one and update.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>device</strong> – path to device</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.updater.ObjectUpdater.object_update">
<code class="descname">object_update</code><span class="sig-paren">(</span><em>node</em>, <em>part</em>, <em>op</em>, <em>obj</em>, <em>headers_out</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.ObjectUpdater.object_update" title="Permalink to this definition"></a></dt>
<dd><p>Perform the object update to the container</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>node</strong> – node dictionary from the container ring</li>
<li><strong>part</strong> – partition that holds the container</li>
<li><strong>op</strong> – operation performed (ex: ‘PUT’ or ‘DELETE’)</li>
<li><strong>obj</strong> – object name being updated</li>
<li><strong>headers_out</strong> – headers to send with the update</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.updater.ObjectUpdater.process_object_update">
<code class="descname">process_object_update</code><span class="sig-paren">(</span><em>update_path</em>, <em>device</em>, <em>policy</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.ObjectUpdater.process_object_update" title="Permalink to this definition"></a></dt>
<dd><p>Process the object information to be updated and update.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>update_path</strong> – path to pickled object update file</li>
<li><strong>device</strong> – path to device</li>
<li><strong>policy</strong> – storage policy of object update</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swift.obj.updater.ObjectUpdater.run_forever">
<code class="descname">run_forever</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.ObjectUpdater.run_forever" title="Permalink to this definition"></a></dt>
<dd><p>Run the updater continuously.</p>
</dd></dl>

<dl class="method">
<dt id="swift.obj.updater.ObjectUpdater.run_once">
<code class="descname">run_once</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.ObjectUpdater.run_once" title="Permalink to this definition"></a></dt>
<dd><p>Run the updater once.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swift.obj.updater.SweepStats">
<em class="property">class </em><code class="descclassname">swift.obj.updater.</code><code class="descname">SweepStats</code><span class="sig-paren">(</span><em>errors=0</em>, <em>failures=0</em>, <em>quarantines=0</em>, <em>successes=0</em>, <em>unlinks=0</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.SweepStats" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Stats bucket for an update sweep</p>
<dl class="method">
<dt id="swift.obj.updater.SweepStats.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.SweepStats.copy" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.updater.SweepStats.reset">
<code class="descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.SweepStats.reset" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swift.obj.updater.SweepStats.since">
<code class="descname">since</code><span class="sig-paren">(</span><em>other</em><span class="sig-paren">)</span><a class="headerlink" href="#swift.obj.updater.SweepStats.since" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="function">
<dt id="swift.obj.updater.random">
<code class="descclassname">swift.obj.updater.</code><code class="descname">random</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; x in the interval [0, 1).<a class="headerlink" href="#swift.obj.updater.random" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
</div>


              </div>
            </div>
          </div>
          <div class="docs-actions">
          
            <a href="db.html"><i class="fa fa-angle-double-left" data-toggle="tooltip" data-placement="top" title="Previous: Account DB and Container DB"></i></a>
          
          
            <a href="misc.html"><i class="fa fa-angle-double-right" data-toggle="tooltip" data-placement="top" title="Next: Misc"></i></a>
          
            <a id="logABugLink3" href="" target="_blank" title="Found an error? Report a bug against this page"><i class="fa fa-bug" data-toggle="tooltip" data-placement="top" title="Report a Bug"></i></a>
          
          </div>
          <div class="row docs-byline bottom">
            <div class="docs-updated">updated: 2018-02-14 14:24</div>
          </div>
          <div class="row">
            <div class="col-lg-8 col-md-8 col-sm-8 docs-license">
<a href="https://creativecommons.org/licenses/by/3.0/">
 <img src="_static/images/docs/license.png" alt="Creative Commons Attribution 3.0 License"/>
</a>
<p>
 Except where otherwise noted, this document is licensed under
 <a href="https://creativecommons.org/licenses/by/3.0/">Creative Commons
 Attribution 3.0 License</a>. See all <a href="http://www.openstack.org/legal">
 OpenStack Legal Documents</a>.
</p>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-4 docs-actions-wrapper">
            <!-- ID buglinkbottom added so that pre-filled doc bugs
                 are sent to Launchpad projects related to the
                 document -->
              <a href="#" id="logABugLink2" class="docs-footer-actions"><i class="fa fa-bug"></i> found an error? report a bug</a>
              <a href="http://ask.openstack.org" class="docs-footer-actions"><i class="fa fa-question-circle"></i> questions?</a>
            </div>
          </div>
        </div>
<div class="col-lg-3 col-md-4 col-sm-4 col-lg-pull-9 col-md-pull-8 col-sm-pull-8 docs-sidebar">
  <div class="btn-group docs-sidebar-releases">
    <button onclick="location.href='/'" class="btn docs-sidebar-home" data-toggle="tooltip" data-placement="top" title="Docs Home"><i class="fa fa-arrow-circle-o-left"></i></button>
<button href="#" type="button" data-toggle="dropdown" class="btn docs-sidebar-release-select">OpenStack Documentation<i class="fa fa-caret-down"></i></button>
    <ul class="dropdown-menu docs-sidebar-dropdown" role="menu" aria-labelledby="dLabel">
      <li role="presentation" class="dropdown-header">Guides</li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/index.html#install-guides">Install Guides</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/index.html#user-guides">User Guides</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/index.html#configuration-guides">Configuration Guides</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/index.html#ops-and-admin-guides">Operations and Administration Guides</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/index.html#api-guides">API Guides</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/index.html#contributor-guides">Contributor Guides</a></li>
      <li role="presentation" class="dropdown-header">Languages</li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/de/">Deutsch (German)</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/fr/">Français (French)</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/id/">Bahasa Indonesia (Indonesian)</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/it/">Italiano (Italian)</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/ja/">日本語 (Japanese)</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/ko_KR/">한국어 (Korean)</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/pt_BR/">Português (Portuguese)</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/tr_TR/">Türkçe (Türkiye)</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="http://docs.openstack.org/zh_CN/">简体中文 (Simplified Chinese)</a></li>
    </ul>
  </div>
  <div class="docs-sidebar-toc">
    <div class="docs-sidebar-section" id="table-of-contents">
      <a href="index.html" class="docs-sidebar-section-title"><h4>Swift 2.17</h4></a>
      <ul>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="api/object_api_v1_overview.html">Object Storage API overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_architecture.html">Swift Architectural Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_ring.html">The Rings</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_policies.html">Storage Policies</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_reaper.html">The Account Reaper</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_auth.html">The Auth System</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_acl.html">Access Control Lists (ACLs)</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_replication.html">Replication</a></li>
<li class="toctree-l1"><a class="reference internal" href="ratelimit.html">Rate Limiting</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_large_objects.html">Large Object Support</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_object_versioning.html">Object Versioning</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_global_cluster.html">Global Clusters</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_container_sync.html">Container to Container Synchronization</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_expiring_objects.html">Expiring Object Support</a></li>
<li class="toctree-l1"><a class="reference internal" href="cors.html">CORS</a></li>
<li class="toctree-l1"><a class="reference internal" href="crossdomain.html">Cross-domain Policy File</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_erasure_code.html">Erasure Code Support</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_encryption.html">Object Encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview_backing_store.html">Using Swift as Backing Store for Service Data</a></li>
<li class="toctree-l1"><a class="reference internal" href="ring_background.html">Building a Consistent Hashing Ring</a></li>
<li class="toctree-l1"><a class="reference internal" href="ring_partpower.html">Modifying Ring Partition Power</a></li>
<li class="toctree-l1"><a class="reference internal" href="associated_projects.html">Associated Projects</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="development_guidelines.html">Development Guidelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="development_saio.html">SAIO - Swift All In One</a></li>
<li class="toctree-l1"><a class="reference internal" href="first_contribution_swift.html">First Contribution to Swift</a></li>
<li class="toctree-l1"><a class="reference internal" href="policies_saio.html">Adding Storage Policies to an Existing SAIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="development_auth.html">Auth Server and Middleware</a></li>
<li class="toctree-l1"><a class="reference internal" href="development_middleware.html">Middleware and Metadata</a></li>
<li class="toctree-l1"><a class="reference internal" href="development_ondisk_backends.html">Pluggable On-Disk Back-end APIs</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="howto_installmultinode.html">Instructions for a Multiple Server Swift Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="deployment_guide.html">Deployment Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_deployment_guide.html">Apache Deployment Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="admin_guide.html">Administrator’s Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="replication_network.html">Dedicated replication network</a></li>
<li class="toctree-l1"><a class="reference internal" href="logs.html">Logs</a></li>
<li class="toctree-l1"><a class="reference internal" href="ops_runbook/index.html">Swift Ops Runbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="admin/index.html">OpenStack Swift Administrator Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="install/index.html">Object Storage Install Guide</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="api/object_api_v1_overview.html">Object Storage API overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/discoverability.html">Discoverability</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/authentication.html">Authentication</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/container_quotas.html">Container quotas</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/object_versioning.html">Object versioning</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/large_objects.html">Large objects</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/temporary_url_middleware.html">Temporary URL middleware</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/form_post_middleware.html">Form POST middleware</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/use_content-encoding_metadata.html">Use Content-Encoding metadata</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/use_the_content-disposition_metadata.html">Use the Content-Disposition metadata</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="ring.html">Partitioned Consistent Hash Ring</a></li>
<li class="toctree-l1"><a class="reference internal" href="proxy.html">Proxy</a></li>
<li class="toctree-l1"><a class="reference internal" href="account.html">Account</a></li>
<li class="toctree-l1"><a class="reference internal" href="container.html">Container</a></li>
<li class="toctree-l1"><a class="reference internal" href="db.html">Account DB and Container DB</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Object</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#module-swift.obj.auditor">Object Auditor</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-swift.obj.diskfile">Object Backend</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-swift.obj.replicator">Object Replicator</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-swift.obj.reconstructor">Object Reconstructor</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-swift.obj.server">Object Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-swift.obj.updater">Object Updater</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="misc.html">Misc</a></li>
<li class="toctree-l1"><a class="reference internal" href="middleware.html">Middleware</a></li>
</ul>

    </div>

  <div class="docs-sidebar-toc">
    <div class="docs-sidebar-section" id="local-table-of-contents">
      <h4 class="docs-sidebar-section-title">Page Contents</h4>
      <ul>
<li><a class="reference internal" href="#">Object</a><ul>
<li><a class="reference internal" href="#module-swift.obj.auditor">Object Auditor</a></li>
<li><a class="reference internal" href="#module-swift.obj.diskfile">Object Backend</a></li>
<li><a class="reference internal" href="#module-swift.obj.replicator">Object Replicator</a></li>
<li><a class="reference internal" href="#module-swift.obj.reconstructor">Object Reconstructor</a></li>
<li><a class="reference internal" href="#module-swift.obj.server">Object Server</a></li>
<li><a class="reference internal" href="#module-swift.obj.updater">Object Updater</a></li>
</ul>
</li>
</ul>

    </div>
  </div>
  </div>
</div>
      </div>
    </div>
<footer>
  <div class="container">
    <div class="row footer-links">
      <div class="col-lg-2 col-sm-2">
        <h3>OpenStack</h3>
        <ul>
          <li><a href="http://openstack.org/projects/">Projects</a></li>
          <li><a href="http://openstack.org/projects/openstack-security/">OpenStack Security</a></li>
          <li><a href="http://openstack.org/projects/openstack-faq/">Common Questions</a></li>
          <li><a href="http://openstack.org/blog/">Blog</a></li>
          <li><a href="http://openstack.org/news/">News</a></li>
        </ul>
      </div>
      <div class="col-lg-2 col-sm-2">
        <h3>Community</h3>
        <ul>
          <li><a href="http://openstack.org/community/">User Groups</a></li>
          <li><a href="http://openstack.org/community/events/">Events</a></li>
          <li><a href="http://openstack.org/community/jobs/">Jobs</a></li>
          <li><a href="http://openstack.org/foundation/companies/">Companies</a></li>
          <li><a href="http://docs.openstack.org/infra/manual/developers.html">Contribute</a></li>
        </ul>
      </div>
      <div class="col-lg-2 col-sm-2">
        <h3>Documentation</h3>
        <ul>
          <li><a href="http://docs.openstack.org">OpenStack Manuals</a></li>
          <li><a href="http://openstack.org/software/start/">Getting Started</a></li>
          <li><a href="http://developer.openstack.org">API Documentation</a></li>
          <li><a href="https://wiki.openstack.org">Wiki</a></li>
        </ul>
      </div>
      <div class="col-lg-2 col-sm-2">
        <h3>Branding & Legal</h3>
        <ul>
          <li><a href="http://openstack.org/brand/">Logos & Guidelines</a></li>
          <li><a href="http://openstack.org/brand/openstack-trademark-policy/">Trademark Policy</a></li>
          <li><a href="http://openstack.org/privacy/">Privacy Policy</a></li>
          <li><a href="https://wiki.openstack.org/wiki/How_To_Contribute#Contributor_License_Agreement">OpenStack CLA</a></li>
        </ul>
      </div>
      <div class="col-lg-4 col-sm-4">
        <h3>Stay In Touch</h3>
        <a href="https://twitter.com/OpenStack" target="_blank" class="social-icons footer-twitter"></a>
        <a href="https://www.facebook.com/openstack" target="_blank" class="social-icons footer-facebook"></a>
        <a href="https://www.linkedin.com/company/openstack" target="_blank" class="social-icons footer-linkedin"></a>
        <a href="https://www.youtube.com/user/OpenStackFoundation" target="_blank" class="social-icons footer-youtube"></a>
        <p class="fine-print">
          The OpenStack project is provided under the
          <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 license</a>. Openstack.org is powered by
          <a href="http://rackspace.com" target="_blank">Rackspace Cloud Computing</a>.
        </p>
      </div>
    </div>
  </div>
</footer>
<!-- jQuery -->
<script type="text/javascript" src="_static/js/jquery-3.2.1.min.js"></script>

<!-- Bootstrap JavaScript -->
<script type="text/javascript" src="_static/js/bootstrap.min.js"></script>

<!-- The rest of the JS -->
<script type="text/javascript" src="_static/js/navigation.js"></script>

<!-- Docs JS -->
<script type="text/javascript" src="_static/js/docs.js"></script>

<!-- Popovers -->
<script type="text/javascript" src="_static/js/webui-popover.js"></script>

<!-- standard sphinx include libraries, which allow search highlighting -->
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/searchtools.js"></script>

<script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '2.17',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        SOURCELINK_SUFFIX: '.txt',
        HAS_SOURCE:  true
      };
</script>


<!-- Javascript for page -->
<script language="JavaScript">
/* build a description of this page including SHA, source location on git repo,
   build time and the project's launchpad bug tag. Set the HREF of the bug
   buttons */

    var lineFeed = "%0A";
    var gitURL = "Source: Can't derive source file URL";

    /* there have been cases where "pagename" wasn't set; better check for it */
        /* The URL of the source file on Git is based on the giturl variable
           in conf.py, which must be manually initialized to the source file
           URL in Git.
           "pagename" is a standard sphinx parameter containing the name of
           the source file, without extension.                             */

        var sourceFile = "object" + ".rst";
        gitURL = "Source: https://git.openstack.org/cgit/openstack/swift/tree/doc/source" + "/" + sourceFile;

    /* gitsha, project and bug_tag rely on variables in conf.py */
    var gitSha = "SHA: unknown";
        var bugProject = "swift";
        var bugTitle = "Object in Swift";
    var fieldTags = "";
        var useStoryboard = "";


    /* "last_updated" is the build date and time. It relies on the
       conf.py variable "html_last_updated_fmt", which should include
       year/month/day as well as hours and minutes                   */
    var buildstring = "Release: 2.17.0 on 2018-02-14 14:24";

    var fieldComment = encodeURI(buildstring) +
                       lineFeed + encodeURI(gitSha) +
                       lineFeed + encodeURI(gitURL) ;

    logABug(bugTitle, bugProject, fieldComment, fieldTags);
</script>

  </body>
</html>