com.microsoft.azure.kusto.ingest.result.TableReportIngestionResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kusto-ingest Show documentation
Show all versions of kusto-ingest Show documentation
Kusto client library for ingesting data
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package com.microsoft.azure.kusto.ingest.result;
import com.azure.data.tables.TableClient;
import com.azure.data.tables.implementation.models.TableServiceErrorException;
import com.azure.data.tables.models.TableEntity;
import java.util.LinkedList;
import java.util.List;
public class TableReportIngestionResult implements IngestionResult {
private final List descriptors;
public TableReportIngestionResult(List descriptors) {
this.descriptors = descriptors;
}
@Override
public List getIngestionStatusCollection() throws TableServiceErrorException {
List results = new LinkedList<>();
for (IngestionStatusInTableDescription descriptor : descriptors) {
TableClient table = descriptor.getTableClient();
TableEntity entity = table.getEntity(descriptor.getPartitionKey(), descriptor.getRowKey());
results.add(IngestionStatus.fromEntity(entity));
}
return results;
}
@Override
public int getIngestionStatusesLength() {
return descriptors.size();
}
}