MCPcopy Create free account
hub / github.com/alibaba/zvec / next_batch

Method next_batch

src/core/interface/vector_source.cc:48–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 : view_(std::move(view)), valid_(ValidContiguousView(view_)) {}
47
48 int next_batch(uint32_t max_count, VectorBatch *out) override {
49 if (!out || !max_count) return IndexError_InvalidArgument;
50 auto &batch = out->emplace<ContiguousBatch>();
51 if (!valid_) return IndexError_InvalidArgument;
52 if (offset_ == view_.count) return 0;
53 const auto count = std::min(max_count, view_.count - offset_);
54 batch = {
55 static_cast<const char *>(view_.data) + size_t(offset_) * view_.stride,
56 view_.first_id + offset_, count, view_.stride, view_.lease};
57 offset_ += count;
58 return 0;
59 }
60
61 private:
62 const ContiguousBatch view_;

Callers 1

search_externalMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected