MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / metaLockTester

Method metaLockTester

test/simpledb/LockingTest.java:73–80  ·  view source on GitHub ↗

Generic unit test structure for BufferPool.getPage() assuming locking. @param tid1 the first transaction Id @param pid1 the first page to lock over @param perm1 the type of lock for the first page @param tid2 the second transaction Id @param pid2 the second page to lock over @param perm2 the type o

(
      TransactionId tid1, PageId pid1, Permissions perm1,
      TransactionId tid2, PageId pid2, Permissions perm2,
      boolean expected)

Source from the content-addressed store, hash-verified

71 * false otherwise
72 */
73 public void metaLockTester(
74 TransactionId tid1, PageId pid1, Permissions perm1,
75 TransactionId tid2, PageId pid2, Permissions perm2,
76 boolean expected) throws Exception {
77
78 bp.getPage(tid1, pid1, perm1);
79 grabLock(tid2, pid2, perm2, expected);
80 }
81
82 /**
83 * Generic unit test structure to grab an additional lock in a new

Calls 2

grabLockMethod · 0.95
getPageMethod · 0.45

Tested by

no test coverage detected