libfoedus-core
FOEDUS Core Library
Error codes, messages, and stacktraces

Error codes (foedus::ErrorCode), their error messages defined in error_code.xmacro, and stacktrace information (ErrorStack) returned by our API functions. More...

Detailed Description

Error codes (foedus::ErrorCode), their error messages defined in error_code.xmacro, and stacktrace information (ErrorStack) returned by our API functions.

What it is
We define all error codes and their error messages here. Whenever you want a new error message, add a new line in error_code.xmacro like existing lines. This file is completely independent and header-only. Just include this file to use.
X-Macros
To concisely define error codes, error names, and error messages, we use the so-called "X Macro" style, which doesn't require any code generation.
See also
http://en.wikipedia.org/wiki/X_Macro
http://www.drdobbs.com/the-new-c-x-macros/184401387
ErrorCode vs ErrorStack
foedus::ErrorCode is merely an integer to identify the type of error. You can get a correponding error message and name of the error via get_error_name() and get_error_message(), but you can't get stacktrace information. For lightweight functions used internally, it might be enough. However, public API methods might need stacktrace information for ease of use. In that case, you should return ErrorStack, which additionally contains stacktrace and custom error message. ErrorStack is much more costly if it returns an error (if it's kErrorCodeOk, very efficient) and especially when it contains a custom error message (See ErrorStack for more details).
How to use ErrorStack
To use ErrorStack, you should be familiar with how to use the following macros: foedus::kRetOk, CHECK_ERROR_CODE(x), CHECK_ERROR(x), ERROR_STACK(e), COERCE_ERROR(x), and a few others. For example, use it as follows:
ErrorStack your_func() {
if (out-of-memory-observed) {
}
CHECK_ERROR_CODE(another_func());
CHECK_ERROR_CODE(yet_another_func());
return kRetOk;
}
Current List of ErrorCode
See foedus::ErrorCode.
Collaboration diagram for Error codes, messages, and stacktraces:

Files

file  error_code.xmacro
 Error code/message definition in X-Macro style.
 

Classes

class  foedus::ErrorStack
 Brings error stacktrace information as return value of functions. More...
 
class  foedus::ErrorStackBatch
 Batches zero or more ErrorStack objects to represent in one ErrorStack. More...
 
class  foedus::FixedErrorStack
 Representation of ErrorStack that can be copied to other processes and even serialized to files. More...
 

Macros

#define CHECK_ERROR_CODE(x)
 This macro calls x and checks its returned error code. More...
 
#define ERROR_STACK(e)    foedus::ErrorStack(__FILE__, __FUNCTION__, __LINE__, e)
 Instantiates ErrorStack with the given foedus::error_code, creating an error stack with the current file, line, and error code. More...
 
#define ERROR_STACK_MSG(e, m)    foedus::ErrorStack(__FILE__, __FUNCTION__, __LINE__, e, m)
 Overload of ERROR_STACK(e) to receive a custom error message. More...
 
#define CHECK_ERROR(x)
 This macro calls x and checks its returned value. More...
 
#define WRAP_ERROR_CODE(x)
 Same as CHECK_ERROR(x) except it receives only an error code, thus more efficient. More...
 
#define UNWRAP_ERROR_STACK(x)
 Similar to WRAP_ERROR_CODE(x), but this one converts ErrorStack to ErrorCode. More...
 
#define CHECK_ERROR_MSG(x, m)
 Overload of ERROR_CHECK(x) to receive a custom error message. More...
 
#define CHECK_OUTOFMEMORY(ptr)
 This macro checks if ptr is nullptr, and if so exists with kErrorCodeOutofmemory error stack. More...
 
#define COERCE_ERROR(x)
 This macro calls x and aborts if encounters an error. More...
 
#define COERCE_ERROR_CODE(x)
 Same as COERCE_ERROR(x) except this received ErrorCode, not ErrorStack. More...
 
#define SUMMARIZE_ERROR_BATCH(x)   x.summarize(__FILE__, __FUNCTION__, __LINE__)
 This macro calls ErrorStackBatch::summarize() with automatically provided parameters. More...
 

Enumerations

enum  foedus::ErrorCode {
  foedus::kErrorCodeOk = 0, foedus::kErrorCodeOutofmemory = 0x0001, foedus::kErrorCodeInvalidParameter = 0x0002, foedus::kErrorCodeAlreadyInitialized = 0x0003,
  foedus::kErrorCodeBatchedError = 0x0004, foedus::kErrorCodeDepedentModuleUnavailableInit = 0x0005, foedus::kErrorCodeDepedentModuleUnavailableUninit = 0x0006, foedus::kErrorCodeBeingShutdown = 0x0007,
  foedus::kErrorCodeTimeout = 0x0008, foedus::kErrorCodeNotimplemented = 0x0009, foedus::kErrorCodeSessionExpired = 0x000A, foedus::kErrorCodeUserDefined = 0x000B,
  foedus::kErrorCodeInternalError = 0x000C, foedus::kErrorCodeOsMProtectFailed = 0x000D, foedus::kErrorCodeEnvPrescreenFailed = 0x000E, foedus::kErrorCodeEngineInvalidOption = 0x0101,
  foedus::kErrorCodeFsAlreadyOpened = 0x0201, foedus::kErrorCodeFsFailedToOpen = 0x0202, foedus::kErrorCodeFsBadSeekInput = 0x0203, foedus::kErrorCodeFsSeekFailed = 0x0204,
  foedus::kErrorCodeFsBufferTooSmall = 0x0205, foedus::kErrorCodeFsBufferNotAligned = 0x0206, foedus::kErrorCodeFsTooShortRead = 0x0207, foedus::kErrorCodeFsExcessRead = 0x0208,
  foedus::kErrorCodeFsWriteFail = 0x0209, foedus::kErrorCodeFsExcessWrite = 0x020A, foedus::kErrorCodeFsNotOpened = 0x020B, foedus::kErrorCodeFsSyncFailed = 0x020C,
  foedus::kErrorCodeFsMkdirFailed = 0x020D, foedus::kErrorCodeFsTruncateFailed = 0x020E, foedus::kErrorCodeFsResultNotAligned = 0x020F, foedus::kErrorCodeMemoryNoFreePages = 0x0301,
  foedus::kErrorCodeMemoryDuplicatePage = 0x0302, foedus::kErrorCodeMemoryPagePoolTooSmall = 0x0303, foedus::kErrorCodeMemoryNumaUnavailable = 0x0304, foedus::kErrorCodeConfParseFailed = 0x0401,
  foedus::kErrorCodeConfValueOutofrange = 0x0402, foedus::kErrorCodeConfMissingElement = 0x0403, foedus::kErrorCodeConfInvalidElement = 0x0404, foedus::kErrorCodeConfEmptyXml = 0x0405,
  foedus::kErrorCodeConfFileNotFount = 0x0406, foedus::kErrorCodeConfCouldNotWrite = 0x0407, foedus::kErrorCodeConfCouldNotRename = 0x0408, foedus::kErrorCodeConfMkdirsFailed = 0x0409,
  foedus::kErrorCodeLogInvalidLoggerCount = 0x0501, foedus::kErrorCodeLogInvalidApplyType = 0x0502, foedus::kErrorCodeLogInvalidLogType = 0x0503, foedus::kErrorCodeSnapshotInvalidLogEnd = 0x0601,
  foedus::kErrorCodeSnapshotCancelled = 0x0602, foedus::kErrorCodeSnapshotExitTimeout = 0x0603, foedus::kErrorCodeSpInconsistentSavepoint = 0x0701, foedus::kErrorCodeStrDuplicateStrid = 0x0801,
  foedus::kErrorCodeStrAlreadyExists = 0x0802, foedus::kErrorCodeStrDuplicateStrname = 0x0803, foedus::kErrorCodeStrMustSeparateXct = 0x0804, foedus::kErrorCodeStrArrayInvalidOption = 0x0805,
  foedus::kErrorCodeStrWrongMetadataType = 0x0806, foedus::kErrorCodeStrUnsupportedMetadata = 0x0807, foedus::kErrorCodeStrTooLongPayload = 0x0808, foedus::kErrorCodeStrTooSmallPayloadBuffer = 0x0809,
  foedus::kErrorCodeStrTooShortPayload = 0x080A, foedus::kErrorCodeStrKeyAlreadyExists = 0x080B, foedus::kErrorCodeStrKeyNotFound = 0x080C, foedus::kErrorCodeStrHashBinsTooMany = 0x080D,
  foedus::kErrorCodeStrMasstreeRetry = 0x0811, foedus::kErrorCodeStrMasstreeTooManyRetries = 0x0812, foedus::kErrorCodeStrMasstreeFailedVerification = 0x0813, foedus::kErrorCodeStrMasstreeCursorTooDeep = 0x0814,
  foedus::kErrorCodeStrArrayFailedVerification = 0x0821, foedus::kErrorCodeStrTooManyStorages = 0x0822, foedus::kErrorCodeStrAlreadyDropped = 0x0823, foedus::kErrorCodeStrEmptyName = 0x0824,
  foedus::kErrorCodeStrPartitionerDataMemoryTooSmall = 0x0825, foedus::kErrorCodeStrTooLargeArray = 0x0826, foedus::kErrorCodeStrHashFailedVerification = 0x0827, foedus::kErrorCodeCacheNoFreePages = 0x0901,
  foedus::kErrorCodeCacheTableFull = 0x0902, foedus::kErrorCodeCacheTooManyOverflow = 0x0903, foedus::kErrorCodeXctReadSetOverflow = 0x0A01, foedus::kErrorCodeXctWriteSetOverflow = 0x0A02,
  foedus::kErrorCodeXctAlreadyRunning = 0x0A03, foedus::kErrorCodeXctNoXct = 0x0A04, foedus::kErrorCodeXctRaceAbort = 0x0A05, foedus::kErrorCodeXctPageVersionSetOverflow = 0x0A06,
  foedus::kErrorCodeXctPointerSetOverflow = 0x0A07, foedus::kErrorCodeXctUserAbort = 0x0A08, foedus::kErrorCodeXctNoMoreLocalWorkMemory = 0x0A09, foedus::kErrorCodeRecordTemperatureChange = 0x0AA0,
  foedus::kErrorCodeXctLockAbort = 0x0AA1, foedus::kErrorCodeLockCancelled = 0x0AA2, foedus::kErrorCodeLockRequested = 0x0AA3, foedus::kErrorCodeXctTwoSysXcts = 0x0AA4,
  foedus::kErrorCodeXctMustBeInSysXcts = 0x0AA5, foedus::kErrorCodeDbgGperftools = 0x0B01, foedus::kErrorCodeSocShmAllocFailed = 0x0C01, foedus::kErrorCodeSocShmAttachFailed = 0x0C02,
  foedus::kErrorCodeSocForkFailed = 0x0C03, foedus::kErrorCodeSocSpawnFailed = 0x0C04, foedus::kErrorCodeSocEmulateFailed = 0x0C05, foedus::kErrorCodeSocLaunchTimeout = 0x0C06,
  foedus::kErrorCodeSocMasterDied = 0x0C07, foedus::kErrorCodeSocMasterUnexpectedState = 0x0C08, foedus::kErrorCodeSocTerminateTimeout = 0x0C09, foedus::kErrorCodeSocTerminateFailed = 0x0C0A,
  foedus::kErrorCodeSocChildInitFailed = 0x0C0B, foedus::kErrorCodeSocChildUninitFailed = 0x0C0C, foedus::kErrorCodeProcPreRegisterTooLate = 0x0D01, foedus::kErrorCodeProcRegisterTooEarly = 0x0D02,
  foedus::kErrorCodeProcRegisterUnsupportedSocType = 0x0D03, foedus::kErrorCodeProcRegisterMasterOnly = 0x0D04, foedus::kErrorCodeProcRegisterChildOnly = 0x0D05, foedus::kErrorCodeProcNotFound = 0x0D06,
  foedus::kErrorCodeProcProcAlreadyExists = 0x0D07, foedus::kErrorCodeThrNoThreadAvailable = 0x0E01
}
 Enum of error codes defined in error_code.xmacro. More...
 

