Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlazingMQ Storage Tool #158

Merged
merged 130 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
6e6e89b
Add processor factory and base processor
alexander-e1off Nov 28, 2023
6650273
Merge branch 'bmqstoragetool' of https://github.com/waldgange/blazing…
alexander-e1off Nov 28, 2023
cf32325
Fix unit test
alexander-e1off Nov 28, 2023
1f5d078
Fix merge conflicts
alexander-e1off Nov 28, 2023
0678d64
BMQstoragetool initial commit
waldgange Nov 22, 2023
d32c69d
Formatting
waldgange Nov 28, 2023
2245226
Help parameter
waldgange Nov 28, 2023
fcfe317
Dummy
waldgange Nov 28, 2023
c93fba3
Dummy
Nov 28, 2023
6f441c8
Merge branch 'bmqstoragetool' of https://github.com/waldgange/blazing…
alexander-e1off Nov 28, 2023
d770a6c
Plugins come back
waldgange Nov 28, 2023
4e36022
Formatting
waldgange Nov 28, 2023
85701aa
Add logic to search by GUID
alexander-e1off Nov 28, 2023
7a691aa
Update search logic and tests
alexander-e1off Nov 29, 2023
0c2e2ab
Add outstanding messages search
alexander-e1off Nov 30, 2023
be00e06
Validate cmd arguments and create a command processor
waldgange Dec 6, 2023
504d000
Validate cmd arguments and create a command processor
waldgange Dec 6, 2023
e9cbafd
Formatting
waldgange Dec 6, 2023
88eb30f
Add calculation of outstanding ratio
alexander-e1off Dec 6, 2023
cfa3df8
Merge from bmqtool branch, fix conflicts
alexander-e1off Dec 6, 2023
164e7cb
Get rid of SearchParameters
alexander-e1off Dec 6, 2023
e5852d0
Add searching of confirmed and partially confirmed messages
alexander-e1off Dec 7, 2023
91bf21d
Fix guids check
waldgange Dec 7, 2023
8e95247
Refactor to use SearchResult classes
alexander-e1off Dec 7, 2023
885ea53
Map files in validator
waldgange Dec 8, 2023
dfcc4c8
Integrate SearchProcessor with updated Parameters, fix integration is…
alexander-e1off Dec 11, 2023
e9bdf04
Refactor to use iterator pointers
alexander-e1off Dec 11, 2023
d9224b5
Pass journal file iterator in params for testing
alexander-e1off Dec 11, 2023
a98f3b0
Add filters support
alexander-e1off Dec 12, 2023
1d75104
Merge branch 'main' into bmqstoragetool
alexander-e1off Dec 13, 2023
6b3feaa
Add message details option support
alexander-e1off Dec 14, 2023
e6dc022
Format details output
alexander-e1off Dec 15, 2023
0b006be
Update message details output
alexander-e1off Dec 15, 2023
b391350
Add payload dump support
alexander-e1off Dec 19, 2023
fa27c72
Add search by queue name and test
alexander-e1off Dec 28, 2023
99a9413
Fix test name
alexander-e1off Dec 28, 2023
7b4deb2
Rename QueueInfo to QueueMap
alexander-e1off Dec 28, 2023
ddb82a6
Move logic to QueueMap class
alexander-e1off Jan 2, 2024
5b43d76
Merge pull request #1 from waldgange/search-processor
waldgange Jan 2, 2024
986848e
Fix data file iteration and add test for payload dump
alexander-e1off Jan 3, 2024
29e6317
Merge branch 'search-processor' into bmqstoragetool
alexander-e1off Jan 3, 2024
ef28b02
Output queue uri and appId if queue info is present
alexander-e1off Jan 5, 2024
fe22875
Timestamps filtering
waldgange Jan 2, 2024
3519c6d
Filter messagess by timestamp
waldgange Jan 8, 2024
870e05b
Restore lost code after merge
waldgange Jan 8, 2024
85f8e5e
Fix search processor init
waldgange Jan 8, 2024
6cd8a53
Timestamp validation fix
waldgange Jan 8, 2024
11a1223
Add handling of QueueUpdateAdvisory record
alexander-e1off Jan 9, 2024
26bbac9
Fix output of outstanding ratio
alexander-e1off Jan 9, 2024
7d95244
Replace bsl::endl with '\n' for performance
alexander-e1off Jan 9, 2024
9194a5a
Add ledger config callback stubs
alexander-e1off Jan 9, 2024
868edc8
Handle CSL iterator error as end of file
alexander-e1off Jan 11, 2024
f39adad
Add queue key validation
alexander-e1off Jan 11, 2024
e8b5df9
Add summary output
alexander-e1off Jan 12, 2024
f440df6
Implement binary search by timestamps
waldgange Jan 12, 2024
5e94d5d
Implement binary search by timestamps
waldgange Jan 12, 2024
a2a4c14
Add printing of journal and data files meta
alexander-e1off Jan 15, 2024
45e1281
Refactor test to use JournalFile helper class
alexander-e1off Jan 16, 2024
c2708c3
Fix test11 to check correct sequence of substrings
alexander-e1off Jan 17, 2024
e2c9cfc
Add default value for dump-limit
alexander-e1off Jan 17, 2024
8349df0
Fix dump-limit arg description
alexander-e1off Jan 17, 2024
b94d563
Add googletest package to build scripts
alexander-e1off Jan 18, 2024
a8fec0e
Add gmock to deps, fix install to lib64
alexander-e1off Jan 18, 2024
06ce0ff
Install googlemock as a system package
alexander-e1off Jan 18, 2024
65e75e2
Add backward search
waldgange Jan 15, 2024
4b47977
Optimize search by timestamps
waldgange Jan 22, 2024
24ae31b
Merge pull request #2 from waldgange/search-processor
waldgange Jan 22, 2024
ace3a44
Timestamp search optimization
waldgange Jan 22, 2024
72812c3
Fix docker build - add missed libgmock-dev dependency
alexander-e1off Jan 22, 2024
0135258
Merge branch 'bloomberg:main' into bmqstoragetool
waldgange Jan 23, 2024
a6f2849
Fix release build: make template implementation as inline
alexander-e1off Jan 23, 2024
a14a5ac
Fix formatting
alexander-e1off Jan 23, 2024
0db49a6
Remove unused header
alexander-e1off Jan 23, 2024
9c37ace
Fix summary
waldgange Jan 23, 2024
4fdee8f
Fix summary
waldgange Jan 23, 2024
0e9ed2e
Fix feedback comments: add limit validation and fix typos
alexander-e1off Jan 24, 2024
033e8ec
Add support of CTest for unit tests
alexander-e1off Jan 25, 2024
71a24f9
Fix sporadic test fail
alexander-e1off Jan 25, 2024
435a003
Add README.md, fix warnings
alexander-e1off Jan 25, 2024
6d27f22
Prepare code for review
alexander-e1off Jan 26, 2024
a15010e
Parameters refactoring
waldgange Jan 28, 2024
8cb37d3
Separate path argument for csl files
waldgange Jan 30, 2024
f8df6ba
Merge branch 'bmqstoragetool' of github.com:waldgange/blazingmq into …
waldgange Jan 30, 2024
8caaa7d
Merge branch 'parametersrefactoring' into bmqstoragetool
waldgange Jan 30, 2024
4e1aad8
Fix codestyle
waldgange Jan 31, 2024
00c31b1
Use oldschool MOCK_METHODs and fix metadata
waldgange Jan 31, 2024
6cee835
Exit if queue name validation failed
alexander-e1off Jan 30, 2024
a258cab
Refactor SearchResult classes
alexander-e1off Feb 1, 2024
173eeb1
Cleanup
alexander-e1off Feb 1, 2024
e457fbd
Refactor PartiallyConfirmedResult
alexander-e1off Feb 2, 2024
77f6e96
Remove old classes
alexander-e1off Feb 3, 2024
1355a5f
Merge pull request #3 from waldgange/search-processor
waldgange Feb 5, 2024
2dfb637
Refactor SearchGuidDecorator and SummaryProcessor
alexander-e1off Feb 2, 2024
f64aae3
Move creation of SearchResult classes into factory method
alexander-e1off Feb 6, 2024
b2e210a
Add SearchResultFactory
alexander-e1off Feb 6, 2024
409ba60
Unit tests for mqbs::JournalFileIterator::advance() method
waldgange Feb 1, 2024
330f1ab
Formatting
waldgange Feb 6, 2024
128a986
Cleanup SearchResultFactory
alexander-e1off Feb 6, 2024
e5bc42e
Refactor to use shared_ptr instead of unique_ptr
alexander-e1off Feb 6, 2024
aeda4a9
Cleanup stale TODOs
alexander-e1off Feb 6, 2024
bbbda4a
Cleanup test
alexander-e1off Feb 6, 2024
0c221b2
Fix class logo
alexander-e1off Feb 6, 2024
fc6e650
Refactor SearchResultFactory
alexander-e1off Feb 7, 2024
a05d7c2
Fix summary output caption
alexander-e1off Feb 7, 2024
bf9a638
Add unit tests for binary search by timestamps
waldgange Feb 8, 2024
34c42b1
Merge pull request #4 from waldgange/search-processor
waldgange Feb 8, 2024
f11d771
Add unit tests for binary search by timestamps
waldgange Feb 8, 2024
59e9ac3
Merge branch 'main' into bmqstoragetool
alexander-e1off Feb 13, 2024
46cb8ed
Fix alignment
alexander-e1off Feb 14, 2024
5ae759c
Split Parameters into POD and FileManager
waldgange Feb 20, 2024
fe5f7ce
Split Parameters into POD and FileManager
waldgange Feb 20, 2024
5a2f81e
Remove filename lines
waldgange Feb 20, 2024
c392a38
Support queueKey and queueName simultaneously
alexander-e1off Feb 20, 2024
392edc5
Handle review notes
waldgange Feb 26, 2024
8045242
Formatting
waldgange Feb 26, 2024
7d9f8b3
Handle review notes
waldgange Feb 26, 2024
58fba50
Check hex
waldgange Feb 26, 2024
62beba3
Fix code style and add code documentation
alexander-e1off Feb 28, 2024
aef96d7
Merge pull request #5 from waldgange/search-processor
waldgange Feb 29, 2024
30b4766
Merge branch 'bloomberg:main' into bmqstoragetool
alexander-e1off Feb 29, 2024
b854cde
Add gtest to build_macosx CI task
alexander-e1off Feb 28, 2024
319b87f
Add gmock to deps, add path to pkgconfig
alexander-e1off Mar 1, 2024
5dbaf98
Use symlink path for pkgconfig
alexander-e1off Mar 1, 2024
9e01758
Address review pt2
waldgange Mar 1, 2024
0c5b339
Address review pt3
waldgange Mar 4, 2024
3029739
Address review pt4 Compile with C++03
waldgange Mar 7, 2024
f71881d
Add description for AppIdMatcher class
waldgange Mar 8, 2024
b110624
Merge branch 'bloomberg:main' into bmqstoragetool
waldgange Mar 12, 2024
5c5d9a3
Address review pt5
waldgange Mar 15, 2024
1385719
Merge branch 'bloomberg:main' into bmqstoragetool
waldgange Mar 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
bison \
libfl-dev \
libbenchmark-dev \
libgmock-dev \
libz-dev
- name: Create dependency fetcher working directory
run: mkdir -p deps
Expand Down Expand Up @@ -163,6 +164,7 @@ jobs:
bison \
libfl-dev \
libbenchmark-dev \
libgmock-dev \
libz-dev \
autoconf \
libtool
Expand Down
57 changes: 33 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,16 @@ endif()

if (NOT DEFINED INSTALL_TARGETS)
# If no specic install targets has been set, then enable them all
set(BMQ_TARGET_BMQBRKR_NEEDED YES)
set(BMQ_TARGET_BMQBRKRCFG_NEEDED YES)
set(BMQ_TARGET_BMQTOOL_NEEDED YES)
set(BMQ_TARGET_MWC_NEEDED YES)
set(BMQ_TARGET_BMQ_NEEDED YES)
set(BMQ_TARGET_MQB_NEEDED YES)
set(BMQ_TARGET_E_BMQBRKR_NEEDED YES)
set(BMQ_TARGET_TUTORIAL_NEEDED YES)
set(BMQ_TARGET_PROMETHEUS_NEEDED NO)
set(BMQ_TARGET_BMQBRKR_NEEDED YES)
set(BMQ_TARGET_BMQBRKRCFG_NEEDED YES)
set(BMQ_TARGET_BMQTOOL_NEEDED YES)
set(BMQ_TARGET_BMQSTORAGETOOL_NEEDED YES)
set(BMQ_TARGET_MWC_NEEDED YES)
set(BMQ_TARGET_BMQ_NEEDED YES)
set(BMQ_TARGET_MQB_NEEDED YES)
set(BMQ_TARGET_E_BMQBRKR_NEEDED YES)
set(BMQ_TARGET_TUTORIAL_NEEDED YES)
set(BMQ_TARGET_PROMETHEUS_NEEDED NO)
else()
bbproject_check_install_target("bmqbrkr" installBMQBRKR)
bbproject_check_install_target("BMQBRKR_NIGHTLY" installNightly)
Expand All @@ -126,21 +127,23 @@ else()

