All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.kusto.ingest.result.TableReportIngestionResult Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
// 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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy