This block provides the NDB
file system
abstraction layer, and is located in the directory
storage/ndb/src/kernel/blocks/ndbfs
, which
contains the following files:
AsyncFile.hpp
: Defines theAsyncFile
class, which represents an asynchronous file. All actions are executed concurrently with the other activities carried out by the process. Because all actions are performed in a separate thread, the result of an action is sent back through a memory channel. For the asyncronous notification of a finished request, each callincludes a request as a parameter. This class is used for writing or reading data to and from disk concurrently with other activities.AsyncFile.cpp
: Defines the actions possible for an asynchronous file, and implements them.Filename.hpp
: Defines theFilename
class. Takes a 128-bit value (as a array of four longs) and makes a file name out of it. This file name encodes information about the file, such as whether it is a file or a directory, and if the former, the type of file. Possible types include data file, fragment log, fragment list, table list, schema log, and system file, among others.Filename.cpp
: Implementsset()
methods for theFilename
class.MemoryChannelTest/MemoryChannelTest.cpp
: Basic program for testing reads from and writes to a memory channel (that is, reading from and writing to a circular buffer).OpenFiles.hpp
: Implements anOpenFiles
class, which provides some convenience methods for determining whether or not a given file is already open.VoidFs.cpp
: Used for diskless operation. Generates a “dummy” acknowledgment to write operations.CircularIndex.hpp
: TheCircularIndex
class, defined in this file, serves as the building block for implementing circular buffers. It increments as a normal index until it reaches maximum size, then resets to zero.CircularIndex.cpp
: Contains only a single#define
, not actually used at this time.MemoryChannel.hpp
: Defines theMemoryChannel
andMemoryChannelMultipleWriter
classes, which provide a pointer-based channel for communication between two threads. It does not copy any data into or out of the channel, so the item that is put in can not be used untill the other thread has given it back. There is no support for detecting the return of an item.MemoryChannel.cpp
: “Dummy” file, not used at this time.Ndbfs.hpp
: Because anNDB
signal request can result in multiple requests toAsyncFile
, one class (defined in this file) is responsible for keeping track of all outstanding requests, and when all are finished, reporting the outcome back to the sending block.Ndbfs.cpp
: Implements initialization and signal-handling methods for theNdbfs
class.Pool.hpp
: Creates and manages a pool of objects for use byNdbfs
and other classes in this block.AsyncFileTest/AsyncFileTest.cpp
: Test program, used to test and benchmark functionality ofAsyncFile
.