Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::FileHashDatabase Class Reference

Hash database implemented as a file system. More...

Inheritance diagram for Arcane::FileHashDatabase:
Collaboration diagram for Arcane::FileHashDatabase:

Classes

struct  DirFileInfo
 Name of the directory and file containing the hash. More...

Public Member Functions

 FileHashDatabase (ITraceMng *tm, const String &directory)
void writeValues (const HashDatabaseWriteArgs &args, HashDatabaseWriteResult &xresult) override
void readValues (const HashDatabaseReadArgs &args) override
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const

Private Member Functions

DirFileInfo _getDirFileInfo (const String &hash_value)

Private Attributes

String m_directory
Int64 m_nb_write_cache = 0
Int64 m_nb_write = 0
Int64 m_nb_read = 0

Additional Inherited Members

Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

Hash database implemented as a file system.

The implementation is similar to what 'git' can do.

For each hash, we write a file whose name will be the hash and whose value will be the byte array corresponding to this hash. A file is therefore written only once and its value never changes: on write: if the file already exists, it is not necessary to write it again.

To avoid having too many hashes in the same directory, we create two subdirectories. The first with the first letter of the hash and the second with the next two letters. So for example, if the hash is '0a239fb4', then it will be in the directory '0/a2/0a239fb4'.

Definition at line 51 of file FileHashDatabase.cc.

Constructor & Destructor Documentation

◆ FileHashDatabase()

Arcane::FileHashDatabase::FileHashDatabase ( ITraceMng * tm,
const String & directory )
inline

Definition at line 67 of file FileHashDatabase.cc.

◆ ~FileHashDatabase()

Arcane::FileHashDatabase::~FileHashDatabase ( )
inline

Definition at line 72 of file FileHashDatabase.cc.

Member Function Documentation

◆ _getDirFileInfo()

DirFileInfo Arcane::FileHashDatabase::_getDirFileInfo ( const String & hash_value)
inlineprivate

Definition at line 135 of file FileHashDatabase.cc.

◆ readValues()

void Arcane::FileHashDatabase::readValues ( const HashDatabaseReadArgs & args)
inlineoverridevirtual

Implements Arcane::IHashDatabase.

Definition at line 115 of file FileHashDatabase.cc.

◆ writeValues()

void Arcane::FileHashDatabase::writeValues ( const HashDatabaseWriteArgs & args,
HashDatabaseWriteResult & xresult )
inlineoverridevirtual

Implements Arcane::IHashDatabase.

Definition at line 80 of file FileHashDatabase.cc.

Member Data Documentation

◆ m_directory

String Arcane::FileHashDatabase::m_directory
private

Definition at line 153 of file FileHashDatabase.cc.

◆ m_nb_read

Int64 Arcane::FileHashDatabase::m_nb_read = 0
private

Definition at line 156 of file FileHashDatabase.cc.

◆ m_nb_write

Int64 Arcane::FileHashDatabase::m_nb_write = 0
private

Definition at line 155 of file FileHashDatabase.cc.

◆ m_nb_write_cache

Int64 Arcane::FileHashDatabase::m_nb_write_cache = 0
private

Definition at line 154 of file FileHashDatabase.cc.


The documentation for this class was generated from the following file: