-
Notifications
You must be signed in to change notification settings - Fork 44
Ingest async implementation #430
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?
Conversation
# Conflicts: # CHANGELOG.md # ingest/src/main/java/com/microsoft/azure/kusto/ingest/IngestClientBase.java
Test Results342 tests ±0 330 ✅ - 3 2m 56s ⏱️ -27s For more details on these failures, see this check. Results for commit d9d8760. ± Comparison against base commit fa305a3. This pull request removes 24 and adds 24 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
- [BREAKING] * Make ManagedStreamingQueuingPolicy internal, expose just a factor | ||
* Dont allow users to pass raw data size, provide it only if we have it | ||
- [BREAKING] Make ManagedStreamingQueuingPolicy internal, expose just a factor | ||
- [BREAKING] Don't allow users to pass raw data size, provide it only if we have it |
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.
Retroactively changing the 6.0.1 changelogs? maybe another PR?
|
||
### Changed | ||
|
||
- [BREAKING] All synchronous queued and streaming ingestion APIs now delegate to their asynchronous counterparts |
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.
Should it have any effects for the user?
I think a big thing is the exception thanges. IDK if we mention it anywhere
* @return A configured {@link Retry} instance | ||
*/ | ||
public Retry retry(@Nullable List<Class<? extends Throwable>> retriableErrorClasses) { | ||
public Retry retry(@Nullable List<Class<? extends Throwable>> retriableErrorClasses, |
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.
Nit: the only time we use the first param is in a test. Do we really need it?
Maybe overloads to make sure they can't be used at the same time?
* Retrieves the detailed ingestion status of | ||
* all data ingestion operations into Kusto associated with this com.microsoft.azure.kusto.ingest.IKustoIngestionResult instance. | ||
*/ | ||
Mono<List<IngestionStatus>> getIngestionStatusCollection() throws URISyntaxException, TableServiceErrorException; | ||
|
||
int getIngestionStatusesLength(); |
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.
Javadoc (for consistency)
public List<IngestionStatus> getIngestionStatusCollection() { | ||
return Collections.singletonList(this.ingestionStatus); | ||
public Mono<List<IngestionStatus>> getIngestionStatusCollection() { | ||
return Mono.defer(() -> { |
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 the defer may not be needed here.
|
||
### Changed | ||
|
||
- [BREAKING] All synchronous queued and streaming ingestion APIs now delegate to their asynchronous counterparts |
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.
Is there any public api that broke and no longer available?
|
||
// If an error occurs, each time the retryWhen subscribes to executeStream create a new instance | ||
// instead of using the same executeStream Mono for all retries | ||
return executeStream(blobSourceInfo, ingestionProperties, blobAsyncClient, i.increment()) |
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.increment() only happens once here, wouldn't it always be 1?
log.error(msg, ex); | ||
throw new IngestionClientException(msg, ex); | ||
} | ||
return Mono.fromCallable(() -> IngestionUtils.resultSetToStream(resultSetSourceInfo))// TODO: ? |
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 todo?
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | ||
new CsvRoutines().write(resultSetSourceInfo.getResultSet(), byteArrayOutputStream); | ||
new CsvRoutines().write(resultSetSourceInfo.getResultSet(), byteArrayOutputStream); // TODO: CsvRoutines is not maintained from 2021. replace? |
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.
Maybe with something async?
``` | ||
|
||
From File: | ||
```java | ||
OperationStatus status = streamingIngestClient.ingestFromFile(fileSourceInfo, ingestionProperties).getIngestionStatusCollection().get(0).status; | ||
OperationStatus status = streamingIngestClient.ingestFromFile(fileSourceInfo, ingestionProperties).getIngestionStatusCollection().get(0).status; //TODO: this is async now? should we have a sync equivalent? |
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.
Probably we want to break as least as possible
Changed
internally and block for results.
Added
enabling non-blocking operations.