Skip to content

Commit e39ffbe

Browse files
Bohdan Kurylovychborzun
authored andcommitted
Moved FlushEventListener and FlushMetrics to private API
Moved the auto-flush specific classes - FlushEventListener and FlushMetrics to private API. Also, removed the AutoFlushController from StreamLayerClientImpl Relates to: OLPEDGE-826 Signed-off-by: Bohdan Kurylovych <[email protected]>
1 parent 377dde9 commit e39ffbe

File tree

10 files changed

+4
-100
lines changed

10 files changed

+4
-100
lines changed

olp-cpp-sdk-dataservice-write/src/AutoFlushController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <future>
2323
#include <memory>
2424

25-
#include <olp/dataservice/write/FlushEventListener.h>
25+
#include "FlushEventListener.h"
2626
#include "AutoFlushSettings.h"
2727

2828
namespace olp {

olp-cpp-sdk-dataservice-write/src/DefaultFlushEventListener.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
#include <mutex>
2525
#include <vector>
2626

27-
#include <olp/dataservice/write/FlushMetrics.h>
28-
#include <olp/dataservice/write/FlushEventListener.h>
27+
#include "FlushEventListener.h"
2928

3029
namespace olp {
3130
namespace dataservice {

olp-cpp-sdk-dataservice-write/include/olp/dataservice/write/FlushEventListener.h renamed to olp-cpp-sdk-dataservice-write/src/FlushEventListener.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#pragma once
2121

22-
#include <olp/dataservice/write/FlushMetrics.h>
22+
#include "FlushMetrics.h"
2323

2424
namespace olp {
2525
namespace dataservice {

olp-cpp-sdk-dataservice-write/include/olp/dataservice/write/FlushMetrics.h renamed to olp-cpp-sdk-dataservice-write/src/FlushMetrics.h

File renamed without changes.

olp-cpp-sdk-dataservice-write/src/StreamLayerClientImpl.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ StreamLayerClientImpl::StreamLayerClientImpl(
8989
init_inprogress_(false),
9090
cache_(settings_.cache),
9191
cache_mutex_(),
92-
stream_client_settings_(std::move(client_settings)),
93-
auto_flush_controller_(new AutoFlushController(AutoFlushSettings{})) {}
92+
stream_client_settings_(std::move(client_settings)) {}
9493

9594
CancellationToken StreamLayerClientImpl::InitApiClients(
9695
const std::shared_ptr<CancellationContext>& cancel_context,
@@ -294,7 +293,6 @@ boost::optional<std::string> StreamLayerClientImpl::Queue(
294293
}
295294
}
296295

297-
auto_flush_controller_->NotifyQueueEventStart();
298296
{
299297
std::lock_guard<std::mutex> lock(cache_mutex_);
300298
const auto publish_data_key = GenerateUuid();
@@ -313,7 +311,6 @@ boost::optional<std::string> StreamLayerClientImpl::Queue(
313311
cache_->Put(GetUuidListKey(), uuid_list,
314312
[&uuid_list]() { return uuid_list; });
315313
}
316-
auto_flush_controller_->NotifyQueueEventComplete();
317314

318315
return boost::none;
319316
}
@@ -392,8 +389,6 @@ olp::client::CancellationToken StreamLayerClientImpl::Flush(
392389
continue;
393390
}
394391

395-
self->auto_flush_controller_->NotifyFlushEvent();
396-
397392
// TODO: This needs a redesign as pushing multiple publishes also on the
398393
// TaskScheduler would mean a dead-lock in case we have a single-thread
399394
// pool and this is waiting on each publish to finish. So while this loop

olp-cpp-sdk-dataservice-write/src/StreamLayerClientImpl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
#include <olp/dataservice/write/StreamLayerClient.h>
2929
#include "ApiClientLookup.h"
30-
#include "AutoFlushController.h"
3130
#include "generated/model/Catalog.h"
3231

3332
namespace olp {
@@ -114,7 +113,6 @@ class StreamLayerClientImpl
114113
std::shared_ptr<cache::KeyValueCache> cache_;
115114
mutable std::mutex cache_mutex_;
116115
StreamLayerClientSettings stream_client_settings_;
117-
std::unique_ptr<AutoFlushController> auto_flush_controller_;
118116
};
119117

120118
} // namespace write

tests/common/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ set(OLP_SDK_TESTS_COMMON_HEADERS
2121
${CMAKE_CURRENT_SOURCE_DIR}/matchers/NetworkUrlMatchers.h
2222
${CMAKE_CURRENT_SOURCE_DIR}/mocks/NetworkMock.h
2323
${CMAKE_CURRENT_SOURCE_DIR}/mocks/CacheMock.h
24-
${CMAKE_CURRENT_SOURCE_DIR}/testables/FlushEventListenerTestable.h
2524
)
2625

2726
set(OLP_SDK_TESTS_COMMON_SOURCES

tests/common/testables/FlushEventListenerTestable.h

Lines changed: 0 additions & 84 deletions
This file was deleted.

tests/functional/olp-cpp-sdk-dataservice-write/DataserviceWriteStreamLayerClientCacheTest.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,10 @@
3838
#include <olp/dataservice/write/model/PublishDataRequest.h>
3939
#include <olp/dataservice/write/model/PublishSdiiRequest.h>
4040
#include <testutils/CustomParameters.hpp>
41-
#include "testables/FlushEventListenerTestable.h"
4241
#include "Utils.h"
4342

4443
using namespace olp::dataservice::write;
4544
using namespace olp::dataservice::write::model;
46-
using namespace olp::tests::common;
4745
using namespace testing;
4846

4947
const std::string kEndpoint = "endpoint";

tests/integration/olp-cpp-sdk-dataservice-write/StreamLayerClientCacheTest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <olp/dataservice/write/StreamLayerClient.h>
3131
#include <olp/dataservice/write/model/PublishDataRequest.h>
3232
#include "HttpResponses.h"
33-
#include "testables/FlushEventListenerTestable.h"
3433

3534
namespace {
3635

0 commit comments

Comments
 (0)