| 904 | return Status::OK(); |
| 905 | } |
| 906 | Status 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 | |
| 928 | void AppMetadataTest::SetUpTest() { |
| 929 | ASSERT_OK_AND_ASSIGN(auto location, Location::ForScheme(transport(), "127.0.0.1", 0)); |
no test coverage detected