Object Server for Swift
Bases: object
Manage object files on disk.
Parameters: |
|
---|
Returns an iterator over the data file for range (start, stop)
Close the file.
Check if the file is deleted.
Returns: | True if the file doesn’t exist or has been flagged as deleted. |
---|
Contextmanager to make a temporary file.
Finalize writing the file on disk, and renames it from the temp file to the real location. This should be called after the data has been written to the temp file.
Params fd: | file descriptor of the temp file |
---|---|
Parameters: |
|
Remove any older versions of the object file. Any file that has an older timestamp than timestamp will be deleted.
Parameters: |
|
---|
Bases: object
Implements the WSGI application for the Swift Object Server.
Handle HTTP DELETE requests for the Swift Object Server.
Handle HTTP GET requests for the Swift Object Server.
Handle HTTP HEAD requests for the Swift Object Server.
Handle HTTP POST requests for the Swift Object Server.
Handle HTTP PUT requests for the Swift Object Server.
Handle REPLICATE requests for the Swift Object Server. This is used by the object replicator to get hashes for directories.
Update the container when objects are updated.
Parameters: |
|
---|
Helper function to read the pickled metadata from an object file.
Parameters: |
|
---|---|
Returns: | dictionary of metadata |
Bases: object
Replicate objects.
Encapsulates most logic and data needed by the object replication process. Each call to .run() performs one replication pass. It’s up to the caller to do this in a loop.
Check to see if the ring has been updated
Returns: | boolean indicating whether or not the ring has changed |
---|
Loop that runs in the background during replication. It periodically logs progress and attempts to detect lockups, killing any running coroutines if the replicator hasn’t made progress since last hearbeat.
Utility function that kills all coroutines currently running.
Synchronize local suffix directories from a partition with a remote node.
Parameters: |
|
---|---|
Returns: | boolean indicating success or failure |
Run a replication pass
Logs various stats for the currently running replication pass.
High-level method that replicates a single partition.
Parameters: |
|
---|
High-level method that replicates a single partition that doesn’t belong on this node.
Parameters: |
|
---|
Get a list of hashes for the suffix dir. do_listdir causes it to mistrust the hash cache for suffix existence at the (unexpectedly high) cost of a listdir. reclaim_age is just passed on to hash_suffix.
Parameters: |
|
---|---|
Returns: | tuple of (number of suffix dirs hashed, dictionary of hashes) |
Performs reclamation and returns an md5 of all (remaining) files.
Parameters: |
|
---|
Invalidates the hash for a suffix_dir in the partition’s hashes file.
Parameters: |
|
---|
Recalculates hashes for the given suffixes in the partition and updates them in the partition’s hashes file.
Parameters: |
|
---|
Bases: object
Update object information in container listings.
Get the container ring. Load it, if it hasn’t been yet.
If there are async pendings on the device, walk each one and update.
Parameters: |
|
---|
Perform the object update to the container
Parameters: |
|
---|
Process the object information to be updated and update.
Parameters: |
|
---|
Run the updater continuously.
Run the updater once
random() -> x in the interval [0, 1).
Bases: object
Audit objects.
Run the object audit until stopped.
Run the object audit once.
Get the container ring, loading it if neccesary.
Returns: | container ring |
---|
Walk the device, and audit any objects found.
random() -> x in the interval [0, 1).