-
Notifications
You must be signed in to change notification settings - Fork 570
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C++] Remote Device for FasterKv (#353)
* [C++] Add in Azure Blob Store source and test files * [C++] Integrate Blob device tests with CMakefile * [C++] Add in an example for FASTER with Blob device * [C++] Get blob device tests to work against Azurite * [C++] Update docs with Remote Device description * [C++] Docs for Remote Device dependencies on Linux * [C++] Blob device on Windows * [C++] Blob device compiles on Linux (Not tested) * [C++] Fix blob device wchar * [C++] Fix Blob device IO size. If FASTER's page size and the remote tiers max write size don't match, then break down IOs appropriately. * [C++] Update README for Blob device * [C++] Comment out Blob device CI
- Loading branch information
1 parent
e9f5e11
commit 4d9fcde
Showing
14 changed files
with
2,560 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
# | ||
# Installs all Azure related dependencies to run the blob device. | ||
|
||
apt update && \ | ||
apt install --assume-yes cmake uuid-dev libboost-all-dev \ | ||
libboost-atomic-dev libboost-thread-dev libboost-system-dev \ | ||
libboost-date-time-dev libboost-regex-dev libboost-filesystem-dev \ | ||
libboost-random-dev libboost-chrono-dev libboost-serialization-dev \ | ||
libwebsocketpp-dev openssl libssl-dev ninja-build libxml2-dev g++-5 | ||
|
||
CASABLANCA_VERSION="v2.10.14" | ||
|
||
# Clones, compiles and installs Casablanca (cpprestsdk). The version | ||
# used is that specified in CASABLANCA_VERSION above. | ||
setup_casablanca() { | ||
git clone https://github.com/Microsoft/cpprestsdk.git casablanca | ||
cd casablanca | ||
|
||
git checkout tags/"$CASABLANCA_VERSION" | ||
mkdir build.release | ||
cd build.release | ||
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release | ||
ninja | ||
ninja install | ||
|
||
cd ../ | ||
cd ../ | ||
} | ||
|
||
AZURESTORE_VERSION="v7.0.0" | ||
|
||
# Clones, compiles and installs the azure storage cpp library. The version | ||
# used is that specified in AZURESTORE_VERSION above. | ||
setup_azurestore() { | ||
git clone https://github.com/Azure/azure-storage-cpp.git | ||
cd azure-storage-cpp/Microsoft.WindowsAzure.Storage | ||
|
||
git checkout tags/"$AZURESTORE_VERSION" | ||
mkdir build.release | ||
cd build.release | ||
CXX=g++-5 cmake .. -DCMAKE_BUILD_TYPE=Release | ||
make -j8 | ||
make install | ||
|
||
cd ../ | ||
cd ../ | ||
} | ||
|
||
setup_casablanca | ||
setup_azurestore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
#pragma once | ||
|
||
#include <time.h> | ||
#include <stdio.h> | ||
#include <stdarg.h> | ||
|
||
#include <chrono> | ||
|
||
/// Defines the type of log messages supported by the system. | ||
enum class Lvl { | ||
DEBUG = 0, | ||
INFO = 1, | ||
ERR = 2, | ||
}; | ||
|
||
/// By default, only print ERROR log messages. | ||
#define LEVEL Lvl::INFO | ||
|
||
/// Macro to add in the file and function name, and line number. | ||
#ifdef _WIN32 | ||
#define logMessage(l, f, ...) logMsg(l, __LINE__, __func__, __FILE__, f, __VA_ARGS__) | ||
#else | ||
#define logMessage(l, f, a...) logMsg(l, __LINE__, __func__, __FILE__, f, ##a) | ||
#endif | ||
|
||
/// Prints out a message with the current timestamp and code location. | ||
inline void logMsg(Lvl level, int line, const char* func, | ||
const char* file, const char* fmt, ...) | ||
{ | ||
// Do not print messages below the current level. | ||
if (level < static_cast<Lvl>(LEVEL)) return; | ||
|
||
auto now = std::chrono::high_resolution_clock::now().time_since_epoch(); | ||
|
||
va_list argptr; | ||
va_start(argptr, fmt); | ||
|
||
char buffer[1024]; | ||
vsnprintf(buffer, 1024, fmt, argptr); | ||
|
||
std::string l; | ||
switch (level) { | ||
case Lvl::DEBUG: | ||
l = std::string("DEBUG"); | ||
break; | ||
case Lvl::INFO: | ||
l = std::string("INFO"); | ||
break; | ||
default: | ||
l = std::string("ERROR"); | ||
break; | ||
} | ||
|
||
fprintf(stderr, "[%010lu.%09lu]::%s::%s:%s:%d:: %s\n", | ||
(unsigned long) std::chrono::duration_cast<std::chrono::seconds>(now).count(), | ||
(unsigned long) std::chrono::duration_cast<std::chrono::nanoseconds>(now).count(), | ||
l.c_str(), file, func, line, buffer); | ||
|
||
va_end(argptr); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.