Skip to content
Snippets Groups Projects
Commit ec89a55f authored by Peter J. Keleher's avatar Peter J. Keleher
Browse files

auto

parent 14942b20
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,8 @@ explains this quite well: [https://docs.python.org/3/library/threading.html](Hig
- Two other primitives build on top of the above: `Conditions` and `Events`. See the manual for the details on those. We use `Conditions` in `transactions.py` to signal threads.
- Using `with` simplifies this: a Lock/RLock/Condition/Event is passed as an argument, and only one thread can be in the body of the `with`.
## Files
#### `disk_relations.py`
A `Relation` is backed by a file in the file system, i.e., all the data in the relation is written to a file and is read from a file. If a Relation is created with a non-existing fileName, then a new Relation is created with pre-populated 100 tuples. The file is an ASCII file -- the reading and writing is using `json` module.
......@@ -46,6 +48,9 @@ relations and tuples). **The code here and elsewhere implicitly assumes that the
- `class TransactionState`: This class encapsulates some of the basic functionality of transactions, including some helper functions to create log records, keeping track of
what locks the transaction currently holds, etc.
### Example logs and relations
In `recoverytests-original/` and `recoverytests-answers/`
#### Development
There are two testing files, `testingLocks.py` and `testingRecovery.py` ("testingX" means both), one for working
......@@ -128,9 +133,6 @@ will also check for the lock messages ("able to get this lock on...", etc.).
Our testing will check both the contents of the database (the final versions of
the relation file) and the `logfile`.
**NOTE: correct example files will be provided soon.**
### Submission
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment