com.microsoft.azure.kusto.ingest.source.BlobSourceInfo 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.source;
import com.microsoft.azure.kusto.data.instrumentation.TraceableAttributes;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import static com.microsoft.azure.kusto.data.Ensure.stringIsNotBlank;
public class BlobSourceInfo extends AbstractSourceInfo {
private String blobPath;
public String getBlobPath() {
return blobPath;
}
public void setBlobPath(String blobPath) {
this.blobPath = blobPath;
}
private long rawSizeInBytes;
public long getRawSizeInBytes() {
return rawSizeInBytes;
}
public void setRawSizeInBytes(long rawSizeInBytes) {
this.rawSizeInBytes = rawSizeInBytes;
}
public BlobSourceInfo(String blobPath) {
this.blobPath = blobPath;
}
public BlobSourceInfo(String blobPath, long rawSizeInBytes) {
this.blobPath = blobPath;
this.rawSizeInBytes = rawSizeInBytes;
}
public BlobSourceInfo(String blobPath, long rawSizeInBytes, UUID sourceId) {
this.blobPath = blobPath;
this.rawSizeInBytes = rawSizeInBytes;
this.setSourceId(sourceId);
}
public void validate() {
stringIsNotBlank(blobPath, "blobPath");
}
@Override
public Map getTracingAttributes() {
Map attributes = super.getTracingAttributes();
attributes.put("resource", blobPath);
UUID sourceId = getSourceId();
if (sourceId != null) {
attributes.put("sourceId", sourceId.toString());
}
return attributes;
}
}