OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
File_Namespace::FileInfo Struct Reference

#include <FileInfo.h>

+ Collaboration diagram for File_Namespace::FileInfo:

Public Member Functions

 FileInfo (FileMgr *fileMgr, const int32_t fileId, FILE *f, const size_t pageSize, const size_t numPages, const std::string &file_path, const bool init=false)
 Constructor. More...
 
 ~FileInfo ()
 Destructor. More...
 
void initNewFile ()
 Adds all pages to freePages and zeroes first four bytes of header. More...
 
void freePageDeferred (int32_t pageId)
 
void freePage (int32_t pageId, const bool isRolloff, int32_t epoch)
 
int32_t getFreePage ()
 
size_t write (const size_t offset, const size_t size, const int8_t *buf)
 
size_t read (const size_t offset, const size_t size, int8_t *buf)
 
void openExistingFile (std::vector< HeaderInfo > &headerVec)
 
std::string print () const
 Prints a summary of the file to stdout. More...
 
size_t size () const
 Returns the number of bytes used by the file. More...
 
int32_t syncToDisk ()
 
size_t available () const
 Returns the number of free bytes available. More...
 
size_t numFreePages () const
 Returns the number of free pages available. More...
 
std::set< size_t > getFreePages () const
 
size_t used () const
 Returns the amount of used bytes; size() - available() More...
 
void freePageImmediate (int32_t page_num)
 
void recoverPage (const ChunkKey &chunk_key, int32_t page_num)
 

Public Attributes

FileMgrfileMgr
 
int32_t fileId
 
FILE * f
 unique file identifier (i.e., used for a file name) More...
 
size_t pageSize
 file stream object for the represented file More...
 
size_t numPages
 the fixed size of each page in the file More...
 
bool isDirty {false}
 the number of pages in the file More...
 
std::set< size_t > freePages
 
std::string file_path
 set of page numbers of free pages More...
 
std::mutex freePagesMutex_
 
std::mutex readWriteMutex_
 

Detailed Description

Definition at line 55 of file FileInfo.h.

Constructor & Destructor Documentation

File_Namespace::FileInfo::FileInfo ( FileMgr fileMgr,
const int32_t  fileId,
FILE *  f,
const size_t  pageSize,
const size_t  numPages,
const std::string &  file_path,
const bool  init = false 
)

Constructor.

Definition at line 31 of file FileInfo.cpp.

References initNewFile().

38  : fileMgr(fileMgr)
39  , fileId(fileId)
40  , f(f)
43  , file_path(file_path) {
44  if (init) {
45  initNewFile();
46  }
47 }
std::string file_path
set of page numbers of free pages
Definition: FileInfo.h:63
size_t pageSize
file stream object for the represented file
Definition: FileInfo.h:59
void init(LogOptions const &log_opts)
Definition: Logger.cpp:360
void initNewFile()
Adds all pages to freePages and zeroes first four bytes of header.
Definition: FileInfo.cpp:56
FILE * f
unique file identifier (i.e., used for a file name)
Definition: FileInfo.h:58
size_t numPages
the fixed size of each page in the file
Definition: FileInfo.h:60

+ Here is the call graph for this function:

File_Namespace::FileInfo::~FileInfo ( )

Destructor.

Definition at line 49 of file FileInfo.cpp.

References File_Namespace::close(), and f.

49  {
50  // close file, if applicable
51  if (f) {
52  close(f);
53  }
54 }
FILE * f
unique file identifier (i.e., used for a file name)
Definition: FileInfo.h:58
void close(FILE *f)
Closes the file pointed to by the FILE pointer.
Definition: File.cpp:128

+ Here is the call graph for this function:

Member Function Documentation

size_t File_Namespace::FileInfo::available ( ) const
inline

Returns the number of free bytes available.

Definition at line 102 of file FileInfo.h.

References numFreePages(), and pageSize.

Referenced by print(), and used().

102 { return numFreePages() * pageSize; }
size_t numFreePages() const
Returns the number of free pages available.
Definition: FileInfo.h:105
size_t pageSize
file stream object for the represented file
Definition: FileInfo.h:59

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void File_Namespace::FileInfo::freePage ( int32_t  pageId,
const bool  isRolloff,
int32_t  epoch 
)

Definition at line 191 of file FileInfo.cpp.

References CHECK, File_Namespace::DELETE_CONTINGENT, f, fileMgr, File_Namespace::FileMgr::free_page(), isDirty, pageSize, readWriteMutex_, File_Namespace::ROLLOFF_CONTINGENT, and File_Namespace::write().

Referenced by File_Namespace::FileBuffer::freePage(), and File_Namespace::CachingFileMgr::updatePageIfDeleted().

191  {
192  std::lock_guard<std::mutex> lock(readWriteMutex_);
193  int32_t epoch_freed_page[2] = {DELETE_CONTINGENT, epoch};
194  if (isRolloff) {
195  epoch_freed_page[0] = ROLLOFF_CONTINGENT;
196  }
198  pageId * pageSize + sizeof(int32_t),
199  sizeof(epoch_freed_page),
200  reinterpret_cast<const int8_t*>(epoch_freed_page));
201  fileMgr->free_page(std::make_pair(this, pageId));
202  isDirty = true;
203 
204 #ifdef ENABLE_CRASH_CORRUPTION_TEST
205  signal(SIGUSR2, sighandler);
206  if (goto_crash)
207  CHECK(pageId % 8 != 4);
208 #endif
209 }
std::mutex readWriteMutex_
Definition: FileInfo.h:65
size_t write(FILE *f, const size_t offset, const size_t size, const int8_t *buf)
Writes the specified number of bytes to the offset position in file f from buf.
Definition: File.cpp:160
size_t pageSize
file stream object for the represented file
Definition: FileInfo.h:59
constexpr int32_t DELETE_CONTINGENT
A FileInfo type has a file pointer and metadata about a file.
Definition: FileInfo.h:51
constexpr int32_t ROLLOFF_CONTINGENT
Definition: FileInfo.h:52
virtual void free_page(std::pair< FileInfo *, int32_t > &&page)
Definition: FileMgr.cpp:1201
FILE * f
unique file identifier (i.e., used for a file name)
Definition: FileInfo.h:58
#define CHECK(condition)
Definition: Logger.h:291
bool isDirty
the number of pages in the file
Definition: FileInfo.h:61

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void File_Namespace::FileInfo::freePageDeferred ( int32_t  pageId)

Definition at line 176 of file FileInfo.cpp.

References freePages, and freePagesMutex_.

Referenced by freePageImmediate().

176  {
177  std::lock_guard<std::mutex> lock(freePagesMutex_);
178  freePages.insert(pageId);
179 }
std::set< size_t > freePages
Definition: FileInfo.h:62
std::mutex freePagesMutex_
Definition: FileInfo.h:64

+ Here is the caller graph for this function:

void File_Namespace::FileInfo::freePageImmediate ( int32_t  page_num)

Definition at line 252 of file FileInfo.cpp.

References f, freePageDeferred(), g_multi_instance, g_read_only, pageSize, and File_Namespace::write().

Referenced by openExistingFile(), and File_Namespace::FileMgr::updatePageIfDeleted().

252  {
253  // we should not get here but putting protection in place
254  // as it seems we are no guaranteed to have f/synced so
255  // protecting from RO trying to write
256  if (!g_read_only && !g_multi_instance) {
257  int32_t zero{0};
259  f, page_num * pageSize, sizeof(int32_t), reinterpret_cast<const int8_t*>(&zero));
260  freePageDeferred(page_num);
261  }
262 }
bool g_multi_instance
Definition: heavyai_locks.h:21
size_t write(FILE *f, const size_t offset, const size_t size, const int8_t *buf)
Writes the specified number of bytes to the offset position in file f from buf.
Definition: File.cpp:160
size_t pageSize
file stream object for the represented file
Definition: FileInfo.h:59
bool g_read_only
Definition: File.cpp:40
FILE * f
unique file identifier (i.e., used for a file name)
Definition: FileInfo.h:58
void freePageDeferred(int32_t pageId)
Definition: FileInfo.cpp:176

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int32_t File_Namespace::FileInfo::getFreePage ( )

Definition at line 211 of file FileInfo.cpp.

References freePages, and freePagesMutex_.

Referenced by File_Namespace::FileMgr::copySourcePageForCompaction(), File_Namespace::FileMgr::requestFreePage(), File_Namespace::CachingFileMgr::requestFreePage(), and File_Namespace::FileMgr::requestFreePages().

211  {
212  // returns -1 if there is no free page
213  std::lock_guard<std::mutex> lock(freePagesMutex_);
214  if (freePages.size() == 0) {
215  return -1;
216  }
217  auto pageIt = freePages.begin();
218  int32_t pageNum = *pageIt;
219  freePages.erase(pageIt);
220  return pageNum;
221 }
std::set< size_t > freePages
Definition: FileInfo.h:62
std::mutex freePagesMutex_
Definition: FileInfo.h:64

+ Here is the caller graph for this function:

std::set<size_t> File_Namespace::FileInfo::getFreePages ( ) const
inline

Definition at line 110 of file FileInfo.h.

References freePages, and freePagesMutex_.

110  {
111  std::lock_guard<std::mutex> lock(freePagesMutex_);
112  return freePages;
113  }
std::set< size_t > freePages
Definition: FileInfo.h:62
std::mutex freePagesMutex_
Definition: FileInfo.h:64
void File_Namespace::FileInfo::initNewFile ( )

Adds all pages to freePages and zeroes first four bytes of header.

Definition at line 56 of file FileInfo.cpp.

References f, freePages, isDirty, numPages, pageSize, and File_Namespace::write().

Referenced by FileInfo().

56  {
57  // initialize pages and free page list
58  // Also zeroes out first four bytes of every header
59 
60  int32_t headerSize = 0;
61  int8_t* headerSizePtr = (int8_t*)(&headerSize);
62  for (size_t pageId = 0; pageId < numPages; ++pageId) {
63  File_Namespace::write(f, pageId * pageSize, sizeof(int32_t), headerSizePtr);
64  freePages.insert(pageId);
65  }
66  isDirty = true;
67 }
size_t write(FILE *f, const size_t offset, const size_t size, const int8_t *buf)
Writes the specified number of bytes to the offset position in file f from buf.
Definition: File.cpp:160
std::set< size_t > freePages
Definition: FileInfo.h:62
size_t pageSize
file stream object for the represented file
Definition: FileInfo.h:59
FILE * f
unique file identifier (i.e., used for a file name)
Definition: FileInfo.h:58
size_t numPages
the fixed size of each page in the file
Definition: FileInfo.h:60
bool isDirty
the number of pages in the file
Definition: FileInfo.h:61

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t File_Namespace::FileInfo::numFreePages ( ) const
inline

Returns the number of free pages available.

Definition at line 105 of file FileInfo.h.

References freePages, and freePagesMutex_.

Referenced by available().

105  {
106  std::lock_guard<std::mutex> lock(freePagesMutex_);
107  return freePages.size();
108  }
std::set< size_t > freePages
Definition: FileInfo.h:62
std::mutex freePagesMutex_
Definition: FileInfo.h:64

+ Here is the caller graph for this function:

void File_Namespace::FileInfo::openExistingFile ( std::vector< HeaderInfo > &  headerVec)

Definition at line 80 of file FileInfo.cpp.

References CHECK_EQ, CHECK_GE, CHUNK_KEY_DB_IDX, CHUNK_KEY_TABLE_IDX, File_Namespace::FileMgr::epoch(), f, fileId, fileMgr, freePageImmediate(), freePages, g_multi_instance, g_read_only, LOG, numPages, pageSize, show_chunk(), File_Namespace::FileMgr::updatePageIfDeleted(), VLOG, and logger::WARNING.

Referenced by File_Namespace::FileMgr::openExistingFile().

80  {
81  // HeaderInfo is defined in Page.h
82 
83  // Oct 2020: Changing semantics such that fileMgrEpoch should be last checkpointed
84  // epoch, not incremented epoch. This changes some of the gt/gte/lt/lte comparison below
85  ChunkKey oldChunkKey(4);
86  int32_t oldPageId = -99;
87  int32_t oldVersionEpoch = -99;
88  int32_t skipped = 0;
89  for (size_t pageNum = 0; pageNum < numPages; ++pageNum) {
90  // TODO(Misiu): It would be nice to replace this array with a struct that would
91  // clarify what is being read and have a single definition (currently this code is
92  // replicated in TableArchiver and possibly elsewhere).
93  constexpr size_t MAX_INTS_TO_READ{10}; // currently use 1+6 ints
94  int32_t ints[MAX_INTS_TO_READ];
95  CHECK_EQ(fseek(f, pageNum * pageSize, SEEK_SET), 0);
96  CHECK_EQ(fread(ints, sizeof(int32_t), MAX_INTS_TO_READ, f), MAX_INTS_TO_READ);
97 
98  auto headerSize = ints[0];
99  if (headerSize == 0) {
100  // no header for this page - insert into free list
101  freePages.insert(pageNum);
102  continue;
103  }
104 
105  // headerSize doesn't include headerSize itself
106  // We're tying ourself to headers of ints here
107  size_t numHeaderElems = headerSize / sizeof(int32_t);
108  CHECK_GE(numHeaderElems, size_t(2));
109  // We don't want to read headerSize in our header - so start
110  // reading 4 bytes past it
111  ChunkKey chunkKey(&ints[1], &ints[1 + numHeaderElems - 2]);
112  if (fileMgr->updatePageIfDeleted(this, chunkKey, ints[1], ints[2], pageNum)) {
113  continue;
114  }
115  // Last two elements of header are always PageId and Version
116  // epoch - these are not in the chunk key so seperate them
117  int32_t pageId = ints[1 + numHeaderElems - 2];
118  int32_t versionEpoch = ints[1 + numHeaderElems - 1];
119  if (chunkKey != oldChunkKey || oldPageId != pageId - (1 + skipped)) {
120  if (skipped > 0) {
121  VLOG(4) << "FId.PSz: " << fileId << "." << pageSize
122  << " Chunk key: " << show_chunk(oldChunkKey)
123  << " Page id from : " << oldPageId << " to : " << oldPageId + skipped
124  << " Epoch: " << oldVersionEpoch;
125  } else if (oldPageId != -99) {
126  VLOG(4) << "FId.PSz: " << fileId << "." << pageSize
127  << " Chunk key: " << show_chunk(oldChunkKey) << " Page id: " << oldPageId
128  << " Epoch: " << oldVersionEpoch;
129  }
130  oldPageId = pageId;
131  oldVersionEpoch = versionEpoch;
132  oldChunkKey = chunkKey;
133  skipped = 0;
134  } else {
135  skipped++;
136  }
137 
138  /* Check if version epoch is equal to
139  * or greater (note: should never be greater)
140  * than FileMgr epoch_ - this means that this
141  * page wasn't checkpointed and thus we should
142  * not use it
143  */
144  int32_t fileMgrEpoch =
145  fileMgr->epoch(chunkKey[CHUNK_KEY_DB_IDX], chunkKey[CHUNK_KEY_TABLE_IDX]);
146  if (versionEpoch > fileMgrEpoch) {
147  // First write 0 to first four bytes of
148  // header to mark as free
149  if (!g_read_only && !g_multi_instance) {
150  // TODO(sy): Confirm that proper locking is held before writing here.
151  freePageImmediate(pageNum);
152  LOG(WARNING) << "Was not checkpointed: Chunk key: " << show_chunk(chunkKey)
153  << " Page id: " << pageId << " Epoch: " << versionEpoch
154  << " FileMgrEpoch " << fileMgrEpoch << endl;
155  }
156  } else { // page was checkpointed properly
157  Page page(fileId, pageNum);
158  headerVec.emplace_back(chunkKey, pageId, versionEpoch, page);
159  }
160  }
161  // printlast
162  if (oldPageId != -99) {
163  if (skipped > 0) {
164  VLOG(4) << "FId.PSz: " << fileId << "." << pageSize
165  << " Chunk key: " << show_chunk(oldChunkKey)
166  << " Page id from : " << oldPageId << " to : " << oldPageId + skipped
167  << " Epoch: " << oldVersionEpoch;
168  } else {
169  VLOG(4) << "FId.PSz: " << fileId << "." << pageSize
170  << " Chunk key: " << show_chunk(oldChunkKey) << " Page id: " << oldPageId
171  << " Epoch: " << oldVersionEpoch;
172  }
173  }
174 }
virtual int32_t epoch(int32_t db_id, int32_t tb_id) const
Returns current value of epoch - should be one greater than recorded at last checkpoint. Because FileMgr only contains buffers from one table we can just return the FileMgr&#39;s epoch instead of finding a table-specific epoch.
Definition: FileMgr.h:277
#define CHECK_EQ(x, y)
Definition: Logger.h:301
std::vector< int > ChunkKey
Definition: types.h:36
bool g_multi_instance
Definition: heavyai_locks.h:21
#define LOG(tag)
Definition: Logger.h:285
#define CHUNK_KEY_DB_IDX
Definition: types.h:38
void freePageImmediate(int32_t page_num)
Definition: FileInfo.cpp:252
#define CHECK_GE(x, y)
Definition: Logger.h:306
virtual bool updatePageIfDeleted(FileInfo *file_info, ChunkKey &chunk_key, int32_t contingent, int32_t page_epoch, int32_t page_num)
deletes or recovers a page based on last checkpointed epoch.
Definition: FileMgr.cpp:1615
std::string show_chunk(const ChunkKey &key)
Definition: types.h:98
std::set< size_t > freePages
Definition: FileInfo.h:62
size_t pageSize
file stream object for the represented file
Definition: FileInfo.h:59
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:39
bool g_read_only
Definition: File.cpp:40
FILE * f
unique file identifier (i.e., used for a file name)
Definition: FileInfo.h:58
size_t numPages
the fixed size of each page in the file
Definition: FileInfo.h:60
#define VLOG(n)
Definition: Logger.h:387

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string File_Namespace::FileInfo::print ( ) const

Prints a summary of the file to stdout.

Definition at line 223 of file FileInfo.cpp.

References available(), fileId, size(), and used().

223  {
224  std::stringstream ss;
225  ss << "File: " << fileId << std::endl;
226  ss << "Size: " << size() << std::endl;
227  ss << "Used: " << used() << std::endl;
228  ss << "Free: " << available() << std::endl;
229  return ss.str();
230 }
size_t used() const
Returns the amount of used bytes; size() - available()
Definition: FileInfo.h:116
size_t size() const
Returns the number of bytes used by the file.
Definition: FileInfo.h:95
size_t available() const
Returns the number of free bytes available.
Definition: FileInfo.h:102

+ Here is the call graph for this function:

size_t File_Namespace::FileInfo::read ( const size_t  offset,
const size_t  size,
int8_t *  buf 
)

Definition at line 75 of file FileInfo.cpp.

References f, file_path, File_Namespace::read(), and readWriteMutex_.

Referenced by File_Namespace::FileBuffer::copyPage(), File_Namespace::FileMgr::copyPage(), File_Namespace::FileMgr::copyPageWithoutHeaderSize(), and File_Namespace::readForThread().

75  {
76  std::lock_guard<std::mutex> lock(readWriteMutex_);
77  return File_Namespace::read(f, offset, size, buf, file_path);
78 }
std::mutex readWriteMutex_
Definition: FileInfo.h:65
std::string file_path
set of page numbers of free pages
Definition: FileInfo.h:63
size_t size() const
Returns the number of bytes used by the file.
Definition: FileInfo.h:95
size_t read(FILE *f, const size_t offset, const size_t size, int8_t *buf, const std::string &file_path)
Reads the specified number of bytes from the offset position in file f into buf.
Definition: File.cpp:142
FILE * f
unique file identifier (i.e., used for a file name)
Definition: FileInfo.h:58

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void File_Namespace::FileInfo::recoverPage ( const ChunkKey chunk_key,
int32_t  page_num 
)

Definition at line 265 of file FileInfo.cpp.

References f, g_multi_instance, g_read_only, pageSize, and File_Namespace::write().

Referenced by File_Namespace::FileMgr::updatePageIfDeleted().

265  {
266  // we should not get here but putting protection in place
267  // as it seems we are no guaranteed to have f/synced so
268  // protecting from RO trying to write
269  if (!g_read_only && !g_multi_instance) {
271  page_num * pageSize + sizeof(int32_t),
272  2 * sizeof(int32_t),
273  reinterpret_cast<const int8_t*>(chunk_key.data()));
274  }
275 }
bool g_multi_instance
Definition: heavyai_locks.h:21
size_t write(FILE *f, const size_t offset, const size_t size, const int8_t *buf)
Writes the specified number of bytes to the offset position in file f from buf.
Definition: File.cpp:160
size_t pageSize
file stream object for the represented file
Definition: FileInfo.h:59
bool g_read_only
Definition: File.cpp:40
FILE * f
unique file identifier (i.e., used for a file name)
Definition: FileInfo.h:58

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t File_Namespace::FileInfo::size ( ) const
inline

Returns the number of bytes used by the file.

Definition at line 95 of file FileInfo.h.

References numPages, and pageSize.

Referenced by print(), and used().

95 { return pageSize * numPages; }
size_t pageSize
file stream object for the represented file
Definition: FileInfo.h:59
size_t numPages
the fixed size of each page in the file
Definition: FileInfo.h:60

+ Here is the caller graph for this function:

int32_t File_Namespace::FileInfo::syncToDisk ( )

Syncs file to disk via a buffer flush and then a sync (fflush and fsync on posix systems)

Definition at line 232 of file FileInfo.cpp.

References f, logger::FATAL, heavyai::fsync(), isDirty, LOG, and readWriteMutex_.

232  {
233  std::lock_guard<std::mutex> lock(readWriteMutex_);
234  if (isDirty) {
235  if (fflush(f) != 0) {
236  LOG(FATAL) << "Error trying to flush changes to disk, the error was: "
237  << std::strerror(errno);
238  }
239 #ifdef __APPLE__
240  const int32_t sync_result = fcntl(fileno(f), 51);
241 #else
242  const int32_t sync_result = heavyai::fsync(fileno(f));
243 #endif
244  if (sync_result == 0) {
245  isDirty = false;
246  }
247  return sync_result;
248  }
249  return 0; // if file was not dirty and no syncing was needed
250 }
#define LOG(tag)
Definition: Logger.h:285
std::mutex readWriteMutex_
Definition: FileInfo.h:65
FILE * f
unique file identifier (i.e., used for a file name)
Definition: FileInfo.h:58
int fsync(int fd)
Definition: heavyai_fs.cpp:62
bool isDirty
the number of pages in the file
Definition: FileInfo.h:61

+ Here is the call graph for this function:

size_t File_Namespace::FileInfo::used ( ) const
inline

Returns the amount of used bytes; size() - available()

Definition at line 116 of file FileInfo.h.

References available(), and size().

Referenced by print().

116 { return size() - available(); }
size_t size() const
Returns the number of bytes used by the file.
Definition: FileInfo.h:95
size_t available() const
Returns the number of free bytes available.
Definition: FileInfo.h:102

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t File_Namespace::FileInfo::write ( const size_t  offset,
const size_t  size,
const int8_t *  buf 
)

Definition at line 69 of file FileInfo.cpp.

References f, isDirty, readWriteMutex_, and File_Namespace::write().

Referenced by File_Namespace::FileBuffer::append(), File_Namespace::FileBuffer::copyPage(), File_Namespace::FileMgr::copyPage(), File_Namespace::FileMgr::copyPageWithoutHeaderSize(), File_Namespace::FileBuffer::write(), and File_Namespace::FileBuffer::writeHeader().

69  {
70  std::lock_guard<std::mutex> lock(readWriteMutex_);
71  isDirty = true;
72  return File_Namespace::write(f, offset, size, buf);
73 }
std::mutex readWriteMutex_
Definition: FileInfo.h:65
size_t write(FILE *f, const size_t offset, const size_t size, const int8_t *buf)
Writes the specified number of bytes to the offset position in file f from buf.
Definition: File.cpp:160
size_t size() const
Returns the number of bytes used by the file.
Definition: FileInfo.h:95
FILE * f
unique file identifier (i.e., used for a file name)
Definition: FileInfo.h:58
bool isDirty
the number of pages in the file
Definition: FileInfo.h:61

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

FILE* File_Namespace::FileInfo::f

unique file identifier (i.e., used for a file name)

Definition at line 58 of file FileInfo.h.

Referenced by freePage(), freePageImmediate(), initNewFile(), openExistingFile(), read(), recoverPage(), syncToDisk(), write(), and ~FileInfo().

std::string File_Namespace::FileInfo::file_path

set of page numbers of free pages

Definition at line 63 of file FileInfo.h.

Referenced by read().

FileMgr* File_Namespace::FileInfo::fileMgr

Definition at line 56 of file FileInfo.h.

Referenced by freePage(), and openExistingFile().

std::set<size_t> File_Namespace::FileInfo::freePages
std::mutex File_Namespace::FileInfo::freePagesMutex_
mutable

Definition at line 64 of file FileInfo.h.

Referenced by freePageDeferred(), getFreePage(), getFreePages(), and numFreePages().

bool File_Namespace::FileInfo::isDirty {false}

the number of pages in the file

Definition at line 61 of file FileInfo.h.

Referenced by freePage(), initNewFile(), syncToDisk(), and write().

size_t File_Namespace::FileInfo::numPages

the fixed size of each page in the file

Definition at line 60 of file FileInfo.h.

Referenced by initNewFile(), openExistingFile(), and size().

size_t File_Namespace::FileInfo::pageSize

file stream object for the represented file

Definition at line 59 of file FileInfo.h.

Referenced by available(), File_Namespace::FileMgr::copyPageWithoutHeaderSize(), freePage(), freePageImmediate(), initNewFile(), openExistingFile(), recoverPage(), and size().

std::mutex File_Namespace::FileInfo::readWriteMutex_
mutable

Definition at line 65 of file FileInfo.h.

Referenced by freePage(), read(), syncToDisk(), and write().


The documentation for this struct was generated from the following files: