Skip to content

Moved basic usage topic test from ydb repo #514

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ jobs:
- name: Test
shell: bash
run: |
ctest -j$(nproc) --preset integration
YDB_VERSION=${{ matrix.ydb-version }} ctest -j$(nproc) --preset integration
27 changes: 2 additions & 25 deletions src/client/persqueue_public/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
add_subdirectory(codecs)
add_subdirectory(impl)
add_subdirectory(include)

_ydb_sdk_add_library(cpp-client-ydb_persqueue_public INTERFACE)

target_link_libraries(cpp-client-ydb_persqueue_public INTERFACE
yutil
cpp-client-ydb_persqueue_core
client-ydb_persqueue_public-include
client-ydb_persqueue_public-impl
client-ydb_persqueue_public-codecs
)

generate_enum_serilization(cpp-client-ydb_persqueue_public
${YDB_SDK_SOURCE_DIR}/src/client/persqueue_public/include/control_plane.h
INCLUDE_HEADERS
src/client/persqueue_public/include/control_plane.h
)

generate_enum_serilization(cpp-client-ydb_persqueue_public
${YDB_SDK_SOURCE_DIR}/src/client/persqueue_public/include/read_events.h
INCLUDE_HEADERS
src/client/persqueue_public/include/read_events.h
)

generate_enum_serilization(cpp-client-ydb_persqueue_public
${YDB_SDK_SOURCE_DIR}/src/client/persqueue_public/include/write_events.h
INCLUDE_HEADERS
src/client/persqueue_public/include/write_events.h
)

generate_enum_serilization(cpp-client-ydb_persqueue_public
${YDB_SDK_SOURCE_DIR}/src/client/persqueue_public/include/write_session.h
INCLUDE_HEADERS
src/client/persqueue_public/include/write_session.h
)
1 change: 1 addition & 0 deletions src/client/persqueue_public/impl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ target_link_libraries(client-ydb_persqueue_public-impl PUBLIC
impl-ydb_internal-make_request
client-ydb_common_client-impl
client-ydb_driver
client-ydb_persqueue_public-include
string_utils-misc
)

Expand Down
2 changes: 1 addition & 1 deletion src/client/persqueue_public/impl/persqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ TCredentials::TCredentials(const Ydb::PersQueue::V1::Credentials& settings)
break;
}
default: {
ythrow yexception() << "unsupported credentials type " << ::NPersQueue::ObfuscateString(ToString(Credentials_));
ythrow yexception() << "unsupported credentials type " << ::NPersQueue::ObfuscateString(Credentials_.ShortDebugString());
}
}
}
Expand Down
32 changes: 32 additions & 0 deletions src/client/persqueue_public/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
_ydb_sdk_add_library(client-ydb_persqueue_public-include)

target_link_libraries(client-ydb_persqueue_public-include PUBLIC
yutil
api-grpc
api-grpc-draft
api-protos
)

generate_enum_serilization(client-ydb_persqueue_public-include
${YDB_SDK_SOURCE_DIR}/src/client/persqueue_public/include/control_plane.h
INCLUDE_HEADERS
src/client/persqueue_public/include/control_plane.h
)

generate_enum_serilization(client-ydb_persqueue_public-include
${YDB_SDK_SOURCE_DIR}/src/client/persqueue_public/include/read_events.h
INCLUDE_HEADERS
src/client/persqueue_public/include/read_events.h
)

generate_enum_serilization(client-ydb_persqueue_public-include
${YDB_SDK_SOURCE_DIR}/src/client/persqueue_public/include/write_events.h
INCLUDE_HEADERS
src/client/persqueue_public/include/write_events.h
)

generate_enum_serilization(client-ydb_persqueue_public-include
${YDB_SDK_SOURCE_DIR}/src/client/persqueue_public/include/write_session.h
INCLUDE_HEADERS
src/client/persqueue_public/include/write_session.h
)
10 changes: 5 additions & 5 deletions src/client/topic/impl/read_session_impl.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ inline void TSingleClusterReadSessionImpl<true>::OnReadDoneImpl(
BreakConnectionAndReconnectImpl(EStatus::INTERNAL_ERROR,
TStringBuilder()
<< "Got unexpected partition stream data message. Topic: "
<< partitionData.topic() << ". Partition: " << partitionData.partition()
<< partitionData.topic().ShortDebugString() << ". Partition: " << partitionData.partition()
<< " AssignId: " << partitionData.cookie().assign_id(),
deferred);
return;
Expand Down Expand Up @@ -1031,9 +1031,9 @@ inline void TSingleClusterReadSessionImpl<true>::OnReadDoneImpl(
if (firstOffset == std::numeric_limits<ui64>::max()) {
BreakConnectionAndReconnectImpl(EStatus::INTERNAL_ERROR,
TStringBuilder() << "Got empty data message. Topic: "
<< partitionData.topic()
<< partitionData.topic().ShortDebugString()
<< ". Partition: " << partitionData.partition()
<< " message: " << msg,
<< " message: " << msg.ShortDebugString(),
deferred);
return;
}
Expand All @@ -1042,7 +1042,7 @@ inline void TSingleClusterReadSessionImpl<true>::OnReadDoneImpl(
if (!CookieMapping.AddMapping(cookie)) {
BreakConnectionAndReconnectImpl(EStatus::INTERNAL_ERROR,
TStringBuilder() << "Got unexpected data message. Topic: "
<< partitionData.topic()
<< partitionData.topic().ShortDebugString()
<< ". Partition: " << partitionData.partition()
<< ". Cookie mapping already has such cookie",
deferred);
Expand Down Expand Up @@ -1150,7 +1150,7 @@ inline void TSingleClusterReadSessionImpl<true>::OnReadDoneImpl(
TDeferredActions<true>& deferred) {
Y_ABORT_UNLESS(Lock.IsLocked());

LOG_LAZY(Log, TLOG_DEBUG, GetLogPrefix() << "Committed response: " << msg);
LOG_LAZY(Log, TLOG_DEBUG, GetLogPrefix() << "Committed response: " << msg.ShortDebugString());

std::map<ui64, TIntrusivePtr<TPartitionStreamImpl<true>>> partitionStreams;
for (const Ydb::PersQueue::V1::CommitCookie& cookieProto : msg.cookies()) {
Expand Down
1 change: 1 addition & 0 deletions tests/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ add_subdirectory(bulk_upsert)
add_subdirectory(server_restart)
add_subdirectory(sessions)
add_subdirectory(sessions_pool)
add_subdirectory(topic)
11 changes: 11 additions & 0 deletions tests/integration/topic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
add_ydb_test(NAME topic_it GTEST
SOURCES
basic_usage.cpp
LINK_LIBRARIES
yutil
YDB-CPP-SDK::Topic
cpp-client-ydb_persqueue_public
api-grpc
LABELS
integration
)
Loading
Loading