Skip to content

Commit

Permalink
Updated status_codes
Browse files Browse the repository at this point in the history
  • Loading branch information
nmassey001 committed Nov 5, 2024
1 parent d34cc05 commit b998eef
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 48 deletions.
12 changes: 6 additions & 6 deletions docs/user_guide/source/status_codes.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Value,State,Description
``2``,``'INDEXING'``,Scanning the files and directories in the PUT transaction.
``3``,``'CATALOG_PUTTING'``,Recording the scanned files into the catalog entry for the transaction.
``4``,``'TRANSFER_PUTTING'``,"Putting the files to the NLDS, actually transferring the data. "
``5``,``'CATALOG_ROLLBACK'``,"Remove, from the catalog, any inaccessible files in the transaction."
``10``,``'CATALOG_GETTING'``,Get a catalog entry.
``11``,``'ARCHIVE_GETTING'``,Getting the files from the NLDS tape store.
``12``,``'TRANSFER_GETTING'``,Getting the files from the NLDS cache.
``12``,``'TRANSFER_GETTING'``,Getting the files from the NLDS object store cache.
``20``,``'ARCHIVE_INIT'``,Archive transaction is starting.
``21``,``'CATALOG_ARCHIVE_AGGREGATING'``,Aggregating files for a tape write.
``22``,``'ARCHIVE_PUTTING'``,Putting the aggregated files into the tape store from the NLDS cache.
``23``,``'CATALOG_ARCHIVE_UPDATING'``,Updating the catalog with post-tape-write information.
``40``,``'CATALOG_ARCHIVE_ROLLBACK'``,Remove tape entries from the catalog if something went wrong during tape-write.
``21``,``'ARCHIVE_PUTTING'``,Putting the aggregated files into the tape store from the NLDS cache.
``30``,``'CATALOG_DELETING'``,"Remove, from the catalog, any inaccessible files in the transaction."
``31``,``'CATALOG_UPDATING``,Updating the catalog with post object store write
``32``,``'CATALOG_ARCHIVE_UPDATING'``,Updating the catalog with post tape write information.
``33``,``'CATALOG_REMOVING'``,"Remove, from the catalog, any empty storage locations. This occurs if a write to tape or restore to object store fails.
``100``,``'COMPLETE'``,Transaction has completed successfully.
``101``,``'FAILED'``,Transaction has failed completely.
``102``,``'COMPLETE_WITH_ERRORS'``,"Transaction has completed, but with some errors."
Expand Down
82 changes: 40 additions & 42 deletions nlds_client/clientlib/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,51 +801,49 @@ def get_transaction_state(transaction: dict):
}
possible values of state are:
INITIALISING = -1
ROUTING = 0
SPLITTING = 1
INDEXING = 2
CATALOG_PUTTING = 3
TRANSFER_PUTTING = 4
CATALOG_ROLLBACK = 5
CATALOG_UPDATING = 6
CATALOG_GETTING = 10
ARCHIVE_GETTING = 11
TRANSFER_GETTING = 12
ARCHIVE_INIT = 20
CATALOG_ARCHIVE_AGGREGATING = 21
ARCHIVE_PUTTING = 22
CATALOG_ARCHIVE_UPDATING = 23
CATALOG_ARCHIVE_ROLLBACK = 40
COMPLETE = 100
FAILED = 101
COMPLETE_WITH_ERRORS = 102
COMPLETE_WITH_WARNINGS = 103
INITIALISING = -1
ROUTING = 0
SPLITTING = 1
INDEXING = 2
CATALOG_PUTTING = 3
TRANSFER_PUTTING = 4
CATALOG_GETTING = 10
ARCHIVE_GETTING = 11
TRANSFER_GETTING = 12
ARCHIVE_INIT = 20
ARCHIVE_PUTTING = 21
CATALOG_DELETING = 30
CATALOG_UPDATING = 31
CATALOG_ARCHIVE_UPDATING = 32
CATALOG_REMOVING = 33
COMPLETE = 100
FAILED = 101
COMPLETE_WITH_ERRORS = 102
COMPLETE_WITH_WARNINGS = 103
SEARCHING = 1000
The overall state is the minimum of these
"""
state_mapping = {
"INITIALISING": -1,
"ROUTING": 0,
"SPLITTING": 1,
"INDEXING": 2,
"CATALOG_PUTTING": 3,
"TRANSFER_PUTTING": 4,
"CATALOG_ROLLBACK": 5,
"CATALOG_UPDATING": 6,
"CATALOG_GETTING": 10,
"ARCHIVE_GETTING": 11,
"TRANSFER_GETTING": 12,
"ARCHIVE_INIT": 20,
"CATALOG_ARCHIVE_AGGREGATING": 21,
"ARCHIVE_PUTTING": 22,
"CATALOG_ARCHIVE_UPDATING": 23,
"CATALOG_ARCHIVE_REMOVING": 40,
"CATALOG_DELETE_ROLLBACK": 41,
"CATALOG_RESTORING": 42,
"COMPLETE": 100,
"FAILED": 101,
"COMPLETE_WITH_ERRORS": 102,
"COMPLETE_WITH_WARNINGS": 103,
"INITIALISING" : -1,
"ROUTING" : 0,
"SPLITTING" : 1,
"INDEXING" : 2,
"CATALOG_PUTTING" : 3,
"TRANSFER_PUTTING" : 4,
"CATALOG_GETTING" : 10,
"ARCHIVE_GETTING" : 11,
"TRANSFER_GETTING" : 12,
"ARCHIVE_INIT" : 20,
"ARCHIVE_PUTTING" : 21,
"CATALOG_DELETING" : 30,
"CATALOG_UPDATING" : 31,
"CATALOG_ARCHIVE_UPDATING" : 32,
"CATALOG_REMOVING" : 33,
"COMPLETE" : 100,
"FAILED" : 101,
"COMPLETE_WITH_ERRORS" : 102,
"COMPLETE_WITH_WARNINGS" : 103,
"SEARCHING" : 1000,
}
state_mapping_reverse = {v: k for k, v in state_mapping.items()}

Expand Down

0 comments on commit b998eef

Please sign in to comment.