Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanpeng Wei committed Feb 14, 2025
2 parents ec4ad6d + ba43e8c commit 177efc2
Show file tree
Hide file tree
Showing 24 changed files with 220 additions and 271 deletions.
226 changes: 2 additions & 224 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,226 +1,4 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: "^ IWYU pragma:"
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: true
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: NextLine
BasedOnStyle: ""
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: "^<.*"
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: ".*"
Priority: 3
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: "([-_](test|unittest))?$"
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: false
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
PPIndentWidth: -1
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- "c++"
- "C++"
CanonicalDelimiter: ""
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
- ParseTestProto
- ParsePartialTestProto
CanonicalDelimiter: pb
BasedOnStyle: google
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Auto
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
---

BasedOnStyle: Google
IndentWidth: 4
2 changes: 2 additions & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/*
external/*
11 changes: 11 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Clang Format Checker
on: [push]
jobs:
clang-format-checking:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: RafikFarhad/clang-format-github-action@v3
with:
sources: "src/**/*.h,src/**/*.c,test/**/*.c"
style: "file"
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
path = external/rocksdb
url = [email protected]:BU-DiSC/rocksdb.git
branch = sortedness
[submodule "external/leveldb_bliss"]
path = external/leveldb_bliss
url = [email protected]:JslYoon/leveldb_bliss.git
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ project(bliss_benchmark VERSION 1.0
LANGUAGES CXX
)

set(BUILD_TESTING OFF CACHE BOOL "Disable testing" FORCE)
set(LEVELDB_BUILD_TESTS OFF CACHE BOOL "Disable LevelDB tests" FORCE)


include(ExternalProject)
message(STATUS "CXX : ${CMAKE_CXX_COMPILER}")
set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -58,6 +62,7 @@ add_library(bliss OBJECT
${CMAKE_SOURCE_DIR}/src/bliss/bench_skiplist.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_pgm.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_art.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_leveldb.h
)

target_compile_features(bliss PUBLIC
Expand Down Expand Up @@ -108,3 +113,9 @@ add_executable(bliss_bench src/bliss_bench.cpp)
target_link_libraries(bliss_bench PUBLIC
bliss
)

add_subdirectory(${CMAKE_SOURCE_DIR}/external/leveldb_bliss)
target_include_directories(bliss PUBLIC ${CMAKE_SOURCE_DIR}/external/leveldb_bliss/include)
target_link_libraries(bliss PRIVATE leveldb)

include_directories(${CMAKE_SOURCE_DIR}/external/leveldb_bliss/include)
4 changes: 4 additions & 0 deletions src/bliss/bench_alex.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class BlissAlexIndex : public BlissIndex<KEY_TYPE, VALUE_TYPE> {
return it != _index.end();
}

bool get(KEY_TYPE start, KEY_TYPE end) override {
throw std::runtime_error("Not implemented");
}

void put(KEY_TYPE key, VALUE_TYPE value) override {
_index.insert(key, value);
}
Expand Down
7 changes: 5 additions & 2 deletions src/bliss/bench_art.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ class BlissARTIndex : public BlissIndex<KEY_TYPE, VALUE_TYPE> {
bool get(KEY_TYPE key) override {
uint8_t ARTkey[KEY_SIZE];
ART::loadKey(key, ARTkey);
ART::ArtNode* leaf =
ART::lookup(_index, ARTkey, KEY_SIZE, 0, KEY_SIZE);
ART::ArtNode* leaf = ART::lookup(_index, ARTkey, KEY_SIZE, 0, KEY_SIZE);
return leaf != nullptr && ART::isLeaf(leaf);
}

bool get(KEY_TYPE start, KEY_TYPE end) override {
throw std::runtime_error("Not implemented");
}

void put(KEY_TYPE key, VALUE_TYPE value) override {
uint8_t ARTkey[KEY_SIZE];
ART::loadKey(key, ARTkey);
Expand Down
10 changes: 6 additions & 4 deletions src/bliss/bench_btree.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@

#include "bliss/bliss_index.h"
#include "tlx/container/btree_map.hpp"

namespace bliss {

template <typename KEY_TYPE, typename VALUE_TYPE>
class BlissBTreeIndex : public BlissIndex<KEY_TYPE, VALUE_TYPE> {
public:
tlx::btree_map<KEY_TYPE, VALUE_TYPE> _index;
BlissBTreeIndex() : _index(){};
BlissBTreeIndex() : _index() {};

void bulkload(
std::vector<std::pair<KEY_TYPE, VALUE_TYPE>> values) override {
// expects the pairs to be pre-sorted before performing bulk load
this->_index.bulk_load(values.begin(), values.end());
}

bool get(KEY_TYPE key) override {
return this->_index.exists(key); }
bool get(KEY_TYPE key) override { return this->_index.exists(key); }

bool get(KEY_TYPE start, KEY_TYPE end) override {
throw std::runtime_error("Not implemented");
}

void put(KEY_TYPE key, VALUE_TYPE value) override {
this->_index.insert(std::make_pair(key, value));
Expand Down
7 changes: 5 additions & 2 deletions src/bliss/bench_columnsketches.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ class BlissColumnSketchesIndex : public BlissIndex<KEY_TYPE, VALUE_TYPE> {
columnsketches_->create(&vals[0], vals.size(), vals.size());
}

unsigned int * get(VALUE_TYPE low, VALUE_TYPE high) {
return columnsketches_->query_ge_lt(low, high);
bool get(VALUE_TYPE start, VALUE_TYPE end) {
uint32_t *res = columnsketches_->query_ge_lt(start, end);
bool succeed = res != nullptr;
if(succeed) delete res;
return succeed;
}

bool get(KEY_TYPE key) override {
Expand Down
Loading

0 comments on commit 177efc2

Please sign in to comment.