summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ingestor.cpp12
-rw-r--r--src/ingestor.hpp6
-rw-r--r--test/test-ingest.cpp2
3 files changed, 10 insertions, 10 deletions
diff --git a/src/ingestor.cpp b/src/ingestor.cpp
index 7fd64cd..e2c315c 100644
--- a/src/ingestor.cpp
+++ b/src/ingestor.cpp
@@ -116,7 +116,7 @@ namespace WebStat {
Ingestor::Ingestor(const utsname & host, DB::ConnectionPoolPtr dbpl, IngestorSettings givenSettings) :
settings {std::move(givenSettings)}, dbpool {std::move(dbpl)},
- ingestParkedLines {&Ingestor::jobIngestParkedLines}, purgeOldLogs {&Ingestor::jobPurgeOldLogs},
+ ingestParkedLines {&Ingestor::jobReadParkedLines}, purgeOldLogs {&Ingestor::jobPurgeOldLogs},
hostnameId {insert(dbpool->get(), SQL::HOST_UPSERT, SQL::HOST_UPSERT_OPTS, host.nodename, host.sysname,
host.release, host.version, host.machine, host.domainname)},
curl {curl_multi_init()}, mainThread {std::this_thread::get_id()}
@@ -410,12 +410,12 @@ namespace WebStat {
}
Ingestor::Job::Result
- Ingestor::jobIngestParkedLines()
+ Ingestor::jobReadParkedLines()
{
for (auto pathIter = std::filesystem::directory_iterator {settings.fallbackDir};
pathIter != std::filesystem::directory_iterator {}; ++pathIter) {
if (scn::scan<std::string>(pathIter->path().filename().string(), "parked-{:[a-zA-Z0-9]}.log")) {
- return [lines = jobIngestParkedLines(pathIter->path()), this, path = pathIter->path()]() mutable {
+ return [lines = jobReadParkedLines(pathIter->path()), this, path = pathIter->path()]() mutable {
auto count = lines.size();
queuedLines.append_range(std::move(lines));
unlink(path.c_str());
@@ -429,12 +429,12 @@ namespace WebStat {
}
Ingestor::LineBatch
- Ingestor::jobIngestParkedLines(const std::filesystem::path & path)
+ Ingestor::jobReadParkedLines(const std::filesystem::path & path)
{
if (auto parked = FilePtr(fopen(path.c_str(), "r"))) {
if (auto count = scn::scan<size_t>(parked.get(), "{}\n")) {
try {
- return jobIngestParkedLines(parked.get(), count->value());
+ return jobReadParkedLines(parked.get(), count->value());
}
catch (...) {
auto failPath = auto {path}.replace_extension(".short");
@@ -447,7 +447,7 @@ namespace WebStat {
}
Ingestor::LineBatch
- Ingestor::jobIngestParkedLines(FILE * lines, size_t count)
+ Ingestor::jobReadParkedLines(FILE * lines, size_t count)
{
LineBatch parkedLines;
parkedLines.reserve(count);
diff --git a/src/ingestor.hpp b/src/ingestor.hpp
index 4373f40..d989ecd 100644
--- a/src/ingestor.hpp
+++ b/src/ingestor.hpp
@@ -72,7 +72,7 @@ namespace WebStat {
std::optional<std::future<Result>> currentRun;
};
- Job::Result jobIngestParkedLines();
+ Job::Result jobReadParkedLines();
Job::Result jobPurgeOldLogs();
template<typename... T> void storeLogLine(DB::Connection *, const std::tuple<T...> &) const;
@@ -114,8 +114,8 @@ namespace WebStat {
void finalizeJob(Job &, minutes freq, Job::LastRunTime::clock::time_point now);
void finishAllJobs();
- LineBatch jobIngestParkedLines(const std::filesystem::path &);
- LineBatch jobIngestParkedLines(FILE *, size_t count);
+ LineBatch jobReadParkedLines(const std::filesystem::path &);
+ LineBatch jobReadParkedLines(FILE *, size_t count);
static void sigtermHandler(int);
void terminate(int);
diff --git a/test/test-ingest.cpp b/test/test-ingest.cpp
index 3b53529..6ed50ab 100644
--- a/test/test-ingest.cpp
+++ b/test/test-ingest.cpp
@@ -320,7 +320,7 @@ BOOST_AUTO_TEST_CASE(IngestParked, *boost::unit_test::depends_on("I/ParkLogLine"
BOOST_REQUIRE(parkQueuedLogLines());
BOOST_CHECK(!std::filesystem::is_empty(settings.fallbackDir));
BOOST_REQUIRE(queuedLines.empty());
- const auto result = jobIngestParkedLines();
+ const auto result = jobReadParkedLines();
BOOST_REQUIRE(result);
BOOST_CHECK_EQUAL(result(), 2);
BOOST_CHECK_EQUAL(queuedLines.size(), 2);