Hermes  0.9.5-beta
Hierarchical Distributed I/O Buffering System
constants.h
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Distributed under BSD 3-Clause license. *
3  * Copyright by The HDF Group. *
4  * Copyright by the Illinois Institute of Technology. *
5  * All rights reserved. *
6  * *
7  * This file is part of Hermes. The full Hermes copyright notice, including *
8  * terms governing use, modification, and redistribution, is contained in *
9  * the COPYING file, which can be found at the top directory. If you do not *
10  * have access to the file, you may request a copy from help@hdfgroup.org. *
11  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12 
13 #ifndef HERMES_ADAPTER_CONSTANTS_H
14 #define HERMES_ADAPTER_CONSTANTS_H
15 
16 #include <glog/logging.h>
17 
27 const char* kHermesConf = "HERMES_CONF";
28 
36 const char* kHermesClient = "HERMES_CLIENT";
37 
47 const char* kHermesAsyncFlush = "HERMES_ASYNC_FLUSH";
48 
53 const char* kHermesExtension = ".hermes";
64 const char* kAdapterMode = "ADAPTER_MODE";
73 const char* kAdapterModeInfo = "ADAPTER_MODE_INFO";
77 const char kPathDelimiter = ',';
81 const char* kAdapterDefaultMode = "DEFAULT";
82 const char* kAdapterBypassMode = "BYPASS";
83 const char* kAdapterScratchMode = "SCRATCH";
84 const char* kAdapterWorkflowMode = "WORKFLOW";
85 
93 const char* kStopDaemon = "HERMES_STOP_DAEMON";
94 
105 const size_t kPageSize = []() {
106  const char* kPageSizeVar = "HERMES_PAGE_SIZE";
107  const size_t kDefaultPageSize = 1 * 1024 * 1024;
108 
109  size_t result = kDefaultPageSize;
110  char* page_size = getenv(kPageSizeVar);
111 
112  if (page_size) {
113  result = (size_t)std::strtoull(page_size, NULL, 0);
114  if (result == 0) {
115  LOG(FATAL) << "Invalid value of " << kPageSizeVar << ": " << page_size;
116  }
117  }
118 
119  return result;
120 }();
121 
126 const char* kHermesWriteOnlyVar = "HERMES_WRITE_ONLY";
127 
128 #endif // HERMES_ADAPTER_CONSTANTS_H