MCPcopy Create free account
hub / github.com/ByConity/ByConity / createPart

Method createPart

src/MergeTreeCommon/MergeTreeMetaBase.cpp:881–910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

879
880
881MergeTreeMetaBase::MutableDataPartPtr MergeTreeMetaBase::createPart(
882 const String & name,
883 MergeTreeDataPartType type,
884 const MergeTreePartInfo & part_info,
885 const VolumePtr & volume,
886 const String & relative_path,
887 const IMergeTreeDataPart * parent_part,
888 StorageLocation location) const
889{
890 switch (type.getValue())
891 {
892 case MergeTreeDataPartType::COMPACT:
893 return std::make_shared<MergeTreeDataPartCompact>(*this, name, part_info, volume, relative_path, parent_part, location);
894 case MergeTreeDataPartType::WIDE:
895 return std::make_shared<MergeTreeDataPartWide>(*this, name, part_info, volume, relative_path, parent_part, location);
896 case MergeTreeDataPartType::IN_MEMORY:
897 return std::make_shared<MergeTreeDataPartInMemory>(*this, name, part_info, volume, relative_path, parent_part, location);
898 case MergeTreeDataPartType::CNCH:
899 if (location != StorageLocation::MAIN)
900 {
901 throw Exception("Create CNCH part in auxility storage is forbidden",
902 ErrorCodes::LOGICAL_ERROR);
903 }
904 return std::make_shared<MergeTreeDataPartCNCH>(*this, name, part_info, volume, relative_path, parent_part);
905 case MergeTreeDataPartType::UNKNOWN:
906 throw Exception("Unknown type of part " + relative_path, ErrorCodes::UNKNOWN_PART_TYPE);
907 }
908
909 __builtin_unreachable();
910}
911
912static MergeTreeDataPartType getPartTypeFromMarkExtension(const String & mrk_ext)
913{

Callers 15

ingestPartMethod · 0.80
restoreMethod · 0.80
writeTempPartMethod · 0.80
writeProjectionPartMethod · 0.80
flushToDiskMethod · 0.80
clonePartMethod · 0.80
buildPartFromMetaFunction · 0.80
buildProjectionFromMetaFunction · 0.80
createPartFromRawFunction · 0.80
loadProjectionsMethod · 0.80

Calls 5

ExceptionClass · 0.50
createPartFunction · 0.50
getValueMethod · 0.45
getDiskMethod · 0.45

Tested by

no test coverage detected