Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions csharp/src/Apache.Arrow.Flight/FlightInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
Expand Down Expand Up @@ -38,15 +38,19 @@ internal FlightInfo(Protocol.FlightInfo flightInfo)

TotalBytes = flightInfo.TotalBytes;
TotalRecords = flightInfo.TotalRecords;
Ordered = flightInfo.Ordered;
AppMetadata = flightInfo.AppMetadata;
}

public FlightInfo(Schema schema, FlightDescriptor descriptor, IReadOnlyList<FlightEndpoint> endpoints, long totalRecords = -1, long totalBytes = -1)
public FlightInfo(Schema schema, FlightDescriptor descriptor, IReadOnlyList<FlightEndpoint> endpoints, long totalRecords = -1, long totalBytes = -1, bool ordered = false, ByteString appMetadata = null)
{
Schema = schema;
Descriptor = descriptor;
Endpoints = endpoints;
TotalBytes = totalBytes;
TotalRecords = totalRecords;
Ordered = ordered;
AppMetadata = appMetadata ?? ByteString.Empty;
}

public FlightDescriptor Descriptor { get; }
Expand All @@ -57,6 +61,10 @@ public FlightInfo(Schema schema, FlightDescriptor descriptor, IReadOnlyList<Flig

public long TotalRecords { get; }

public bool Ordered { get; }

public ByteString AppMetadata { get; }

public IReadOnlyList<FlightEndpoint> Endpoints { get; }

internal Protocol.FlightInfo ToProtocol()
Expand All @@ -67,7 +75,9 @@ internal Protocol.FlightInfo ToProtocol()
Schema = serializedSchema,
FlightDescriptor = Descriptor.ToProtocol(),
TotalBytes = TotalBytes,
TotalRecords = TotalRecords
TotalRecords = TotalRecords,
Ordered = Ordered,
AppMetadata = AppMetadata
};

foreach(var endpoint in Endpoints)
Expand Down
5 changes: 5 additions & 0 deletions csharp/test/Apache.Arrow.Flight.Tests/FlightInfoComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public static void Compare(FlightInfo expected, FlightInfo actual)
Assert.Equal(expected.TotalBytes, actual.TotalBytes);

Assert.Equal(expected.TotalRecords, actual.TotalRecords);

Assert.Equal(expected.Ordered, actual.Ordered);

Assert.Equal(expected.AppMetadata, actual.AppMetadata);

}
}
}
Loading