CurtHagenlocher commented on code in PR #2855: URL: https://github.com/apache/arrow-adbc/pull/2855#discussion_r2112768120
########## csharp/src/Drivers/Databricks/CloudFetch/Clock.cs: ########## @@ -0,0 +1,81 @@ +/* + * 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 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; + +namespace Apache.Arrow.Adbc.Drivers.Databricks.CloudFetch +{ + /// <summary> + /// Abstraction for time operations to enable testing with controlled time. + /// </summary> + public interface IClock Review Comment: I think these should probably all be `internal`, relying on `InternalsVisibleToAttribute` to be able to use them from tests. Or is there a use case for exposing them publicly? ########## csharp/src/Drivers/Databricks/CloudFetch/CloudFetchResultFetcher.cs: ########## @@ -84,9 +96,11 @@ public async Task StartAsync(CancellationToken cancellationToken) // Reset state Review Comment: To this point, it doesn't look like the value of `_lastFetchedOffset` is only written, not read. ########## csharp/src/Drivers/Databricks/DatabricksConnection.cs: ########## @@ -32,6 +32,8 @@ using Apache.Arrow.Ipc; using Apache.Hive.Service.Rpc.Thrift; using Thrift.Protocol; +using Thrift.Transport; +using Thrift.Transport.Client; Review Comment: Are these needed? There are no other changes in this file. ########## csharp/src/Drivers/Databricks/CloudFetch/Clock.cs: ########## @@ -0,0 +1,81 @@ +/* + * 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 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; + +namespace Apache.Arrow.Adbc.Drivers.Databricks.CloudFetch +{ + /// <summary> + /// Abstraction for time operations to enable testing with controlled time. + /// </summary> + public interface IClock + { + /// <summary> + /// Gets the current UTC time. + /// </summary> + DateTime UtcNow { get; } + } + + /// <summary> + /// Default implementation that uses system time. + /// </summary> + internal class SystemClock : IClock + { + public DateTime UtcNow => DateTime.UtcNow; + } + + /// <summary> + /// Test implementation that allows controlling time for testing scenarios. + /// </summary> + public class ControllableClock : IClock Review Comment: Can this be moved to test code? It also doesn't seem like it's currently being used, as the test code is creating a `MockClock` instead of a `ControllableClock`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org