Functions

const char * foedus::get_error_name (ErrorCode code)
 Returns the names of ErrorCode enum defined in error_code.xmacro. More...
 
const char * foedus::get_error_message (ErrorCode code)
 Returns the error messages corresponding to ErrorCode enum defined in error_code.xmacro. More...
 

Variables

const ErrorStack foedus::kRetOk
 Normal return value for no-error case. More...
 

Macro Definition Documentation

#define CHECK_ERROR (   x)
Value:
{\
foedus::ErrorStack __e(x);\
if (UNLIKELY(__e.is_error())) {\
return foedus::ErrorStack(__e, __FILE__, __FUNCTION__, __LINE__);\
}\
}
Brings error stacktrace information as return value of functions.
Definition: error_stack.hpp:81
#define UNLIKELY(x)
Hints that x is highly likely false.
Definition: compiler.hpp:104

This macro calls x and checks its returned value.

If an error is encountered, it immediately returns from the current function or method, augmenting the stack trace held by the return code. For example, use it as follows:

ErrorStack your_func() {
CHECK_ERROR(another_func());
CHECK_ERROR(yet_another_func());
return kRetOk;
}
Note
The name is CHECK_ERROR, not CHECK, because Google-logging defines CHECK.

Definition at line 517 of file error_stack.hpp.

