Fixed get version on windows, moved throwing exceptions into cc file.

Summary:
Fixes for msys2 and mingw, hide exceptions into cpp  file.
Closes https://github.com/facebook/rocksdb/pull/3377

Differential Revision: D6746707

Pulled By: yiwu-arbug

fbshipit-source-id: 456b38df80bc48b8386a2cf87f669b5a4f9999a4
main
topilski 7 years ago committed by Facebook Github Bot
parent 4decff6fa8
commit b9873162f0
  1. 27
      CMakeLists.txt
  2. 8
      db/memtable.cc
  3. 8
      include/rocksdb/memtablerep.h

@ -129,20 +129,19 @@ endif()
string(REGEX REPLACE "[^0-9a-f]+" "" GIT_SHA "${GIT_SHA}") string(REGEX REPLACE "[^0-9a-f]+" "" GIT_SHA "${GIT_SHA}")
if(NOT WIN32) set(SH_CMD "sh")
execute_process(COMMAND execute_process(COMMAND
"./build_tools/version.sh" "full" ${SH_CMD} -c "build_tools/version.sh full"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE ROCKSDB_VERSION OUTPUT_VARIABLE ROCKSDB_VERSION
) )
string(STRIP "${ROCKSDB_VERSION}" ROCKSDB_VERSION) string(STRIP "${ROCKSDB_VERSION}" ROCKSDB_VERSION)
execute_process(COMMAND execute_process(COMMAND
"./build_tools/version.sh" "major" ${SH_CMD} -c "build_tools/version.sh major"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE ROCKSDB_VERSION_MAJOR OUTPUT_VARIABLE ROCKSDB_VERSION_MAJOR
) )
string(STRIP "${ROCKSDB_VERSION_MAJOR}" ROCKSDB_VERSION_MAJOR) string(STRIP "${ROCKSDB_VERSION_MAJOR}" ROCKSDB_VERSION_MAJOR)
endif()
option(WITH_MD_LIBRARY "build with MD" ON) option(WITH_MD_LIBRARY "build with MD" ON)
if(WIN32 AND MSVC) if(WIN32 AND MSVC)

@ -236,6 +236,14 @@ int MemTable::KeyComparator::operator()(const char* prefix_len_key,
return comparator.Compare(a, key); return comparator.Compare(a, key);
} }
void MemTableRep::InsertConcurrently(KeyHandle handle) {
#ifndef ROCKSDB_LITE
throw std::runtime_error("concurrent insert not supported");
#else
abort();
#endif
}
Slice MemTableRep::UserKey(const char* key) const { Slice MemTableRep::UserKey(const char* key) const {
Slice slice = GetLengthPrefixedSlice(key); Slice slice = GetLengthPrefixedSlice(key);
return Slice(slice.data(), slice.size() - 8); return Slice(slice.data(), slice.size() - 8);

@ -96,13 +96,7 @@ class MemTableRep {
// Like Insert(handle), but may be called concurrent with other calls // Like Insert(handle), but may be called concurrent with other calls
// to InsertConcurrently for other handles // to InsertConcurrently for other handles
virtual void InsertConcurrently(KeyHandle handle) { virtual void InsertConcurrently(KeyHandle handle);
#ifndef ROCKSDB_LITE
throw std::runtime_error("concurrent insert not supported");
#else
abort();
#endif
}
// Returns true iff an entry that compares equal to key is in the collection. // Returns true iff an entry that compares equal to key is in the collection.
virtual bool Contains(const char* key) const = 0; virtual bool Contains(const char* key) const = 0;

Loading…
Cancel
Save