mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
28 lines
706 B
C++
28 lines
706 B
C++
#include "partition_c.h"
|
|
#include "Partition.h"
|
|
#include "Collection.h"
|
|
|
|
CPartition
|
|
NewPartition(CCollection collection, const char* partition_name) {
|
|
auto c = (milvus::dog_segment::Collection*)collection;
|
|
|
|
auto name = std::string(partition_name);
|
|
|
|
auto schema = c->get_schema();
|
|
|
|
auto partition = std::make_unique<milvus::dog_segment::Partition>(name, schema);
|
|
|
|
// TODO: delete print
|
|
std::cout << "create partition " << name << std::endl;
|
|
return (void*)partition.release();
|
|
}
|
|
|
|
void
|
|
DeletePartition(CPartition partition) {
|
|
auto p = (milvus::dog_segment::Partition*)partition;
|
|
|
|
// TODO: delete print
|
|
std::cout << "delete partition " << p->get_partition_name() <<std::endl;
|
|
delete p;
|
|
}
|