append_file_i Class Reference

Inherits scan_file_i.

Inheritance diagram for append_file_i:

Inheritance graph
[legend]
Collaboration diagram for append_file_i:

Collaboration graph
[legend]
List of all members.

Detailed Description

Pseudo-iterator used to append to a file.

Just creating a record doesn't ensure that it appears at the end of the file; when new pages are allocated, they could be in extents in the middle of the file, and unused slots in pages in the middle of the file can be scavenged for create_rec.

If you want to ensure that the records are appended to a file, use this.

Attention:
Clearly, this cannot be used in a meaningful way when other threads are updating the same file. The constructor acquires an exclusive lock on the file to protect it from updates by other transactions, but this does not protect it from updates from other threads in the same transaction. The server must ensure that no more than one thread attached to the locking transaction is using the file, and that the only use of the file is through the append_file_i while the instance exists.

Definition at line 608 of file scan.h.

Public Member Functions

NORET append_file_i (const stid_t &stid)
 Construct an append_file_i for a given file.
rc_t next (pin_i *&pin_ptr, smsize_t start_offset, bool &eof)
 Place-holder method. Returns error.
rc_t create_rec (const vec_t &hdr, smsize_t len_hint, const vec_t &data, rid_t &rid)
 Append a new record to the end of the file.


Constructor & Destructor Documentation

NORET append_file_i::append_file_i ( const stid_t stid  ) 

Construct an append_file_i for a given file.

Parameters:
[in] stid ID of the file in which to create records.


Member Function Documentation

rc_t append_file_i::next ( pin_i *&  pin_ptr,
smsize_t  start_offset,
bool &  eof 
)

Place-holder method. Returns error.

You cannot scan with an append_file_i.

Reimplemented from scan_file_i.


The documentation for this class was generated from the following file:
Generated on Wed Jul 7 17:22:42 2010 for Shore Storage Manager by  doxygen 1.4.7