OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
omnisci Namespace Reference

Namespaces

 _parsers
 
 _samlutils
 
 _utils
 
 common
 
 completion_hints
 
 connection
 
 cursor
 
 dtypes
 
 exceptions
 
 extension_functions
 
 serialized_result_set
 
 thrift
 

Classes

struct  DeviceIdentifier
 
class  UUID
 

Typedefs

using DeviceGroup = std::vector< DeviceIdentifier >
 

Functions

size_t file_size (const int fd)
 
void * checked_mmap (const int fd, const size_t sz)
 
void checked_munmap (void *addr, size_t length)
 
int msync (void *addr, size_t length, bool async)
 
int fsync (int fd)
 
int open (const char *path, int flags, int mode)
 
void close (const int fd)
 
int get_page_size ()
 
std::vector< std::string > glob (const std::string &pattern)
 
std::string get_hostname ()
 
std::string get_root_abs_path ()
 
bool operator== (const UUID &lhs, const UUID &rhs) noexcept
 
bool operator!= (const UUID &lhs, const UUID &rhs) noexcept
 
bool operator< (const UUID &lhs, const UUID &rhs) noexcept
 
std::string to_string (const UUID &uuid)
 

Variables

tuple __version__ = get_distribution(__name__)
 
string apilevel = "2.0"
 
int threadsafety = 2
 
string paramstyle = "named"
 
constexpr UUID empty_uuid {}
 

Typedef Documentation

using omnisci::DeviceGroup = typedef std::vector<DeviceIdentifier>

Definition at line 15 of file DeviceGroup.h.

Function Documentation

void * omnisci::checked_mmap ( const int  fd,
const size_t  sz 
)

Definition at line 38 of file omnisci_fs.cpp.

References CHECK.

Referenced by StringDictionary::checkAndConditionallyIncreaseOffsetCapacity(), StringDictionary::checkAndConditionallyIncreasePayloadCapacity(), and StringDictionary::StringDictionary().

38  {
39  auto ptr = mmap(nullptr, sz, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0);
40  CHECK(ptr != reinterpret_cast<void*>(-1));
41 #ifdef __linux__
42 #ifdef MADV_HUGEPAGE
43  madvise(ptr, sz, MADV_RANDOM | MADV_WILLNEED | MADV_HUGEPAGE);
44 #else
45  madvise(ptr, sz, MADV_RANDOM | MADV_WILLNEED);
46 #endif
47 #endif
48  return ptr;
49 }
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the caller graph for this function:

void omnisci::checked_munmap ( void *  addr,
size_t  length 
)

Definition at line 51 of file omnisci_fs.cpp.

References CHECK_EQ.

Referenced by StringDictionary::checkAndConditionallyIncreaseOffsetCapacity(), StringDictionary::checkAndConditionallyIncreasePayloadCapacity(), and StringDictionary::~StringDictionary().

