Skip to content

Commit

Permalink
Increase expiration time
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 26, 2023
1 parent 012f774 commit ec1d2ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
18 changes: 9 additions & 9 deletions cpp/src/arrow/flight/integration_tests/test_integration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -419,18 +419,18 @@ class OrderedScenario : public Scenario {
/// three FlightEndpoints:
///
/// 1. No expiration time
/// 2. 2 seconds expiration time
/// 3. 3 seconds expiration time
/// 2. 5 seconds expiration time
/// 3. 6 seconds expiration time
///
/// The client can't read data from the first endpoint multiple times
/// but can read data from the second and third endpoints. The client
/// can't re-read data from the second endpoint 2 seconds later. The
/// client can't re-read data from the third endpoint 3 seconds
/// can't re-read data from the second endpoint 5 seconds later. The
/// client can't re-read data from the third endpoint 6 seconds
/// later.
///
/// The client can cancel a returned FlightInfo by pre-defined
/// CancelFlightInfo action. The client can't read data from endpoints
/// even within 3 seconds after the action.
/// even within 6 seconds after the action.
///
/// The client can extend the expiration time of a FlightEndpoint in
/// a returned FlightInfo by pre-defined RenewFlightEndpoint
Expand All @@ -457,10 +457,10 @@ class ExpirationTimeServer : public FlightServerBase {
auto schema = BuildSchema();
std::vector<FlightEndpoint> endpoints;
AddEndpoint(endpoints, "No expiration time", std::nullopt);
AddEndpoint(endpoints, "2 seconds",
Timestamp::clock::now() + std::chrono::seconds{2});
AddEndpoint(endpoints, "3 seconds",
Timestamp::clock::now() + std::chrono::seconds{3});
AddEndpoint(endpoints, "5 seconds",
Timestamp::clock::now() + std::chrono::seconds{5});
AddEndpoint(endpoints, "6 seconds",
Timestamp::clock::now() + std::chrono::seconds{6});
ARROW_ASSIGN_OR_RAISE(
auto info, FlightInfo::Make(*schema, descriptor, endpoints, -1, -1, false));
*result = std::make_unique<FlightInfo>(info);
Expand Down
8 changes: 4 additions & 4 deletions go/arrow/internal/flight_integration/scenario.go
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,10 @@ func (tester *expirationTimeScenarioTester) GetFlightInfo(ctx context.Context, d
)
var endpoints []*flight.FlightEndpoint
endpoints = tester.AppendGetFlightInfo(endpoints, "No expiration time", nil)
expirationTime2 := time.Now().Add(time.Second * 2)
endpoints = tester.AppendGetFlightInfo(endpoints, "2 seconds", &expirationTime2)
expirationTime3 := time.Now().Add(time.Second * 3)
endpoints = tester.AppendGetFlightInfo(endpoints, "3 seconds", &expirationTime3)
expirationTime5 := time.Now().Add(time.Second * 5)
endpoints = tester.AppendGetFlightInfo(endpoints, "5 seconds", &expirationTime2)
expirationTime6 := time.Now().Add(time.Second * 6)
endpoints = tester.AppendGetFlightInfo(endpoints, "6 seconds", &expirationTime3)
return &flight.FlightInfo{
Schema: flight.SerializeSchema(schema, memory.DefaultAllocator),
FlightDescriptor: desc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@
*
* <ol>
* <li>No expiration time</li>
* <li>2 seconds expiration time</li>
* <li>3 seconds expiration time</li>
* <li>5 seconds expiration time</li>
* <li>6 seconds expiration time</li>
* </ol>
*
* The client can't read data from the first endpoint multiple times
* but can read data from the second and third endpoints. The client
* can't re-read data from the second endpoint 2 seconds later. The
* client can't re-read data from the third endpoint 3 seconds
* can't re-read data from the second endpoint 5 seconds later. The
* client can't re-read data from the third endpoint 6 seconds
* later.
* <p>
* The client can cancel a returned FlightInfo by pre-defined
* CancelFlightInfo action. The client can't read data from endpoints
* even within 3 seconds after the action.
* even within 6 seconds after the action.
* <p>
* The client can extend the expiration time of a FlightEndpoint in
* a returned FlightInfo by pre-defined RenewFlightEndpoint
Expand All @@ -93,8 +93,8 @@ public FlightInfo getFlightInfo(CallContext context, FlightDescriptor descriptor
List<FlightEndpoint> endpoints = new ArrayList<>();
Instant now = Instant.now();
endpoints.add(addEndpoint("No expiration time", null));
endpoints.add(addEndpoint("2 seconds", now.plus(2, ChronoUnit.SECONDS)));
endpoints.add(addEndpoint("3 seconds", now.plus(3, ChronoUnit.SECONDS)));
endpoints.add(addEndpoint("5 seconds", now.plus(5, ChronoUnit.SECONDS)));
endpoints.add(addEndpoint("6 seconds", now.plus(6, ChronoUnit.SECONDS)));
return new FlightInfo(SCHEMA, descriptor, endpoints, -1, -1);
}

Expand Down

0 comments on commit ec1d2ad

Please sign in to comment.