MCPcopy Create free account
hub / github.com/apache/arrow / DoPut

Method DoPut

cpp/src/arrow/flight/test_definitions.cc:906–926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

904 return Status::OK();
905}
906Status AppMetadataTestServer::DoPut(const ServerCallContext& context,
907 std::unique_ptr<FlightMessageReader> reader,
908 std::unique_ptr<FlightMetadataWriter> writer) {
909 FlightStreamChunk chunk;
910 int counter = 0;
911 while (true) {
912 ARROW_ASSIGN_OR_RAISE(chunk, reader->Next());
913 if (chunk.data == nullptr) break;
914 if (chunk.app_metadata == nullptr) {
915 return Status::Invalid("Expected application metadata to be provided");
916 }
917 if (std::to_string(counter) != chunk.app_metadata->ToString()) {
918 return Status::Invalid("Expected metadata value: " + std::to_string(counter) +
919 " but got: " + chunk.app_metadata->ToString());
920 }
921 auto metadata = Buffer::FromString(std::to_string(counter));
922 RETURN_NOT_OK(writer->WriteMetadata(*metadata));
923 counter++;
924 }
925 return Status::OK();
926}
927
928void AppMetadataTest::SetUpTest() {
929 ASSERT_OK_AND_ASSIGN(auto location, Location::ForScheme(transport(), "127.0.0.1", 0));

Callers 1

TestDoPutMethod · 0.45

Calls 8

to_stringFunction · 0.85
FromStringFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
InvalidFunction · 0.50
OKFunction · 0.50
NextMethod · 0.45
ToStringMethod · 0.45
WriteMetadataMethod · 0.45

Tested by

no test coverage detected