Skip to content

Commit

Permalink
OrcLib: ArchiveNotification: remove m_commandSet
Browse files Browse the repository at this point in the history
Was not require as WolfExecution already got this attribute
  • Loading branch information
fabienfl-orc committed Feb 10, 2021
1 parent 97948ab commit 7a7eae1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
20 changes: 5 additions & 15 deletions src/OrcCommand/Command/WolfLauncher/WolfExecution_Execute.cpp
Expand Up @@ -184,21 +184,20 @@ HRESULT WolfExecution::CreateArchiveAgent()
switch (archive->GetType())
{
case ArchiveNotification::ArchiveStarted:
m_journal.Print(archive->CommandSet(), operation, L"Started");
m_journal.Print(m_commandSet, operation, L"Started");
break;
case ArchiveNotification::FileAddition:
m_journal.Print(
archive->CommandSet(), operation, L"Add file: {} ({})", archive->Keyword(), archive->FileSize());
m_journal.Print(m_commandSet, operation, L"Add file: {} ({})", archive->Keyword(), archive->FileSize());
break;
case ArchiveNotification::DirectoryAddition:
m_journal.Print(archive->CommandSet(), operation, L"Add directory: {}", archive->Keyword());
m_journal.Print(m_commandSet, operation, L"Add directory: {}", archive->Keyword());
break;
case ArchiveNotification::StreamAddition:
m_journal.Print(archive->CommandSet(), operation, L"Add stream: {}", archive->Keyword());
m_journal.Print(m_commandSet, operation, L"Add stream: {}", archive->Keyword());
break;
case ArchiveNotification::ArchiveComplete:
m_journal.Print(
archive->CommandSet(), operation, L"Completed: {} ({})", archive->Keyword(), archive->FileSize());
m_commandSet, operation, L"Completed: {} ({})", archive->Keyword(), archive->FileSize());
break;
}
});
Expand Down Expand Up @@ -296,7 +295,6 @@ HRESULT WolfExecution::CreateArchiveAgent()
ArchiveFormat fmt = OrcArchive::GetArchiveFormat(m_strArchiveFileName);

auto request = ArchiveMessage::MakeOpenRequest(m_strArchiveFileName, fmt, pFinalStream, m_strCompressionLevel);
request->SetCommandSet(m_commandSet);
Concurrency::send(m_ArchiveMessageBuffer, request);
}
else
Expand All @@ -312,7 +310,6 @@ HRESULT WolfExecution::CreateArchiveAgent()
ArchiveFormat fmt = OrcArchive::GetArchiveFormat(m_strArchiveFileName);

auto request = ArchiveMessage::MakeOpenRequest(m_strArchiveFileName, fmt, pOutputStream, m_strCompressionLevel);
request->SetCommandSet(m_commandSet);
Concurrency::send(m_ArchiveMessageBuffer, request);
}

Expand Down Expand Up @@ -749,36 +746,31 @@ HRESULT WolfExecution::CompleteArchive(UploadMessage::ITarget* pUploadMessageQue
{
auto request =
ArchiveMessage::MakeAddFileRequest(L"ProcessStatistics.csv", m_ProcessStatisticsOutput.Path, false, true);
request->SetCommandSet(m_commandSet);
Concurrency::send(m_ArchiveMessageBuffer, request);
}

if (VerifyFileExists(m_JobStatisticsOutput.Path.c_str()) == S_OK)
{
auto request =
ArchiveMessage::MakeAddFileRequest(L"JobStatistics.csv", m_JobStatisticsOutput.Path, false, true);
request->SetCommandSet(m_commandSet);
Concurrency::send(m_ArchiveMessageBuffer, request);
}

if (m_configStream != nullptr)
{
m_configStream->SetFilePointer(0LL, FILE_BEGIN, NULL);
auto request = ArchiveMessage::MakeAddStreamRequest(L"Config.xml", m_configStream, false);
request->SetCommandSet(m_commandSet);
Concurrency::send(m_ArchiveMessageBuffer, request);
}

if (m_localConfigStream != nullptr)
{
m_localConfigStream->SetFilePointer(0LL, FILE_BEGIN, NULL);
auto request = ArchiveMessage::MakeAddStreamRequest(L"LocalConfig.xml", m_localConfigStream, false);
request->SetCommandSet(m_commandSet);
Concurrency::send(m_ArchiveMessageBuffer, request);
}

auto request = ArchiveMessage::MakeCompleteRequest();
request->SetCommandSet(m_commandSet);
Concurrency::send(m_ArchiveMessageBuffer, request);

Log::Debug(L"WAITING FOR ARCHIVE to COMPLETE");
Expand Down Expand Up @@ -841,14 +833,12 @@ HRESULT WolfExecution::CompleteArchive(UploadMessage::ITarget* pUploadMessageQue

auto request =
UploadMessage::MakeUploadFileRequest(m_strOutputFileName, m_strOutputFullPath, false);
request->SetKeyword(m_commandSet);
Concurrency::send(pUploadMessageQueue, request);
}
break;
case OutputSpec::UploadOperation::Move: {

auto request = UploadMessage::MakeUploadFileRequest(m_strOutputFileName, m_strOutputFullPath, true);
request->SetKeyword(m_commandSet);
Concurrency::send(pUploadMessageQueue, request);
}
break;
Expand Down
4 changes: 0 additions & 4 deletions src/OrcLib/ArchiveMessage.h
Expand Up @@ -58,7 +58,6 @@ class ORCLIB_API ArchiveMessage : public std::enable_shared_from_this<ArchiveMes

std::wstring m_archiveFileName;
std::wstring m_sourcePath;
std::wstring m_commandSet;
std::wstring m_command;
std::wstring m_nameInArchive;
std::wstring m_pattern;
Expand Down Expand Up @@ -125,9 +124,6 @@ class ORCLIB_API ArchiveMessage : public std::enable_shared_from_this<ArchiveMes

const std::wstring& NameInArchive() const { return m_nameInArchive; }

const std::wstring& CommandSet() const { return m_commandSet; }
void SetCommandSet(const std::wstring& commandSet) { m_commandSet = commandSet; }

const std::wstring& Command() const { return m_command; }
void SetCommand(const std::wstring& command) { m_command = command; }

Expand Down
1 change: 0 additions & 1 deletion src/OrcLib/ArchiveNotification.h
Expand Up @@ -101,7 +101,6 @@ class ArchiveNotification
Type GetType() const { return m_type; };

const std::wstring& Keyword() const { return m_keyword; };
const std::wstring& CommandSet() const { return m_request->CommandSet(); }
const std::wstring& Description() const { return m_description; }
const std::wstring& GetFileName() const { return m_fileName; }
const std::wstring& GetCompressionLevel() const { return m_compressionLevel; }
Expand Down

0 comments on commit 7a7eae1

Please sign in to comment.