Fingerprint .core
This commit is contained in:
parent
85ec50552d
commit
802af08179
@ -22,6 +22,7 @@
|
|||||||
#include "engine/status.hpp"
|
#include "engine/status.hpp"
|
||||||
#include "util/exception.hpp"
|
#include "util/exception.hpp"
|
||||||
#include "util/exception_utils.hpp"
|
#include "util/exception_utils.hpp"
|
||||||
|
#include "util/fingerprint.hpp"
|
||||||
#include "util/json_container.hpp"
|
#include "util/json_container.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -184,7 +185,7 @@ bool Engine<routing_algorithms::corech::Algorithm>::CheckCompability(const Engin
|
|||||||
|
|
||||||
auto mem = storage::makeSharedMemory(barrier.data().region);
|
auto mem = storage::makeSharedMemory(barrier.data().region);
|
||||||
auto layout = reinterpret_cast<storage::DataLayout *>(mem->Ptr());
|
auto layout = reinterpret_cast<storage::DataLayout *>(mem->Ptr());
|
||||||
return layout->GetBlockSize(storage::DataLayout::CH_CORE_MARKER) > 4;
|
return layout->GetBlockSize(storage::DataLayout::CH_CORE_MARKER) > 16;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -194,8 +195,8 @@ bool Engine<routing_algorithms::corech::Algorithm>::CheckCompability(const Engin
|
|||||||
|
|
||||||
in.seekg(0, std::ios::end);
|
in.seekg(0, std::ios::end);
|
||||||
std::size_t size = in.tellg();
|
std::size_t size = in.tellg();
|
||||||
// An empty core files is only the 4 byte size header.
|
// An empty core files is only the 8 byte size header plus the 8 byte Fingerprint.
|
||||||
return size > sizeof(std::uint32_t);
|
return size > sizeof(std::uint64_t) + sizeof(util::FingerPrint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,10 +123,10 @@ void Contractor::WriteCoreNodeMarker(std::vector<bool> &&in_is_core_node) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
storage::io::FileWriter core_marker_output_file(config.core_output_path,
|
storage::io::FileWriter core_marker_output_file(config.core_output_path,
|
||||||
storage::io::FileWriter::HasNoFingerprint);
|
storage::io::FileWriter::GenerateFingerprint);
|
||||||
|
|
||||||
const std::size_t count = unpacked_bool_flags.size();
|
const std::size_t count = unpacked_bool_flags.size();
|
||||||
core_marker_output_file.WriteElementCount32(count);
|
core_marker_output_file.WriteElementCount64(count);
|
||||||
core_marker_output_file.WriteFrom(unpacked_bool_flags.data(), count);
|
core_marker_output_file.WriteFrom(unpacked_bool_flags.data(), count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,8 +292,8 @@ void Storage::PopulateLayout(DataLayout &layout)
|
|||||||
// load core marker size
|
// load core marker size
|
||||||
if (boost::filesystem::exists(config.core_data_path))
|
if (boost::filesystem::exists(config.core_data_path))
|
||||||
{
|
{
|
||||||
io::FileReader core_marker_file(config.core_data_path, io::FileReader::HasNoFingerprint);
|
io::FileReader core_marker_file(config.core_data_path, io::FileReader::VerifyFingerprint);
|
||||||
const auto number_of_core_markers = core_marker_file.ReadElementCount32();
|
const auto number_of_core_markers = core_marker_file.ReadElementCount64();
|
||||||
layout.SetBlockSize<unsigned>(DataLayout::CH_CORE_MARKER, number_of_core_markers);
|
layout.SetBlockSize<unsigned>(DataLayout::CH_CORE_MARKER, number_of_core_markers);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -743,8 +743,8 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
|
|||||||
|
|
||||||
if (boost::filesystem::exists(config.core_data_path))
|
if (boost::filesystem::exists(config.core_data_path))
|
||||||
{
|
{
|
||||||
io::FileReader core_marker_file(config.core_data_path, io::FileReader::HasNoFingerprint);
|
io::FileReader core_marker_file(config.core_data_path, io::FileReader::VerifyFingerprint);
|
||||||
const auto number_of_core_markers = core_marker_file.ReadElementCount32();
|
const auto number_of_core_markers = core_marker_file.ReadElementCount64();
|
||||||
|
|
||||||
// load core markers
|
// load core markers
|
||||||
std::vector<char> unpacked_core_markers(number_of_core_markers);
|
std::vector<char> unpacked_core_markers(number_of_core_markers);
|
||||||
|
Loading…
Reference in New Issue
Block a user