51  {
52  CHECK_EQ(0, munmap(addr, length));
53 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205

+ Here is the caller graph for this function:

void omnisci::close ( const int  fd)

Definition at line 68 of file omnisci_fs.cpp.

Referenced by import_export::DataStreamSink::import_compressed(), CommandLineOptions::validate(), and StringDictionary::~StringDictionary().

68  {
69  ::close(fd);
70 }
void close(const int fd)
Definition: omnisci_fs.cpp:68

+ Here is the caller graph for this function:

size_t omnisci::file_size ( const int  fd)

Definition at line 31 of file omnisci_fs.cpp.

References CHECK_EQ.

Referenced by anonymous_namespace{TableArchiver.cpp}::adjust_altered_table_files(), get_filesize(), File_Namespace::FileMgr::init(), File_Namespace::FileMgr::openDBMetaFile(), File_Namespace::FileMgr::openEpochFile(), foreign_storage::ForeignStorageCache::setLimit(), and StringDictionary::StringDictionary().

31  {
32  struct stat buf;
33  int err = fstat(fd, &buf);
34  CHECK_EQ(0, err);
35  return buf.st_size;
36 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205

+ Here is the caller graph for this function:

int omnisci::fsync ( int  fd)

Definition at line 60 of file omnisci_fs.cpp.

Referenced by StringDictionary::checkpoint(), File_Namespace::FileInfo::syncToDisk(), and File_Namespace::FileMgr::writeAndSyncEpochToDisk().

60  {
61  return ::fsync(fd);
62 }
int fsync(int fd)
Definition: omnisci_fs.cpp:60

+ Here is the caller graph for this function:

std::string omnisci::get_hostname ( )

Definition at line 23 of file omnisci_hostname.cpp.

Referenced by DBHandler::get_memory(), DBHandler::get_server_status(), and DBHandler::get_status().

23  {
24  char hostname[_POSIX_HOST_NAME_MAX];
25  gethostname(hostname, _POSIX_HOST_NAME_MAX);
26  return {hostname};
27 }

+ Here is the caller graph for this function:

int omnisci::get_page_size ( )

Definition at line 27 of file omnisci_fs.cpp.

27  {
28  return getpagesize();
29 }
std::string omnisci::get_root_abs_path ( )

Definition at line 32 of file omnisci_path.cpp.

References CHECK_GT, and CHECK_LT.

Referenced by import_export::GDAL::init(), main(), and start_calcite_server_as_daemon().

32  {
33 #ifdef __APPLE__
34  char abs_exe_path[PROC_PIDPATHINFO_MAXSIZE] = {0};
35  auto path_len = proc_pidpath(getpid(), abs_exe_path, sizeof(abs_exe_path));
36 #else
37  char abs_exe_path[PATH_MAX] = {0};
38  auto path_len = readlink("/proc/self/exe", abs_exe_path, sizeof(abs_exe_path));
39 #endif
40  CHECK_GT(path_len, 0);
41  CHECK_LT(static_cast<size_t>(path_len), sizeof(abs_exe_path));
42  boost::filesystem::path abs_exe_dir(std::string(abs_exe_path, path_len));
43  abs_exe_dir.remove_filename();
44 #ifdef XCODE
45  const auto mapd_root = abs_exe_dir.parent_path().parent_path();
46 #else
47  const auto mapd_root = abs_exe_dir.parent_path();
48 #endif
49  return mapd_root.string();
50 }
#define CHECK_GT(x, y)
Definition: Logger.h:209
#define CHECK_LT(x, y)
Definition: Logger.h:207

+ Here is the caller graph for this function:

std::vector< std::string > omnisci::glob ( const std::string &  pattern)

Definition at line 24 of file omnisci_glob.cpp.

Referenced by import_export::DataStreamSink::archivePlumber(), and ddl_utils::get_expanded_file_paths().

24  {
25  std::vector<std::string> results;
26  glob_t glob_result;
27  ::glob(pattern.c_str(), GLOB_BRACE | GLOB_TILDE, nullptr, &glob_result);
28  for (size_t i = 0; i < glob_result.gl_pathc; i++) {
29  results.emplace_back(glob_result.gl_pathv[i]);
30  }
31  globfree(&glob_result);
32  return results;
33 }
std::vector< std::string > glob(const std::string &pattern)

+ Here is the caller graph for this function:

int omnisci::msync ( void *  addr,
size_t  length,
bool  async 
)

Definition at line 55 of file omnisci_fs.cpp.

Referenced by StringDictionary::checkpoint().

55  {
56  // TODO: support MS_INVALIDATE?
57  return ::msync(addr, length, async ? MS_ASYNC : MS_SYNC);
58 }
int msync(void *addr, size_t length, bool async)
Definition: omnisci_fs.cpp:55

+ Here is the caller graph for this function:

int omnisci::open ( const char *  path,
int  flags,
int  mode 
)

Definition at line 64 of file omnisci_fs.cpp.

Referenced by anonymous_namespace{StringDictionary.cpp}::checked_open(), create_table.SyntheticTable::generateData(), analyze_benchmark.BenchmarkLoader::load(), run_benchmark::read_query_files(), run_benchmark::send_results_db(), run_benchmark::send_results_file_json(), run_benchmark::send_results_jenkins_bench(), and CommandLineOptions::validate().

64  {
65  return ::open(path, flags, mode);
66 }
int open(const char *path, int flags, int mode)
Definition: omnisci_fs.cpp:64

+ Here is the caller graph for this function:

bool omnisci::operator!= ( const UUID &  lhs,
const UUID &  rhs 
)
inlinenoexcept

Definition at line 103 of file uuid.h.

103  {
104  return !(lhs == rhs);
105 }
bool omnisci::operator< ( const UUID &  lhs,
const UUID &  rhs 
)
inlinenoexcept

Definition at line 107 of file uuid.h.

107  {
108  return lhs.data_ < rhs.data_;
109 }
bool omnisci::operator== ( const UUID &  lhs,
const UUID &  rhs 
)
inlinenoexcept

Definition at line 99 of file uuid.h.

99  {
100  return lhs.data_ == rhs.data_;
101 }
std::string omnisci::to_string ( const UUID &  uuid)
inline

Definition at line 111 of file uuid.h.

111  {
112  std::stringstream ss;
113  ss << uuid;
114  return ss.str();
115 }

Variable Documentation

tuple omnisci.__version__ = get_distribution(__name__)

Definition at line 5 of file __init__.py.

string omnisci.apilevel = "2.0"

Definition at line 13 of file __init__.py.

constexpr UUID omnisci::empty_uuid {}

Definition at line 117 of file uuid.h.

string omnisci.paramstyle = "named"

Definition at line 15 of file __init__.py.

int omnisci.threadsafety = 2

Definition at line 14 of file __init__.py.