Referenced by foedus::externalize::Externalizable::add_child_element(), foedus::externalize::Externalizable::add_element(), foedus::soc::SharedMemoryRepo::allocate_shared_memories(), foedus::soc::SharedMemoryRepo::attach_shared_memories(), foedus::EnginePimpl::check_valid_options(), foedus::soc::SocManagerPimpl::child_main_common(), foedus::storage::array::ArrayComposer::compose(), foedus::storage::hash::HashComposer::compose(), foedus::storage::masstree::MasstreeComposer::compose(), foedus::storage::sequential::SequentialComposer::compose(), foedus::storage::hash::HashComposer::construct_root(), foedus::storage::masstree::MasstreeComposer::construct_root(), foedus::storage::array::ArrayStoragePimpl::create(), foedus::storage::masstree::MasstreeStoragePimpl::create(), foedus::storage::sequential::SequentialStoragePimpl::create(), foedus::storage::StorageManager::create_array(), foedus::storage::StorageManager::create_hash(), foedus::storage::StorageManager::create_masstree(), foedus::storage::StorageManager::create_sequential(), foedus::storage::StorageManagerPimpl::create_storage(), foedus::storage::StorageManagerPimpl::create_storage_and_log(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread_data(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread_follow(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread_intermediate(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread_recurse(), foedus::storage::masstree::MasstreePartitioner::design_partition(), foedus::storage::StorageManagerPimpl::drop_storage(), foedus::snapshot::LogGleaner::execute(), foedus::storage::array::ArrayComposeContext::execute(), foedus::storage::hash::HashComposeContext::execute(), foedus::storage::masstree::MasstreeComposeContext::execute(), foedus::storage::masstree::MasstreeStoragePimpl::fatify_first_root(), foedus::externalize::Externalizable::get_element(), foedus::externalize::Externalizable::get_enum_element(), foedus::snapshot::LogMapper::handle_process(), foedus::snapshot::LogReducer::handle_process(), foedus::snapshot::SnapshotManagerPimpl::handle_snapshot_triggered(), foedus::storage::StorageManagerPimpl::hcc_reset_all_temperature_stat(), foedus::storage::array::ArrayStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat_follow(), foedus::storage::array::ArrayStoragePimpl::hcc_reset_all_temperature_stat_intermediate(), foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat_intermediate(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat_recurse(), foedus::thread::Thread::initialize(), foedus::DefaultInitializable::initialize(), foedus::soc::SocManagerPimpl::initialize_master(), foedus::EnginePimpl::initialize_modules(), foedus::thread::ThreadGroup::initialize_once(), foedus::thread::ThreadPoolPimpl::initialize_once(), foedus::log::MetaLogger::initialize_once(), foedus::restart::RestartManagerPimpl::initialize_once(), foedus::memory::NumaNodeMemory::initialize_once(), foedus::memory::EngineMemory::initialize_once(), foedus::memory::NumaCoreMemory::initialize_once(), foedus::EnginePimpl::initialize_once(), foedus::storage::StorageManagerPimpl::initialize_once(), foedus::log::LogManagerPimpl::initialize_once(), foedus::savepoint::SavepointManagerPimpl::initialize_once(), foedus::thread::ThreadPimpl::initialize_once(), foedus::log::Logger::initialize_once(), foedus::snapshot::SnapshotManagerPimpl::initialize_once(), foedus::snapshot::LogReducer::initialize_once(), foedus::storage::StorageManagerPimpl::initialize_read_latest_snapshot(), foedus::soc::SocManagerPimpl::launch_emulated_children(), foedus::soc::SocManagerPimpl::launch_forked_children(), foedus::soc::SocManagerPimpl::launch_spawned_children(), foedus::snapshot::SnapshotMetadata::load(), foedus::storage::sequential::SequentialMetadataSerializer::load(), foedus::storage::hash::HashMetadataSerializer::load(), foedus::storage::array::ArrayMetadataSerializer::load(), foedus::storage::array::ArrayStoragePimpl::load(), foedus::storage::masstree::MasstreeStoragePimpl::load(), foedus::log::LogOptions::load(), foedus::storage::masstree::MasstreeMetadataSerializer::load(), foedus::EngineOptions::load(), foedus::storage::hash::HashStoragePimpl::load(), foedus::storage::sequential::SequentialStoragePimpl::load(), foedus::snapshot::SnapshotOptions::load(), foedus::storage::MetadataSerializer::load_all_storages_from_xml(), foedus::storage::MetadataSerializer::load_base(), foedus::storage::array::ArrayStoragePimpl::load_empty(), foedus::externalize::Externalizable::load_from_file(), foedus::externalize::Externalizable::load_from_string(), foedus::memory::EngineMemory::load_one_volatile_page(), foedus::snapshot::MergeSort::next_batch(), foedus::snapshot::SnapshotManagerPimpl::read_snapshot_metadata(), foedus::restart::RestartManagerPimpl::recover(), foedus::log::LogManagerPimpl::refresh_global_durable_epoch(), foedus::storage::StorageManagerPimpl::reinitialize_for_recovered_snapshot(), foedus::restart::RestartOptions::save(), foedus::savepoint::SavepointOptions::save(), foedus::snapshot::SnapshotMetadata::save(), foedus::storage::StorageOptions::save(), foedus::xct::XctOptions::save(), foedus::thread::ThreadOptions::save(), foedus::proc::ProcOptions::save(), foedus::storage::sequential::SequentialMetadataSerializer::save(), foedus::storage::hash::HashMetadataSerializer::save(), foedus::storage::array::ArrayMetadataSerializer::save(), foedus::soc::SocOptions::save(), foedus::cache::CacheOptions::save(), foedus::debugging::DebuggingOptions::save(), foedus::log::LogOptions::save(), foedus::savepoint::Savepoint::save(), foedus::memory::MemoryOptions::save(), foedus::storage::masstree::MasstreeMetadataSerializer::save(), foedus::EngineOptions::save(), foedus::snapshot::SnapshotOptions::save(), foedus::storage::MetadataSerializer::save_all_storages_to_xml(), foedus::storage::MetadataSerializer::save_base(), foedus::externalize::Externalizable::save_to_file(), foedus::snapshot::SnapshotManagerPimpl::snapshot_metadata(), foedus::snapshot::SnapshotManagerPimpl::snapshot_savepoint(), foedus::DefaultInitializable::uninitialize(), foedus::soc::SocManagerPimpl::uninitialize_once(), foedus::cache::CacheManagerPimpl::uninitialize_once(), foedus::xct::XctManagerPimpl::uninitialize_once(), foedus::storage::array::ArrayStoragePimpl::verify_single_thread(), foedus::storage::hash::HashStoragePimpl::verify_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread_border(), foedus::storage::hash::HashStoragePimpl::verify_single_thread_intermediate(), foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread_intermediate(), and foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread_layer().

#define CHECK_ERROR_CODE (   x)
Value:
{\
if (UNLIKELY(__e != kErrorCodeOk)) {\
return __e;\
}\
}
0 means no-error.
Definition: error_code.hpp:87
#define UNLIKELY(x)
Hints that x is highly likely false.
Definition: compiler.hpp:104
ErrorCode
Enum of error codes defined in error_code.xmacro.
Definition: error_code.hpp:85

This macro calls x and checks its returned error code.

If the code is NOT kErrorCodeOk, it immediately returns from the current function or method, returning the error code code. For example, use it as follows:

ErrorCode another_func();
ErrorCode yet_another_func();
ErrorCode your_func() {
CHECK_ERROR_CODE(another_func());
CHECK_ERROR_CODE(yet_another_func());
return kErrorCodeOk;
}

This macro is used in performance-critical functions that do not return ErrorStack but returns ErrorCode to save overheads. For a function that is called billion times per second, ErrorStack does cause bottleneck, especially because it requires to allocate hundreds bytes on stack, which would purge other data from cache lines. We actually did observe such situations in a few experiments. If your CPU profiling tells that ErrorStack-related methods cause more than 10% cpu costs, replace ErrorStack with ErrorCode.

See also
WRAP_ERROR_CODE(x)

Definition at line 155 of file error_code.hpp.

Referenced by foedus::xct::Xct::add_related_write_set(), foedus::xct::Xct::add_to_read_and_write_set(), foedus::storage::masstree::Adopt::adopt_case_b(), foedus::storage::masstree::MasstreeStoragePimpl::approximate_count_root_children(), foedus::storage::hash::ComposedBinsMergedStream::assure_writer_buffer(), foedus::xct::SysxctLockList::batch_request_page_locks(), foedus::storage::hash::ReserveRecords::create_new_record_in_tail_page(), foedus::storage::masstree::MasstreeStoragePimpl::delete_general(), foedus::storage::hash::HashStoragePimpl::delete_record(), foedus::storage::masstree::MasstreeStorage::delete_record(), foedus::storage::masstree::MasstreeStorage::delete_record_normalized(), foedus::snapshot::SnapshotWriter::expand_intermediate_memory(), foedus::snapshot::SnapshotWriter::expand_pool_memory(), foedus::storage::hash::ReserveRecords::expand_record(), foedus::storage::hash::ReserveRecords::find_and_lock_spacious_tail(), foedus::storage::masstree::MasstreeStoragePimpl::find_border_physical(), foedus::storage::hash::ReserveRecords::find_or_create_or_expand(), foedus::thread::ThreadPimpl::find_or_read_a_snapshot_page(), foedus::thread::ThreadPimpl::find_or_read_snapshot_pages_batch(), foedus::storage::masstree::MasstreeStoragePimpl::follow_layer(), foedus::storage::hash::HashStoragePimpl::follow_page(), foedus::storage::hash::HashStoragePimpl::follow_page_bin_head(), foedus::thread::ThreadPimpl::follow_page_pointer(), foedus::thread::ThreadPimpl::follow_page_pointers_for_read_batch(), foedus::thread::ThreadPimpl::follow_page_pointers_for_write_batch(), foedus::storage::array::ArrayStoragePimpl::follow_pointer(), foedus::storage::array::ArrayStoragePimpl::follow_pointers_for_read_batch(), foedus::storage::array::ArrayStoragePimpl::follow_pointers_for_write_batch(), foedus::storage::sequential::SequentialStoragePimpl::for_every_page(), foedus::storage::masstree::MasstreeStoragePimpl::get_first_root(), foedus::storage::masstree::MasstreeStorage::get_record(), foedus::storage::array::ArrayStoragePimpl::get_record(), foedus::storage::hash::HashStoragePimpl::get_record(), foedus::storage::array::ArrayStoragePimpl::get_record_for_write(), foedus::storage::array::ArrayStorage::get_record_for_write_batch(), foedus::storage::array::ArrayStoragePimpl::get_record_for_write_batch(), foedus::storage::masstree::MasstreeStorage::get_record_normalized(), foedus::storage::masstree::MasstreeStorage::get_record_part(), foedus::storage::hash::HashStoragePimpl::get_record_part(), foedus::storage::masstree::MasstreeStorage::get_record_part_normalized(), foedus::storage::array::ArrayStoragePimpl::get_record_payload(), foedus::storage::array::ArrayStorage::get_record_payload_batch(), foedus::storage::array::ArrayStoragePimpl::get_record_payload_batch(), foedus::storage::array::ArrayStoragePimpl::get_record_primitive(), foedus::storage::masstree::MasstreeStorage::get_record_primitive(), foedus::storage::array::ArrayStorage::get_record_primitive_batch(), foedus::storage::array::ArrayStoragePimpl::get_record_primitive_batch(), foedus::storage::masstree::MasstreeStorage::get_record_primitive_normalized(), foedus::storage::hash::HashStoragePimpl::get_root_page(), foedus::storage::masstree::MasstreeStoragePimpl::increment_general(), foedus::storage::array::ArrayStoragePimpl::increment_record(), foedus::storage::hash::HashStoragePimpl::increment_record(), foedus::storage::masstree::MasstreeStorage::increment_record(), foedus::storage::masstree::MasstreeStorage::increment_record_normalized(), foedus::storage::array::ArrayStoragePimpl::increment_record_oneshot(), foedus::storage::sequential::StreamStatus::init(), foedus::storage::masstree::MasstreeStoragePimpl::insert_general(), foedus::storage::hash::HashStoragePimpl::insert_record(), foedus::storage::hash::HashTmpBin::insert_record(), foedus::storage::masstree::MasstreeStorage::insert_record(), foedus::storage::masstree::MasstreeStorage::insert_record_normalized(), foedus::thread::ThreadPimpl::install_a_volatile_page(), foedus::storage::hash::HashStoragePimpl::locate_bin(), foedus::storage::masstree::MasstreeStoragePimpl::locate_record(), foedus::storage::hash::HashStoragePimpl::locate_record(), foedus::storage::array::ArrayStoragePimpl::locate_record_for_read(), foedus::storage::array::ArrayStoragePimpl::locate_record_for_read_batch(), foedus::storage::array::ArrayStoragePimpl::locate_record_for_write(), foedus::storage::hash::HashStoragePimpl::locate_record_in_snapshot(), foedus::storage::masstree::MasstreeStoragePimpl::locate_record_normalized(), foedus::storage::hash::HashStoragePimpl::locate_record_reserve_physical(), foedus::storage::masstree::SplitBorder::lock_existing_records(), foedus::storage::array::ArrayStoragePimpl::lookup_for_read(), foedus::storage::array::ArrayStoragePimpl::lookup_for_read_batch(), foedus::storage::array::ArrayStoragePimpl::lookup_for_write(), foedus::storage::array::ArrayStoragePimpl::lookup_for_write_batch(), foedus::storage::sequential::StreamStatus::next(), foedus::storage::masstree::MasstreeCursor::next(), foedus::storage::sequential::SequentialCursor::next_batch(), foedus::storage::hash::ComposedBinsBuffer::next_pages(), foedus::xct::Xct::on_record_read(), foedus::storage::masstree::MasstreeCursor::open(), foedus::storage::hash::ComposedBinsMergedStream::open_path(), foedus::storage::sequential::SequentialStorageControlBlock::optimistic_read_truncate_epoch(), foedus::storage::masstree::MasstreeStoragePimpl::overwrite_general(), foedus::storage::array::ArrayStoragePimpl::overwrite_record(), foedus::storage::hash::HashStoragePimpl::overwrite_record(), foedus::storage::masstree::MasstreeStorage::overwrite_record(), foedus::storage::masstree::MasstreeStorage::overwrite_record_normalized(), foedus::storage::array::ArrayStoragePimpl::overwrite_record_primitive(), foedus::storage::masstree::MasstreeStorage::overwrite_record_primitive(), foedus::storage::masstree::MasstreeStorage::overwrite_record_primitive_normalized(), foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries_this_layer_recurse(), foedus::storage::masstree::RecordLocation::populate_logical(), foedus::storage::hash::RecordLocation::populate_logical(), foedus::xct::XctManagerPimpl::precommit_xct_lock(), foedus::storage::array::ArrayStoragePimpl::prefetch_pages(), foedus::storage::masstree::MasstreeStoragePimpl::prefetch_pages_follow(), foedus::storage::masstree::MasstreeStoragePimpl::prefetch_pages_normalized(), foedus::storage::masstree::MasstreeStoragePimpl::prefetch_pages_normalized_recurse(), foedus::storage::array::ArrayStoragePimpl::prefetch_pages_recurse(), foedus::storage::hash::ComposedBinsMergedStream::process_a_bin(), foedus::cache::SnapshotFileSet::read_page(), foedus::cache::SnapshotFileSet::read_pages(), foedus::storage::masstree::MasstreeStoragePimpl::reserve_record(), foedus::storage::masstree::MasstreeStoragePimpl::reserve_record_normalized(), foedus::storage::masstree::MasstreeStoragePimpl::retrieve_general(), foedus::storage::masstree::MasstreeStoragePimpl::retrieve_part_general(), foedus::storage::masstree::GrowFirstLayerRoot::run(), foedus::storage::masstree::Adopt::run(), foedus::storage::masstree::GrowNonFirstLayerRoot::run(), foedus::storage::masstree::SplitBorder::run(), foedus::storage::masstree::ReserveRecords::run(), foedus::storage::masstree::SplitIntermediate::run(), foedus::xct::CurrentLockList::try_or_acquire_multiple_locks(), foedus::storage::masstree::MasstreeStoragePimpl::upsert_general(), foedus::storage::hash::HashStoragePimpl::upsert_record(), foedus::storage::masstree::MasstreeStorage::upsert_record(), foedus::storage::masstree::MasstreeStorage::upsert_record_normalized(), foedus::snapshot::DumpFileSortedBuffer::wind(), and foedus::storage::sequential::StreamStatus::wind_stream().

#define CHECK_ERROR_MSG (   x,
 
)
Value:
{\
foedus::ErrorStack __e(x);\
if (UNLIKELY(__e.is_error())) {\
return foedus::ErrorStack(__e, __FILE__, __FUNCTION__, __LINE__, m);\
}\
}
Brings error stacktrace information as return value of functions.
Definition: error_stack.hpp:81
#define UNLIKELY(x)
Hints that x is highly likely false.
Definition: compiler.hpp:104

Overload of ERROR_CHECK(x) to receive a custom error message.

For example, use it as follows:

ErrorStack your_func() {
CHECK_ERROR_MSG(another_func(), "I was doing xxx");
CHECK_ERROR_MSG(yet_another_func(), "I was doing yyy");
return kRetOk;
}

Definition at line 566 of file error_stack.hpp.

#define CHECK_OUTOFMEMORY (   ptr)
Value:
if (UNLIKELY(!ptr)) {\
return foedus::ErrorStack(__FILE__, __FUNCTION__, __LINE__, kErrorCodeOutofmemory);\
}
0x0001 : "GENERAL: Out of memory" .
Definition: error_code.hpp:105
Brings error stacktrace information as return value of functions.
Definition: error_stack.hpp:81
#define UNLIKELY(x)
Hints that x is highly likely false.
Definition: compiler.hpp:104

This macro checks if ptr is nullptr, and if so exists with kErrorCodeOutofmemory error stack.

This is useful as a null check after new/malloc. For example:

ErrorStack your_func() {
int* ptr = new int[123];
...
delete[] ptr;
return kRetOk;
}

Definition at line 590 of file error_stack.hpp.

Referenced by foedus::externalize::Externalizable::add_child_element(), foedus::externalize::Externalizable::add_element(), foedus::externalize::Externalizable::append_comment(), foedus::externalize::Externalizable::create_element(), foedus::log::LogManagerPimpl::initialize_once(), foedus::externalize::insert_comment_impl(), foedus::snapshot::SnapshotMetadata::save(), and foedus::externalize::Externalizable::save_to_file().

#define COERCE_ERROR (   x)
Value:
{\
foedus::ErrorStack __e(x);\
if (UNLIKELY(__e.is_error())) {\
__e.dump_and_abort("Unexpected error happened");\
}\
}
#define UNLIKELY(x)
Hints that x is highly likely false.
Definition: compiler.hpp:104

This macro calls x and aborts if encounters an error.

This should be used only in places that expects no error. For example, use it as follows:

void YourThread::run() {
// the signature of thread::run() is defined elsewhere, so you can't return ErrorStack.
// and you are sure an error won't happen here, or an error would be anyway catastrophic.
COERCE_ERROR(another_func());
}

Definition at line 610 of file error_stack.hpp.

Referenced by foedus::soc::SocManagerPimpl::child_main_common(), foedus::storage::StorageManagerPimpl::drop_storage_apply(), foedus::soc::SocManagerPimpl::initialize_child(), foedus::log::LogManagerPimpl::initialize_once(), foedus::memory::PagePoolPimpl::release_one(), and foedus::savepoint::SavepointManagerPimpl::savepoint_main().

#define COERCE_ERROR_CODE (   x)
Value:
{\
ERROR_STACK(__e).dump_and_abort("Unexpected error happened");\
}\
}
0 means no-error.
Definition: error_code.hpp:87
#define UNLIKELY(x)
Hints that x is highly likely false.
Definition: compiler.hpp:104
ErrorCode
Enum of error codes defined in error_code.xmacro.
Definition: error_code.hpp:85

Same as COERCE_ERROR(x) except this received ErrorCode, not ErrorStack.

Definition at line 625 of file error_stack.hpp.

#define ERROR_STACK (   e)    foedus::ErrorStack(__FILE__, __FUNCTION__, __LINE__, e)

Instantiates ErrorStack with the given foedus::error_code, creating an error stack with the current file, line, and error code.

For example, use it as follows:

ErrorStack your_func() {
if (out-of-memory-observed) {
}
return kRetOk;
}

Definition at line 480 of file error_stack.hpp.

Referenced by foedus::memory::NumaNodeMemory::allocate_numa_memory_general(), foedus::soc::SharedMemoryRepo::attach_shared_memories(), foedus::storage::array::ArrayStoragePimpl::create(), foedus::storage::masstree::MasstreeStoragePimpl::create(), foedus::storage::hash::HashStoragePimpl::create(), foedus::storage::sequential::SequentialStoragePimpl::create(), foedus::storage::StorageManagerPimpl::create_storage(), foedus::storage::StorageManagerPimpl::drop_storage(), foedus::proc::ProcManagerPimpl::emulated_register(), foedus::thread::ImpersonateSession::get_result(), foedus::thread::ThreadPool::impersonate_on_numa_core_synchronous(), foedus::thread::ThreadPool::impersonate_on_numa_node_synchronous(), foedus::thread::ThreadPool::impersonate_synchronous(), foedus::DefaultInitializable::initialize(), foedus::thread::ThreadPoolPimpl::initialize_once(), foedus::cache::CacheManagerPimpl::initialize_once(), foedus::restart::RestartManagerPimpl::initialize_once(), foedus::memory::EngineMemory::initialize_once(), foedus::EnginePimpl::initialize_once(), foedus::storage::StorageManagerPimpl::initialize_once(), foedus::log::LogManagerPimpl::initialize_once(), foedus::xct::XctManagerPimpl::initialize_once(), foedus::savepoint::SavepointManagerPimpl::initialize_once(), foedus::snapshot::SnapshotManagerPimpl::initialize_once(), foedus::storage::StorageManagerPimpl::initialize_read_latest_snapshot(), foedus::soc::SocManagerPimpl::launch_forked_children(), foedus::soc::SocManagerPimpl::launch_spawned_children(), foedus::storage::MetadataSerializer::load_all_storages_from_xml(), foedus::storage::array::ArrayStoragePimpl::load_empty(), foedus::proc::ProcManagerPimpl::local_register(), foedus::proc::ProcManagerPimpl::pre_register(), foedus::memory::PagePoolPimpl::release_one(), foedus::storage::MetadataSerializer::save_all_storages_to_xml(), foedus::snapshot::SnapshotManagerPimpl::snapshot_metadata(), foedus::debugging::DebuggingSupports::start_profile(), foedus::storage::sequential::SequentialStoragePimpl::truncate(), foedus::thread::ThreadPoolPimpl::uninitialize_once(), foedus::restart::RestartManagerPimpl::uninitialize_once(), foedus::memory::EngineMemory::uninitialize_once(), foedus::storage::StorageManagerPimpl::uninitialize_once(), foedus::log::LogManagerPimpl::uninitialize_once(), foedus::xct::XctManagerPimpl::uninitialize_once(), foedus::snapshot::SnapshotManagerPimpl::uninitialize_once(), foedus::soc::SocManagerPimpl::wait_for_child_attach(), foedus::soc::SocManagerPimpl::wait_for_child_terminate(), foedus::soc::SocManagerPimpl::wait_for_children_module(), foedus::soc::SocManagerPimpl::wait_for_master_module(), and foedus::soc::SocManagerPimpl::wait_for_master_status().

#define UNWRAP_ERROR_STACK (   x)
Value:
{\
foedus::ErrorStack __e = x;\
if (UNLIKELY(__e.is_error())) { return __e.get_error_code(); }\
}
#define UNLIKELY(x)
Hints that x is highly likely false.
Definition: compiler.hpp:104

Similar to WRAP_ERROR_CODE(x), but this one converts ErrorStack to ErrorCode.

This reduces information, so use it carefully.

See also
WRAP_ERROR_CODE(x)

Definition at line 547 of file error_stack.hpp.

#define WRAP_ERROR_CODE (   x)
Value:
{\
if (UNLIKELY(__e != foedus::kErrorCodeOk)) {return ERROR_STACK(__e);}\
}
#define ERROR_STACK(e)
Instantiates ErrorStack with the given foedus::error_code, creating an error stack with the current f...
0 means no-error.
Definition: error_code.hpp:87
#define UNLIKELY(x)
Hints that x is highly likely false.
Definition: compiler.hpp:104
ErrorCode
Enum of error codes defined in error_code.xmacro.
Definition: error_code.hpp:85

Same as CHECK_ERROR(x) except it receives only an error code, thus more efficient.

Note
Unlike CHECK_ERROR_CODE(x), this returns ErrorStack.
See also
CHECK_ERROR_CODE(x)

Definition at line 533 of file error_stack.hpp.

Referenced by foedus::storage::sequential::SequentialComposer::compose(), foedus::storage::array::ArrayComposer::construct_root(), foedus::storage::hash::HashComposer::construct_root(), foedus::storage::masstree::MasstreeComposer::construct_root(), foedus::storage::sequential::SequentialComposer::construct_root(), foedus::storage::hash::HashStoragePimpl::create(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread_follow(), foedus::storage::hash::HashPartitioner::design_partition(), foedus::storage::array::ArrayPartitioner::design_partition(), foedus::storage::masstree::MasstreePartitioner::design_partition(), foedus::storage::array::ArrayComposeContext::execute(), foedus::storage::hash::HashComposeContext::execute(), foedus::storage::masstree::MasstreeStoragePimpl::fatify_first_root(), foedus::storage::masstree::MasstreeStoragePimpl::fatify_first_root_double(), foedus::memory::EngineMemory::grab_one_volatile_page(), foedus::snapshot::LogMapper::handle_process(), foedus::snapshot::LogReducer::handle_process(), foedus::storage::hash::TmpSnashotPage::init(), foedus::storage::hash::ComposedBinsMergedStream::init(), foedus::storage::sequential::SequentialStoragePimpl::initialize_head_tail_pages(), foedus::log::MetaLogger::initialize_once(), foedus::memory::NumaCoreMemory::initialize_once(), foedus::log::Logger::initialize_once(), foedus::snapshot::MergeSort::initialize_once(), foedus::storage::masstree::MasstreeStoragePimpl::load_empty(), foedus::memory::EngineMemory::load_one_volatile_page(), foedus::snapshot::SnapshotWriter::open(), foedus::restart::RestartManagerPimpl::redo_meta_logs(), foedus::storage::StorageManagerPimpl::reinitialize_for_recovered_snapshot(), foedus::externalize::Externalizable::save_to_file(), foedus::storage::array::ArrayStoragePimpl::verify_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread_border(), and foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread_intermediate().

Enumeration Type Documentation

Enum of error codes defined in error_code.xmacro.

This is often used as a return value of lightweight functions. If you need more informative information, such as error stack, use ErrorStack. But, note that returning this value is MUCH more efficient.

Enumerator
kErrorCodeOk 

0 means no-error.

kErrorCodeOutofmemory 

0x0001 : "GENERAL: Out of memory" .

kErrorCodeInvalidParameter 

0x0002 : "GENERAL: Invalid parameter given" .

kErrorCodeAlreadyInitialized 

0x0003 : "GENERAL: Already initialized" .

kErrorCodeBatchedError 

0x0004 : "GENERAL: More than one errors observed" .

kErrorCodeDepedentModuleUnavailableInit 

0x0005 : "GENERAL: A dependent module is not initialized yet. This implies a wrong initialization order in EnginePimpl." .

kErrorCodeDepedentModuleUnavailableUninit 

0x0006 : "GENERAL: A dependent module is already uninitialized. This implies a wrong uninitialization order in EnginePimpl." .

kErrorCodeBeingShutdown 

0x0007 : "GENERAL: The engine is being shutdown." .

kErrorCodeTimeout 

0x0008 : "GENERAL: Timeout." .

kErrorCodeNotimplemented 

0x0009 : "GENERAL: Not implemented yet." .

kErrorCodeSessionExpired 

0x000A : "GENERAL: The session has expired." .

kErrorCodeUserDefined 

0x000B : "GENERAL: User-defined error. The meaning of this error depends on the user code." .

kErrorCodeInternalError 

0x000C : "GENERAL: Other uncategorized errors." .

kErrorCodeOsMProtectFailed 

0x000D : "GENERAL: OS: mprotect() failed." .

kErrorCodeEnvPrescreenFailed 

0x000E : "GENERAL: Pre-screening of the environment detected" " an issue before start up. This is caused by a misconfiguration on the environment or the" " given parameters. See the console output for more detailed diagnostics." .

kErrorCodeEngineInvalidOption 

0x0101 : "ENGINE : Invalid Option" .

kErrorCodeFsAlreadyOpened 

0x0201 : "FILESYS: Already opened" .

kErrorCodeFsFailedToOpen 

0x0202 : "FILESYS: Failed to open a file" .

kErrorCodeFsBadSeekInput 

0x0203 : "FILESYS: Invalid arguments for seek()" .

kErrorCodeFsSeekFailed 

0x0204 : "FILESYS: file seek failed" .

kErrorCodeFsBufferTooSmall 

0x0205 : "FILESYS: file buffer is too small" .

kErrorCodeFsBufferNotAligned 

0x0206 : "FILESYS: file buffer is not aligned" .

kErrorCodeFsTooShortRead 

0x0207 : "FILESYS: reached end of file before completing reads" .

kErrorCodeFsExcessRead 

0x0208 : "FILESYS: read more than expected" .

kErrorCodeFsWriteFail 

0x0209 : "FILESYS: Disk write failed." .

kErrorCodeFsExcessWrite 

0x020A : "FILESYS: wrote more than expected" .

kErrorCodeFsNotOpened 

0x020B : "FILESYS: File not opened yet or failed to open." .

kErrorCodeFsSyncFailed 

0x020C : "FILESYS: fsync() failed." .

kErrorCodeFsMkdirFailed 

0x020D : "FILESYS: Failed to create a directory" .

kErrorCodeFsTruncateFailed 

0x020E : "FILESYS: File truncation failed" .

kErrorCodeFsResultNotAligned 

0x020F : "FILESYS: Direct I/O operation resulted in non-aligned count of bytes. Filesyste bug?" .

kErrorCodeMemoryNoFreePages 

0x0301 : "MEMORY : Not enough free volatile pages. Check the config of MemoryOptions" .

kErrorCodeMemoryDuplicatePage 

0x0302 : "MEMORY : Duplicate entry in free-page pool." .

kErrorCodeMemoryPagePoolTooSmall 

0x0303 : "MEMORY : Page Pool size is too small." .

kErrorCodeMemoryNumaUnavailable 

0x0304 : "MEMORY : NUMA library is not available." .

kErrorCodeConfParseFailed 

0x0401 : "CONFIG : Config file parsing failed. This usually means an invalid XML file." .

kErrorCodeConfValueOutofrange 

0x0402 : "CONFIG : Configuration value out of range." .

kErrorCodeConfMissingElement 

0x0403 : "CONFIG : The xml element is missing in the config file." .

kErrorCodeConfInvalidElement 

0x0404 : "CONFIG : An invalid valud in the xml element." .

kErrorCodeConfEmptyXml 

0x0405 : "CONFIG : No root element in the xml." .

kErrorCodeConfFileNotFount 

0x0406 : "CONFIG : The file doesn't exist." .

kErrorCodeConfCouldNotWrite 

0x0407 : "CONFIG : Failed to write a configuration file." .

kErrorCodeConfCouldNotRename 

0x0408 : "CONFIG : Failed to atomically rename the temporary file to destination." .

kErrorCodeConfMkdirsFailed 

0x0409 : "CONFIG : Failed to create a directory. Check permissions." .

kErrorCodeLogInvalidLoggerCount 

0x0501 : "LOG : The number of loggers per node must be a submultiple of the number of cores in the node. Check the settings in LogOptions" .

kErrorCodeLogInvalidApplyType 

0x0502 : "LOG : This log type does not support this type of apply" .

kErrorCodeLogInvalidLogType 

0x0503 : "LOG : LOG_TYPE_INVALID" .

kErrorCodeSnapshotInvalidLogEnd 

0x0601 : "SNAPSHT: Inconsistent end of log entry detected." .

kErrorCodeSnapshotCancelled 

0x0602 : "SNAPSHT: (internal error code) Snapshot task cancelled." .

kErrorCodeSnapshotExitTimeout 

0x0603 : "SNAPSHT: Snapshot mappers/reducers take too long time to respond to exit request. Timeout happened." .

kErrorCodeSpInconsistentSavepoint 

0x0701 : "SAVEPNT: Savepoint file is not consistent with other configurations. Check the number of loggers." .

kErrorCodeStrDuplicateStrid 

0x0801 : "STORAGE: Duplicate StorageID" .

kErrorCodeStrAlreadyExists 

0x0802 : "STORAGE: This storage already exists" .

kErrorCodeStrDuplicateStrname 

0x0803 : "STORAGE: This Storage Name already exists" .

kErrorCodeStrMustSeparateXct 

0x0804 : "STORAGE: This storage operation must be done in a separate transaction." .

kErrorCodeStrArrayInvalidOption 

0x0805 : "STORAGE: Invalid Option for array storage" .

kErrorCodeStrWrongMetadataType 

0x0806 : "STORAGE: Metadata type does not match" .

kErrorCodeStrUnsupportedMetadata 

0x0807 : "STORAGE: This metadata type is not yet supported" .

kErrorCodeStrTooLongPayload 

0x0808 : "STORAGE: Payload of the record is too long" .

kErrorCodeStrTooSmallPayloadBuffer 

0x0809 : "STORAGE: The record's payload is larger than the buffer" .

kErrorCodeStrTooShortPayload 

0x080A : "STORAGE: The record's payload is smaller than requested" .

kErrorCodeStrKeyAlreadyExists 

0x080B : "STORAGE: This key already exists in this storage" .

kErrorCodeStrKeyNotFound 

0x080C : "STORAGE: This key is not found in this storage" .

kErrorCodeStrHashBinsTooMany 

0x080D : "STORAGE: HASH: Number of hash-bins too large compared to storage.partitioner_data_memory_mb_." .

kErrorCodeStrMasstreeRetry 

0x0811 : "STORAGE: MASSTREE: Retry search. This is an internal error code used to retry find_border." .

kErrorCodeStrMasstreeTooManyRetries 

0x0812 : "STORAGE: MASSTREE: Retrying too many times. Gave up" .

kErrorCodeStrMasstreeFailedVerification 

0x0813 : "STORAGE: MASSTREE: Failed verification. Found an inconsistency" .

kErrorCodeStrMasstreeCursorTooDeep 

0x0814 : "STORAGE: MASSTREE: Cursor encountered a too deep path" .

kErrorCodeStrArrayFailedVerification 

0x0821 : "STORAGE: ARRAY: Failed verification. Found an inconsistency" .

kErrorCodeStrTooManyStorages 

0x0822 : "STORAGE: Reached maximum number of storages. To register more storages, adjust StorageOptions::max_storages." .

kErrorCodeStrAlreadyDropped 

0x0823 : "STORAGE: This storage does not exist or has been already dropped" .

kErrorCodeStrEmptyName 

0x0824 : "STORAGE: Storage name is empty" .

kErrorCodeStrPartitionerDataMemoryTooSmall 

0x0825 : "STORAGE: Memory for Partitioners ran out during snapshot. Increase StorageOptions::partitioner_data_memory_mb_" .

kErrorCodeStrTooLargeArray 

0x0826 : "STORAGE: Too large array size specified. The size of an array storage must be smaller than 2^48" .

kErrorCodeStrHashFailedVerification 

0x0827 : "STORAGE: HASH: Failed verification. Found an inconsistency" .

kErrorCodeCacheNoFreePages 

0x0901 : "SPCACHE: Not enough free snapshot pages. Cleaner is not catching up" .

kErrorCodeCacheTableFull 

0x0902 : "SPCACHE: Hashtable full or too many skewed inserts" .

kErrorCodeCacheTooManyOverflow 

0x0903 : "SPCACHE: Hashtable for snapshot cache got too many overflow entries" .

kErrorCodeXctReadSetOverflow 

0x0A01 : "XCTION : Too large read-set. Check the config of XctOptions" .

kErrorCodeXctWriteSetOverflow 

0x0A02 : "XCTION : Too large write-set. Check the config of XctOptions" .

kErrorCodeXctAlreadyRunning 

0x0A03 : "XCTION : This thread is already running a transaction. Commit or abort it first." .

kErrorCodeXctNoXct 

0x0A04 : "XCTION : This thread is not running any transaction." .

kErrorCodeXctRaceAbort 

0x0A05 : "XCTION : Aborted a transaction because of a race condition. This is an expected error in highly contended case. You might retry the transaction." .

kErrorCodeXctPageVersionSetOverflow 

0x0A06 : "XCTION : Too large page-version set. Consider using snapshot isolation." .

kErrorCodeXctPointerSetOverflow 

0x0A07 : "XCTION : Too large pointer-set. Consider using snapshot isolation." .

kErrorCodeXctUserAbort 

0x0A08 : "XCTION : User explicitly aborted a transaction." .

kErrorCodeXctNoMoreLocalWorkMemory 

0x0A09 : "XCTION : Out of local work memory for the current transaction. Adjust XctOptions::local_work_memory_size_mb_." .

kErrorCodeRecordTemperatureChange 

0x0AA0 : "XCTION : Record page temperature changed." .

kErrorCodeXctLockAbort 

0x0AA1 : "XCTION : Lock acquire failed." .

kErrorCodeLockCancelled 

0x0AA2 : "XCTION : Lock acquire cancelled." .

kErrorCodeLockRequested 

0x0AA3 : "XCTION : Lock acquire requested." .

kErrorCodeXctTwoSysXcts 

0x0AA4 : "XCTION : The thread is already running a system transaction. This means an incorrect use of system transactions somewhere in our code." .

kErrorCodeXctMustBeInSysXcts 

0x0AA5 : "XCTION : This operation must be done in a system transaction. This means an incorrect use of system transactions somewhere in our code." .

kErrorCodeDbgGperftools 

0x0B01 : "DEBUG : Gperftools reported an error" .

kErrorCodeSocShmAllocFailed 

0x0C01 : "SOC : Failed to allocate a shared memory. This is usually caused by a misconfigured environment. Check the following:" " - Too small kernel.shmmax/kernel.shmmin. sudo sysctl -w kernel.shmmax=9223372036854775807;sudo sysctl -w kernel.shmall=1152921504606846720;sudo sysctl -w kernel.shmmni=409600; sudo sysctl -p" " - Too few hugepages. sudo sh -c 'echo 1000 > /proc/sys/vm/nr_hugepages'" " - Too small mlock. Check ulimit -l. Configure /etc/security/limits.conf" " - Too small nofile. Check ulimit -a. Configure /etc/security/limits.conf" " - Simply larger than DRAM in the machine. " " - (Very rare) shm key conflict." .

kErrorCodeSocShmAttachFailed 

0x0C02 : "SOC : Failed to attach a shared memory." .

kErrorCodeSocForkFailed 

0x0C03 : "SOC : Failed to fork child SOCs." .

kErrorCodeSocSpawnFailed 

0x0C04 : "SOC : Failed to spawn child SOCs." .

kErrorCodeSocEmulateFailed 

0x0C05 : "SOC : Failed to launch emulated child SOCs." .

kErrorCodeSocLaunchTimeout 

0x0C06 : "SOC : Timeout happend while waiting for child SOCs to start up. Probably child SOC(s) hanged." .

kErrorCodeSocMasterDied 

0x0C07 : "SOC : Master engine died unexpectedly. This child engine will follow." .

kErrorCodeSocMasterUnexpectedState 

0x0C08 : "SOC : The status of master engine is unexpected." .

kErrorCodeSocTerminateTimeout 

0x0C09 : "SOC : Timeout happend while waiting for child SOCs to terminate. Probably child SOC(s) hanged." .

kErrorCodeSocTerminateFailed 

0x0C0A : "SOC : Failed to normally terminate some SOC(s).." .

kErrorCodeSocChildInitFailed 

0x0C0B : "SOC : Child SOC failed to initialize a module." .

kErrorCodeSocChildUninitFailed 

0x0C0C : "SOC : Child SOC failed to uninitialize a module." .

kErrorCodeProcPreRegisterTooLate 

0x0D01 : "PROC : Pre-register can be called only before engine initialization." .

kErrorCodeProcRegisterTooEarly 

0x0D02 : "PROC : Post-register can be called only after engine initialization." .

kErrorCodeProcRegisterUnsupportedSocType 

0x0D03 : "PROC : This registration type cannot be used for this SOC type." .

kErrorCodeProcRegisterMasterOnly 

0x0D04 : "PROC : This registration type can be invoked only at master engine." .

kErrorCodeProcRegisterChildOnly 

0x0D05 : "PROC : This registration type can be invoked only at child engine." .

kErrorCodeProcNotFound 

0x0D06 : "PROC : The specified procedure name is not found in this engine." .

kErrorCodeProcProcAlreadyExists 

0x0D07 : "PROC : The specified procedure name already exists in this engine." .

kErrorCodeThrNoThreadAvailable 

0x0E01 : "THREAD : No worker thread is available for impersonation." .

Definition at line 85 of file error_code.hpp.

85  {
87  kErrorCodeOk = 0,
88 #include "foedus/error_code.xmacro" // NOLINT
89 };
Error code/message definition in X-Macro style.
0 means no-error.
Definition: error_code.hpp:87

Function Documentation

const char * foedus::get_error_message ( ErrorCode  code)
inline

Returns the error messages corresponding to ErrorCode enum defined in error_code.xmacro.

Definition at line 120 of file error_code.hpp.

Referenced by foedus::proc::ProcManagerPimpl::emulated_register(), foedus::FixedErrorStack::get_message(), foedus::ErrorStack::get_message(), foedus::proc::ProcManagerPimpl::local_register(), and foedus::proc::ProcManagerPimpl::pre_register().

120  {
121  switch (code) {
122  case kErrorCodeOk: return "no_error";
123 #include "foedus/error_code.xmacro" // NOLINT
124  }
125  return "Unexpected error code";
126 }
Error code/message definition in X-Macro style.
0 means no-error.
Definition: error_code.hpp:87

Here is the caller graph for this function:

const char * foedus::get_error_name ( ErrorCode  code)
inline

Returns the names of ErrorCode enum defined in error_code.xmacro.

Definition at line 108 of file error_code.hpp.

Referenced by foedus::memory::RoundRobinPageGrabBatch::grab(), foedus::memory::DivvyupPageGrabBatch::grab(), foedus::FixedErrorStack::output(), and foedus::ErrorStack::output().

108  {
109  switch (code) {
110  case kErrorCodeOk: return "kErrorCodeOk";
111 #include "foedus/error_code.xmacro" // NOLINT
112  }
113  return "Unexpected error code";
114 }
Error code/message definition in X-Macro style.
0 means no-error.
Definition: error_code.hpp:87

Here is the caller graph for this function:

Variable Documentation

foedus::kRetOk

Normal return value for no-error case.

Const return code that indicates no error. This is the normal way to return from a method or function.

Definition at line 251 of file error_stack.hpp.

Referenced by foedus::externalize::Externalizable::add_child_element(), foedus::externalize::Externalizable::add_element(), foedus::memory::SharedMemory::alloc(), foedus::memory::NumaNodeMemory::allocate_numa_memory_general(), foedus::soc::SharedMemoryRepo::allocate_shared_memories(), foedus::externalize::Externalizable::append_comment(), foedus::soc::SharedMemoryRepo::attach_shared_memories(), foedus::EnginePimpl::check_valid_options(), foedus::soc::SocManagerPimpl::child_main_common(), foedus::storage::StorageManagerPimpl::clone_all_storage_metadata(), foedus::storage::array::ArrayComposer::compose(), foedus::storage::hash::HashComposer::compose(), foedus::storage::masstree::MasstreeComposer::compose(), foedus::storage::sequential::SequentialComposer::compose(), foedus::storage::Composer::compose(), foedus::storage::array::ArrayComposer::construct_root(), foedus::storage::hash::HashComposer::construct_root(), foedus::storage::masstree::MasstreeComposer::construct_root(), foedus::storage::sequential::SequentialComposer::construct_root(), foedus::storage::Composer::construct_root(), foedus::storage::array::ArrayStoragePimpl::create(), foedus::storage::masstree::MasstreeStoragePimpl::create(), foedus::storage::hash::HashStoragePimpl::create(), foedus::storage::sequential::SequentialStoragePimpl::create(), foedus::storage::StorageManager::create_array(), foedus::externalize::Externalizable::create_element(), foedus::storage::StorageManager::create_hash(), foedus::storage::StorageManager::create_masstree(), foedus::storage::StorageManager::create_sequential(), foedus::storage::StorageManagerPimpl::create_storage(), foedus::storage::StorageManagerPimpl::create_storage_and_log(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread_data(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread_follow(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread_intermediate(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread_recurse(), foedus::storage::sequential::SequentialPartitioner::design_partition(), foedus::storage::hash::HashPartitioner::design_partition(), foedus::storage::array::ArrayPartitioner::design_partition(), foedus::storage::masstree::MasstreePartitioner::design_partition(), foedus::storage::Partitioner::design_partition(), foedus::storage::array::ArrayStorage::drop(), foedus::storage::masstree::MasstreeStoragePimpl::drop(), foedus::storage::hash::HashStoragePimpl::drop(), foedus::storage::sequential::SequentialStoragePimpl::drop(), foedus::storage::StorageManagerPimpl::drop_storage(), foedus::snapshot::SnapshotManagerPimpl::drop_volatile_pages(), foedus::proc::ProcManagerPimpl::emulated_register(), foedus::snapshot::LogGleaner::execute(), foedus::storage::array::ArrayComposeContext::execute(), foedus::storage::hash::HashComposeContext::execute(), foedus::storage::masstree::MasstreeComposeContext::execute(), foedus::storage::masstree::MasstreeStoragePimpl::fatify_first_root(), foedus::storage::masstree::MasstreeStoragePimpl::fatify_first_root_double(), foedus::externalize::Externalizable::get_child_element(), foedus::externalize::Externalizable::get_element(), foedus::externalize::Externalizable::get_enum_element(), foedus::proc::ProcManagerPimpl::get_proc(), foedus::memory::EngineMemory::grab_one_volatile_page(), foedus::snapshot::LogMapper::handle_process(), foedus::snapshot::LogReducer::handle_process(), foedus::snapshot::SnapshotManagerPimpl::handle_snapshot_triggered(), foedus::storage::StorageManagerPimpl::hcc_reset_all_temperature_stat(), foedus::storage::array::ArrayStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat_data(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat_follow(), foedus::storage::array::ArrayStoragePimpl::hcc_reset_all_temperature_stat_intermediate(), foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat_intermediate(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat_recurse(), foedus::storage::hash::TmpSnashotPage::init(), foedus::storage::hash::ComposedBinsMergedStream::init(), foedus::thread::Thread::initialize(), foedus::DefaultInitializable::initialize(), foedus::soc::SocManagerPimpl::initialize_child(), foedus::storage::sequential::SequentialStoragePimpl::initialize_head_tail_pages(), foedus::soc::SocManagerPimpl::initialize_master(), foedus::EnginePimpl::initialize_modules(), foedus::thread::ThreadGroup::initialize_once(), foedus::debugging::DebuggingSupports::initialize_once(), foedus::thread::ThreadPoolPimpl::initialize_once(), foedus::cache::CacheManagerPimpl::initialize_once(), foedus::restart::RestartManagerPimpl::initialize_once(), foedus::log::MetaLogger::initialize_once(), foedus::memory::NumaNodeMemory::initialize_once(), foedus::cache::SnapshotFileSet::initialize_once(), foedus::memory::EngineMemory::initialize_once(), foedus::memory::NumaCoreMemory::initialize_once(), foedus::EnginePimpl::initialize_once(), foedus::snapshot::LogMapper::initialize_once(), foedus::storage::StorageManagerPimpl::initialize_once(), foedus::proc::ProcManagerPimpl::initialize_once(), foedus::log::LogManagerPimpl::initialize_once(), foedus::memory::PagePoolPimpl::initialize_once(), foedus::xct::XctManagerPimpl::initialize_once(), foedus::savepoint::SavepointManagerPimpl::initialize_once(), foedus::thread::ThreadPimpl::initialize_once(), foedus::log::Logger::initialize_once(), foedus::snapshot::SnapshotManagerPimpl::initialize_once(), foedus::log::ThreadLogBuffer::initialize_once(), foedus::snapshot::LogReducer::initialize_once(), foedus::snapshot::MergeSort::initialize_once(), foedus::storage::StorageManagerPimpl::initialize_read_latest_snapshot(), foedus::externalize::insert_comment_impl(), foedus::soc::SocManagerPimpl::launch_emulated_children(), foedus::soc::SocManagerPimpl::launch_forked_children(), foedus::soc::SocManagerPimpl::launch_spawned_children(), foedus::restart::RestartOptions::load(), foedus::savepoint::SavepointOptions::load(), foedus::snapshot::SnapshotMetadata::load(), foedus::storage::StorageOptions::load(), foedus::thread::ThreadOptions::load(), foedus::xct::XctOptions::load(), foedus::fs::DeviceEmulationOptions::load(), foedus::proc::ProcOptions::load(), foedus::storage::sequential::SequentialMetadataSerializer::load(), foedus::storage::hash::HashMetadataSerializer::load(), foedus::soc::SocOptions::load(), foedus::storage::array::ArrayMetadataSerializer::load(), foedus::cache::CacheOptions::load(), foedus::debugging::DebuggingOptions::load(), foedus::storage::array::ArrayStoragePimpl::load(), foedus::storage::masstree::MasstreeStoragePimpl::load(), foedus::log::LogOptions::load(), foedus::savepoint::Savepoint::load(), foedus::memory::MemoryOptions::load(), foedus::storage::masstree::MasstreeMetadataSerializer::load(), foedus::EngineOptions::load(), foedus::storage::hash::HashStoragePimpl::load(), foedus::storage::sequential::SequentialStoragePimpl::load(), foedus::snapshot::SnapshotOptions::load(), foedus::storage::MetadataSerializer::load_all_storages_from_xml(), foedus::storage::MetadataSerializer::load_base(), foedus::storage::array::ArrayStoragePimpl::load_empty(), foedus::storage::masstree::MasstreeStoragePimpl::load_empty(), foedus::externalize::Externalizable::load_from_file(), foedus::externalize::Externalizable::load_from_string(), foedus::memory::EngineMemory::load_one_volatile_page(), foedus::proc::ProcManagerPimpl::local_register(), foedus::snapshot::MergeSort::next_batch(), foedus::snapshot::SnapshotWriter::open(), foedus::proc::ProcManagerPimpl::pre_register(), foedus::EngineOptions::prescreen(), foedus::snapshot::SnapshotManagerPimpl::read_snapshot_metadata(), foedus::restart::RestartManagerPimpl::recover(), foedus::restart::RestartManagerPimpl::redo_meta_logs(), foedus::log::LogManagerPimpl::refresh_global_durable_epoch(), foedus::storage::StorageManagerPimpl::reinitialize_for_recovered_snapshot(), foedus::restart::RestartOptions::save(), foedus::savepoint::SavepointOptions::save(), foedus::snapshot::SnapshotMetadata::save(), foedus::storage::StorageOptions::save(), foedus::thread::ThreadOptions::save(), foedus::xct::XctOptions::save(), foedus::fs::DeviceEmulationOptions::save(), foedus::proc::ProcOptions::save(), foedus::storage::sequential::SequentialMetadataSerializer::save(), foedus::storage::hash::HashMetadataSerializer::save(), foedus::soc::SocOptions::save(), foedus::storage::array::ArrayMetadataSerializer::save(), foedus::cache::CacheOptions::save(), foedus::debugging::DebuggingOptions::save(), foedus::log::LogOptions::save(), foedus::savepoint::Savepoint::save(), foedus::memory::MemoryOptions::save(), foedus::storage::masstree::MasstreeMetadataSerializer::save(), foedus::EngineOptions::save(), foedus::snapshot::SnapshotOptions::save(), foedus::storage::MetadataSerializer::save_all_storages_to_xml(), foedus::storage::MetadataSerializer::save_base(), foedus::externalize::Externalizable::save_to_file(), foedus::snapshot::SnapshotManagerPimpl::snapshot_metadata(), foedus::snapshot::SnapshotManagerPimpl::snapshot_savepoint(), foedus::debugging::DebuggingSupports::start_profile(), foedus::cache::CacheManagerPimpl::stop_cleaner(), foedus::ErrorStackBatch::summarize(), foedus::savepoint::SavepointManagerPimpl::take_savepoint(), foedus::savepoint::SavepointManagerPimpl::take_savepoint_after_snapshot(), foedus::FixedErrorStack::to_error_stack(), foedus::storage::sequential::SequentialStoragePimpl::truncate(), foedus::DefaultInitializable::uninitialize(), foedus::debugging::DebuggingSupports::uninitialize_once(), foedus::cache::CacheManagerPimpl::uninitialize_once(), foedus::log::MetaLogger::uninitialize_once(), foedus::proc::ProcManagerPimpl::uninitialize_once(), foedus::memory::PagePoolPimpl::uninitialize_once(), foedus::log::ThreadLogBuffer::uninitialize_once(), foedus::snapshot::MergeSort::uninitialize_once(), foedus::storage::masstree::verify_page_basic(), foedus::storage::array::ArrayStoragePimpl::verify_single_thread(), foedus::storage::hash::HashStoragePimpl::verify_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread(), foedus::cache::CacheHashtable::verify_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread_border(), foedus::storage::hash::HashStoragePimpl::verify_single_thread_data(), foedus::storage::hash::HashStoragePimpl::verify_single_thread_intermediate(), foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread_intermediate(), foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread_layer(), foedus::soc::SocManagerPimpl::wait_for_child_attach(), foedus::soc::SocManagerPimpl::wait_for_child_terminate(), foedus::soc::SocManagerPimpl::wait_for_children_module(), foedus::soc::SocManagerPimpl::wait_for_master_module(), and foedus::soc::SocManagerPimpl::wait_for_master_status().