-
Notifications
You must be signed in to change notification settings - Fork 44
Feature/ingest v2 #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feature/ingest v2 #439
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces the initial work on the IngestV2 API, implementing a new Kotlin-based ingestion service alongside the existing Java implementation. The major change is upgrading the project from Java 8 to Java 11 and updating various dependencies to support the new ingest-v2 module.
- Project upgraded from Java 8 to Java 11 with dependency version updates
- New ingest-v2 module written in Kotlin with modern async capabilities
- Centralized dependency management moved to root POM for consistency
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Upgraded Java version, updated dependencies, added ingest-v2 module, centralized dependency management |
| ingest/pom.xml | Removed duplicate dependency management, cleaned up version specifications |
| data/pom.xml | Removed duplicate dependency management, cleaned up version specifications |
| ingest-v2/pom.xml | Complete new module configuration with Kotlin, Ktor, and OpenAPI generation |
| ingest-v2/src/main/resources/openapi.yaml | OpenAPI specification for the new ingest REST API |
| ingest-v2/src/main/kotlin/... | Core Kotlin implementation files for authentication, retry policies, data sources, and API clients |
| ingest-v2/src/test/kotlin/... | Unit tests for retry policies and configuration API |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...main/kotlin/com/microsoft/azure/kusto/ingest/v2/common/auth/AzCliTokenCredentialsProvider.kt
Outdated
Show resolved
Hide resolved
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/source/BlobSource.kt
Outdated
Show resolved
Hide resolved
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/source/LocalSource.kt
Outdated
Show resolved
Hide resolved
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/common/utils/PathUtils.kt
Outdated
Show resolved
Hide resolved
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <java.version>1.8</java.version> | ||
| <azure-bom-version>1.2.28</azure-bom-version> | ||
| <java.version>11</java.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed waiting with this until another PR, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @AsafMah , The overall upgrade can be on another PR. But for ingest-v2 as a seperate module we can use Java 11. The changes to code will be very large if we cannot use 11 and fall back to JDK8.
For starters, kotlinx_serialization is not supported on Java-8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand the confusion, apologies for it, What was intended was, when we update kusto-data and other modules that can be another PR using open-rewrite which is automated
https://docs.openrewrite.org/
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/common/utils/PathUtils.kt
Outdated
Show resolved
Hide resolved
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/source/IngestionSource.kt
Outdated
Show resolved
Hide resolved
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/source/IngestionSource.kt
Outdated
Show resolved
Hide resolved
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/container/UploadContainerBase.kt
Show resolved
Hide resolved
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/container/BlobUploadContainer.kt
Outdated
Show resolved
Hide resolved
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/source/DataSourceFormat.kt
Outdated
Show resolved
Hide resolved
* Address review comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import kotlin.text.compareTo | ||
|
|
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import kotlin.text.compareTo is unused in this file. Consider removing it to keep imports clean.
| import kotlin.text.compareTo |
|
|
||
| import com.microsoft.azure.kusto.ingest.v2.common.utils.PathUtils | ||
| import com.microsoft.azure.kusto.ingest.v2.models.Format | ||
| import java.lang.AutoCloseable |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use kotlin.AutoCloseable instead of java.lang.AutoCloseable for better Kotlin interoperability. Kotlin provides its own AutoCloseable interface as a typealias.
| import java.lang.AutoCloseable | |
| import kotlin.AutoCloseable |
| package com.microsoft.azure.kusto.ingest.v2.common | ||
|
|
||
| import com.microsoft.azure.kusto.ingest.v2.models.ConfigurationResponse | ||
| import java.lang.AutoCloseable |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use kotlin.AutoCloseable instead of java.lang.AutoCloseable for better Kotlin interoperability. Kotlin provides its own AutoCloseable interface as a typealias.
| import java.lang.AutoCloseable |
| private val configurationProvider: suspend () -> ConfigurationResponse, | ||
| ) : ConfigurationCache { | ||
| @Volatile private var cachedConfiguration: ConfigurationResponse? = null | ||
| private var lastRefreshTime: Long = 0 |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The field lastRefreshTime is not marked as @Volatile but is accessed from multiple threads (read outside synchronized block, written inside). This could lead to visibility issues where threads may see stale values. Mark it as @Volatile for proper thread visibility.
| private var lastRefreshTime: Long = 0 | |
| @Volatile private var lastRefreshTime: Long = 0 |
ingest-v2/pom.xml
Outdated
| <compilerPlugins> | ||
| <plugin>kotlinx-serialization</plugin> | ||
| </compilerPlugins> | ||
| <jvmTarget>1.8</jvmTarget> |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Kotlin compiler is targeting JVM 1.8, but the parent pom specifies Java 11 as the minimum version. For consistency and to take advantage of Java 11 features, consider updating jvmTarget to 11.
| <jvmTarget>1.8</jvmTarget> | |
| <jvmTarget>11</jvmTarget> |
| override val dmUrl: String, | ||
| override val tokenCredential: TokenCredential, | ||
| override val skipSecurityChecks: Boolean = false, | ||
| ) : KustoBaseApiClient(dmUrl, tokenCredential, skipSecurityChecks) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we consistently using this naming here (Data management URL)? In the portal it's called 'Data Ingestion URI' - might be a good idea to align with that for clarity.
|
|
||
| when (decision) { | ||
| RetryDecision.Throw -> { | ||
| tracer?.invoke( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would the tracer be null? And if it's null do we not log the errors at all?
| val leaveOpen: Boolean, | ||
| override val compressionType: CompressionType = CompressionType.NONE, | ||
| val baseName: String? = null, | ||
| override val sourceId: UUID = UUID.randomUUID(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we prefer a random UUID? In C# SDK we use null
* Add IngestionSource Blob type and QueuedIngest * Merge code with IngestV2 branch * Reorganize code and remove DTO's * * Fix some review comments --------- Co-authored-by: ag-ramachandran <ramacg@microsoft.com>
* * Add boilerplate * Merge code with IngestV2 branch * * Add support for non-blob sources * * Add support for non-blob sources * * Add support for File and Stream uploads * managed streaming ingest client * * Minor edits - Make constants for ManagedStreamingIngestPolicy * Add a method called size for determining size in the AbstractSourceInfo interface --------- Co-authored-by: Ramachandran A G <ramacg@microsoft.com> * * Fix some formatting * * Remove unused config --------- Co-authored-by: ag-ramachandran <ramacg@microsoft.com>
Initial work on the IngestV2 API