# Disable all by default, and then we'll enable selectively based on the
# content of INSTALL_TARGETS
set(BMQ_TARGET_BMQBRKR_NEEDED NO)
set(BMQ_TARGET_BMQBRKRCFG_NEEDED NO)
set(BMQ_TARGET_BMQTOOL_NEEDED NO)
set(BMQ_TARGET_MWC_NEEDED NO)
set(BMQ_TARGET_BMQ_NEEDED NO)
set(BMQ_TARGET_MQB_NEEDED NO)
set(BMQ_TARGET_TUTORIAL_NEEDED NO)
set(BMQ_TARGET_PROMETHEUS_NEEDED NO)

bbproject_check_install_target("mwc" installMWC)
bbproject_check_install_target("bmq" installBMQ)
bbproject_check_install_target("mqb" installMQB)
bbproject_check_install_target("bmqbrkrcfg" installBMQBRKRCFG)
bbproject_check_install_target("bmqtool" installBMQTOOL)
bbproject_check_install_target("prometheus" installPROMETHEUS)
set(BMQ_TARGET_BMQBRKR_NEEDED NO)
set(BMQ_TARGET_BMQBRKRCFG_NEEDED NO)
set(BMQ_TARGET_BMQTOOL_NEEDED NO)
set(BMQ_TARGET_BMQSTORAGETOOL_NEEDED NO)
set(BMQ_TARGET_MWC_NEEDED NO)
set(BMQ_TARGET_BMQ_NEEDED NO)
set(BMQ_TARGET_MQB_NEEDED NO)
set(BMQ_TARGET_TUTORIAL_NEEDED NO)
set(BMQ_TARGET_PROMETHEUS_NEEDED NO)

