Revise the SimpleDB record manager to handle null field values. Since it is unreasonable to use a particular integer or string value to denote a null, you should use flags to specify which values are...


Revise the SimpleDB record manager to handle null field values. Since it is unreasonable to use a particular integer or string value to denote a null, you should use flags to specify which values are null. In particular, suppose that a record contains N fields. Then you can store N additional bits with each record, such that the value of the ith bit is 1 iff the value of the ith field is null. Assuming that N<32,>


• Modify Layout so that it has a method bitLocation(fldname), which returns the position in the flag where the field’s null information bit is located.


• Modify RecordPage and TableScan to have two additional public methods: a void method setNull(fldname), which stores a 1 in the appropriate bit of the flag, and a boolean method isNull(fldname), which returns true if the null-bit for the specified field of the current record is 1.


• Modify the format method of RecordPage to explicitly set of the fields of the new record to non-null.


• Modify the setString and setInt methods to set the specified field to non-null.



Jan 16, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here