bbproject_check_install_target("mwc" installMWC)
bbproject_check_install_target("bmq" installBMQ)
bbproject_check_install_target("mqb" installMQB)
bbproject_check_install_target("bmqbrkrcfg" installBMQBRKRCFG)
bbproject_check_install_target("bmqtool" installBMQTOOL)
bbproject_check_install_target("bmqstoragetool" installBMQSTORAGETOOL)
bbproject_check_install_target("prometheus" installPROMETHEUS)

# NOTE: All targets should get 'mwc' from DPKG, except for the 'mwc' release
# itself (and the development work).
Expand Down Expand Up @@ -174,6 +177,12 @@ else()
set(BMQ_TARGET_BMQTOOL_NEEDED YES)
endif()

if (installBMQSTORAGETOOL)
set(BMQ_TARGET_BMQ_NEEDED YES)
set(BMQ_TARGET_MQB_NEEDED YES)
set(BMQ_TARGET_BMQSTORAGETOOL_NEEDED YES)
endif()

if (installPROMETHEUS)
set(BMQ_TARGET_MWC_NEEDED YES)
set(BMQ_TARGET_BMQ_NEEDED YES)
Expand Down
6 changes: 3 additions & 3 deletions bin/build-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ fi


# Build other dependencies
brew install flex bison google-benchmark zlib
brew install flex bison google-benchmark googletest zlib

# Determine paths based on Intel vs Apple Silicon CPU
if [ "$(uname -p)" == 'arm' ]; then
BREW_PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:/opt/homebrew/opt/zlib/lib/pkgconfig"
BREW_PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:/opt/homebrew/opt/zlib/lib/pkgconfig:/opt/homebrew/opt/googletest/lib/pkgconfig"
FLEX_ROOT="/opt/homebrew/opt/flex"
else
BREW_PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig"
BREW_PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/googletest/lib/pkgconfig"
FLEX_ROOT="/usr/local/opt/flex"
fi

Expand Down
1 change: 1 addition & 0 deletions bin/build-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sudo apt install -y --no-install-recommends \
bison \
libfl-dev \
libbenchmark-dev \
libgmock-dev \
libtool \
libz-dev
PREREQUISITES
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN apt-get update && \
bison \
libfl-dev \
libbenchmark-dev \
libgmock-dev \
libz-dev \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
Expand Down
97 changes: 97 additions & 0 deletions etc/cmake/BMQTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,103 @@ function(bmq_add_test target)
if(${target}_TEST_TARGETS)
bbs_import_target_dependencies(${target} ${${uor_name}_TEST_PCDEPS})
endif()

# Generate the test driver manifest file for compatibility with rat.rb
if(_COMPAT)
_bmq_target_generate_td_manifest(${target} TEST_DRIVERS ${td_manifest})
endif()

endif()

if(_COMPAT AND NOT TARGET all.td)
add_custom_target(all.td)
add_dependencies(all.td all.t)
endif()
endfunction()

# :: bmq_add_application_test :::::::::::::::::::::::::::::::::::::::::::::::::
# This function searches for the test drivers of an 'application' TARGET.
# It expects existence of intermediate library '${uor_name}_lib' which is
# created by 'bbs_setup_target_uor()'.
# It generates a target named ${UOR_component}.t and ${UOR_component}.td for
# each component found, and an all.td target which depends on all the tests
# together.
#
# The *.td targets should not be depended upon directly mostly exist for
# historical compatibility.
function(bmq_add_application_test target)
cmake_parse_arguments(PARSE_ARGV 1
""
"COMPAT"
"SOURCE_DIR"
"")

find_package(BdeBuildSystem REQUIRED)

# Get the name of the unit from the target
get_target_property(uor_name ${target} NAME)

# Use the current source directory if none is specified
if(NOT _SOURCE_DIR)
set(_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif()

# Check that BDE metadata exists and load it
if(NOT DEFINED ${uor_name}_PACKAGES)
if(EXISTS ${_SOURCE_DIR}/package)
bbs_read_metadata(PACKAGE ${uor_name}
SOURCE_DIR ${_SOURCE_DIR})
endif()
endif()

# Refer to intermediate library created by 'bbs_setup_target_uor()'
set(lib_target "${uor_name}_lib")

bbs_configure_target_tests(${lib_target}
SOURCES ${${uor_name}_TEST_SOURCES}
TEST_DEPS ${${uor_name}_PCDEPS}
${${uor_name}_TEST_PCDEPS}
LABELS "all" ${target})

if (TARGET ${lib_target}.t)
if (NOT TARGET ${target}.t)
add_custom_target(${target}.t)
endif()
add_dependencies(${target}.t ${lib_target}.t)
endif()

if (${lib_target}_TEST_TARGETS)
bbs_import_target_dependencies(${lib_target} ${${uor_name}_TEST_PCDEPS})
endif()

set(td_manifest)

if(${lib_target}_TEST_TARGETS)

if(NOT TARGET ${lib_target}.t)
add_custom_target(${lib_target}.t)
if(_COMPAT)
add_custom_target(${lib_target}.td)
endif()
endif()

add_dependencies(${lib_target}.t ${${lib_target}_TEST_TARGETS})

if(_COMPAT)
foreach(test_target ${${lib_target}_TEST_TARGETS})
string(REPLACE ".t" "" component ${test_target})
set_target_properties(${test_target} PROPERTIES OUTPUT_NAME "${test_target}.tsk")
list(APPEND td_manifest
"${component}: $<TARGET_FILE:${test_target}>")
endforeach()
endif()

bbs_import_target_dependencies(${lib_target} ${${uor_name}_TEST_PCDEPS})
endif()

# Generate the test driver manifest file for compatibility with rat.rb
if(_COMPAT)
_bmq_target_generate_td_manifest(${lib_target} TEST_DRIVERS ${td_manifest})
endif()

if(_COMPAT AND NOT TARGET all.td)
Expand Down
1 change: 1 addition & 0 deletions src/applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# ------------

add_subdirectory( bmqbrkr )
add_subdirectory( bmqstoragetool )
add_subdirectory( bmqtool )
21 changes: 21 additions & 0 deletions src/applications/bmqstoragetool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# bmqstoragetool
# --------------

if(NOT BMQ_TARGET_BMQSTORAGETOOL_NEEDED)
return()
endif()

add_executable(bmqstoragetool)

target_compile_definitions(bmqstoragetool PRIVATE "MWC_INTERNAL_USAGE")

target_bmq_default_compiler_flags(bmqstoragetool)

set_target_properties(bmqstoragetool
PROPERTIES OUTPUT_NAME "bmqstoragetool.tsk")
bbs_setup_target_uor(bmqstoragetool SKIP_TESTS)

include(BMQTest)
bmq_add_application_test(bmqstoragetool COMPAT)

install(TARGETS bmqstoragetool RUNTIME DESTINATION bin)
Loading
Loading