azure-kusto-ingest 5.2.3 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-esm/src/abstractKustoClient.js +33 -0
- package/dist-esm/src/abstractKustoClient.js.map +1 -1
- package/dist-esm/src/descriptors.js +5 -1
- package/dist-esm/src/descriptors.js.map +1 -1
- package/dist-esm/src/fileDescriptor.browser.js +5 -2
- package/dist-esm/src/fileDescriptor.browser.js.map +1 -1
- package/dist-esm/src/fileDescriptor.js +5 -2
- package/dist-esm/src/fileDescriptor.js.map +1 -1
- package/dist-esm/src/index.js +4 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/ingestClient.browser.js +8 -11
- package/dist-esm/src/ingestClient.browser.js.map +1 -1
- package/dist-esm/src/ingestClient.js +8 -13
- package/dist-esm/src/ingestClient.js.map +1 -1
- package/dist-esm/src/ingestClientBase.js +93 -9
- package/dist-esm/src/ingestClientBase.js.map +1 -1
- package/dist-esm/src/ingestionBlobInfo.js +6 -1
- package/dist-esm/src/ingestionBlobInfo.js.map +1 -1
- package/dist-esm/src/ingestionProperties.js +15 -1
- package/dist-esm/src/ingestionProperties.js.map +1 -1
- package/dist-esm/src/ingestionResult.js +60 -0
- package/dist-esm/src/ingestionResult.js.map +1 -0
- package/dist-esm/src/managedStreamingIngestClient.js +4 -4
- package/dist-esm/src/managedStreamingIngestClient.js.map +1 -1
- package/dist-esm/src/rankedStorageAccount.js +73 -0
- package/dist-esm/src/rankedStorageAccount.js.map +1 -0
- package/dist-esm/src/rankedStorageAccountSet.js +61 -0
- package/dist-esm/src/rankedStorageAccountSet.js.map +1 -0
- package/dist-esm/src/resourceManager.js +108 -16
- package/dist-esm/src/resourceManager.js.map +1 -1
- package/dist-esm/src/streamingIngestClient.browser.js +2 -2
- package/dist-esm/src/streamingIngestClient.browser.js.map +1 -1
- package/dist-esm/src/streamingIngestClient.js +2 -2
- package/dist-esm/src/streamingIngestClient.js.map +1 -1
- package/dist-esm/src/streamingIngestClientBase.js +7 -1
- package/dist-esm/src/streamingIngestClientBase.js.map +1 -1
- package/package.json +7 -4
- package/types/src/abstractKustoClient.d.ts +3 -0
- package/types/src/descriptors.d.ts +1 -0
- package/types/src/fileDescriptor.browser.d.ts +3 -1
- package/types/src/fileDescriptor.d.ts +3 -1
- package/types/src/index.d.ts +2 -1
- package/types/src/ingestClient.browser.d.ts +4 -4
- package/types/src/ingestClient.d.ts +4 -4
- package/types/src/ingestClientBase.d.ts +10 -4
- package/types/src/ingestionBlobInfo.d.ts +5 -1
- package/types/src/ingestionProperties.d.ts +1 -0
- package/types/src/ingestionResult.d.ts +41 -0
- package/types/src/managedStreamingIngestClient.d.ts +5 -5
- package/types/src/rankedStorageAccount.d.ts +15 -0
- package/types/src/rankedStorageAccountSet.d.ts +18 -0
- package/types/src/resourceManager.d.ts +21 -4
- package/types/src/streamingIngestClient.browser.d.ts +1 -1
- package/types/src/streamingIngestClient.d.ts +1 -1
- package/types/src/streamingIngestClientBase.d.ts +1 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TableClient, TableEntity } from "@azure/data-tables";
|
|
2
|
+
export interface IngestionResult {
|
|
3
|
+
getIngestionStatusCollection(): Promise<IngestionStatus>;
|
|
4
|
+
}
|
|
5
|
+
export declare const putRecordInTable: (tableClient: TableClient, entity: TableEntity<IngestionStatus>) => Promise<void>;
|
|
6
|
+
export declare enum OperationStatus {
|
|
7
|
+
Pending = "Pending",
|
|
8
|
+
Succeede = "Succeeded",
|
|
9
|
+
Failed = "Failed",
|
|
10
|
+
Queued = "Queued",
|
|
11
|
+
Skipped = "Skipped",
|
|
12
|
+
PartiallySucceeded = "PartiallySucceeded"
|
|
13
|
+
}
|
|
14
|
+
export declare class TableReportIngestionResult implements IngestionResult {
|
|
15
|
+
private ingestionStatusInTableDescription;
|
|
16
|
+
tableClient: TableClient | null;
|
|
17
|
+
constructor(ingestionStatusInTableDescription: IngestionStatusInTableDescription, tableClient?: TableClient | null);
|
|
18
|
+
getIngestionStatusCollection(): Promise<IngestionStatus>;
|
|
19
|
+
}
|
|
20
|
+
export declare class IngestionStatusResult implements IngestionResult {
|
|
21
|
+
private ingestionStatus;
|
|
22
|
+
constructor(ingestionStatus: IngestionStatus);
|
|
23
|
+
getIngestionStatusCollection(): Promise<IngestionStatus>;
|
|
24
|
+
}
|
|
25
|
+
export declare class IngestionStatusInTableDescription {
|
|
26
|
+
tableConnectionString: string;
|
|
27
|
+
partitionKey: string;
|
|
28
|
+
rowKey: string;
|
|
29
|
+
constructor(tableConnectionString: string, partitionKey: string, rowKey: string);
|
|
30
|
+
}
|
|
31
|
+
export interface IngestionStatus {
|
|
32
|
+
Timestamp: string;
|
|
33
|
+
Status: OperationStatus;
|
|
34
|
+
IngestionSourceId: string;
|
|
35
|
+
IngestionSourcePath: string;
|
|
36
|
+
Database: string;
|
|
37
|
+
Table: string;
|
|
38
|
+
UpdatedOn: string;
|
|
39
|
+
Details: string;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=ingestionResult.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IngestionPropertiesInput } from "./ingestionProperties";
|
|
3
|
-
import { QueueSendMessageResponse } from "@azure/storage-queue";
|
|
4
3
|
import { KustoConnectionStringBuilder, KustoResponseDataSet } from "azure-kusto-data";
|
|
5
4
|
import { Readable } from "stream";
|
|
6
5
|
import { AbstractKustoClient } from "./abstractKustoClient";
|
|
7
6
|
import { AbstractDescriptor, BlobDescriptor, StreamDescriptor } from "./descriptors";
|
|
8
7
|
import { FileDescriptor } from "./fileDescriptor";
|
|
8
|
+
import { IngestionResult } from "./ingestionResult";
|
|
9
9
|
declare class KustoManagedStreamingIngestClient extends AbstractKustoClient {
|
|
10
10
|
private streamingIngestClient;
|
|
11
11
|
private queuedIngestClient;
|
|
@@ -29,16 +29,16 @@ declare class KustoManagedStreamingIngestClient extends AbstractKustoClient {
|
|
|
29
29
|
* @param defaultProps The default ingestion properties.
|
|
30
30
|
*/
|
|
31
31
|
static fromEngineConnectionString(engineConnectionString: KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput): KustoManagedStreamingIngestClient;
|
|
32
|
-
constructor(engineKcsb: string | KustoConnectionStringBuilder, dmKcsb: string | KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput);
|
|
32
|
+
constructor(engineKcsb: string | KustoConnectionStringBuilder, dmKcsb: string | KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput, autoCorrectEndpoint?: boolean);
|
|
33
33
|
/**
|
|
34
34
|
* Use Readable for Node.js and ArrayBuffer in browser
|
|
35
35
|
*/
|
|
36
|
-
ingestFromStream(stream: StreamDescriptor | Readable | ArrayBuffer, ingestionProperties?: IngestionPropertiesInput, clientRequestId?: string): Promise<
|
|
36
|
+
ingestFromStream(stream: StreamDescriptor | Readable | ArrayBuffer, ingestionProperties?: IngestionPropertiesInput, clientRequestId?: string): Promise<KustoResponseDataSet | IngestionResult>;
|
|
37
37
|
/**
|
|
38
38
|
* Use string for Node.js and Blob in browser
|
|
39
39
|
*/
|
|
40
|
-
ingestFromFile(file: FileDescriptor | string | Blob, ingestionProperties?: IngestionPropertiesInput): Promise<KustoResponseDataSet |
|
|
41
|
-
ingestFromBlob(blob: string | BlobDescriptor, ingestionProperties?: IngestionPropertiesInput, clientRequestId?: string): Promise<
|
|
40
|
+
ingestFromFile(file: FileDescriptor | string | Blob, ingestionProperties?: IngestionPropertiesInput): Promise<KustoResponseDataSet | IngestionResult>;
|
|
41
|
+
ingestFromBlob(blob: string | BlobDescriptor, ingestionProperties?: IngestionPropertiesInput, clientRequestId?: string): Promise<KustoResponseDataSet | IngestionResult>;
|
|
42
42
|
streamWithRetries(length: number, descriptor: AbstractDescriptor, props?: IngestionPropertiesInput, clientRequestId?: string, stream?: Readable | ArrayBuffer): Promise<any>;
|
|
43
43
|
close(): void;
|
|
44
44
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class RankedStorageAccount {
|
|
2
|
+
private accountName;
|
|
3
|
+
private numberOfBuckets;
|
|
4
|
+
private bucketDuration;
|
|
5
|
+
private timeProvider;
|
|
6
|
+
private buckets;
|
|
7
|
+
private lastUpdateTime;
|
|
8
|
+
private currentBucketIndex;
|
|
9
|
+
constructor(accountName: string, numberOfBuckets: number, bucketDuration: number, timeProvider: () => number);
|
|
10
|
+
logResult(success: boolean): void;
|
|
11
|
+
getAccountName(): string;
|
|
12
|
+
adjustForTimePassed(): number;
|
|
13
|
+
getRank(): number;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=rankedStorageAccount.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RankedStorageAccount } from "./rankedStorageAccount";
|
|
2
|
+
export declare class RankedStorageAccountSet {
|
|
3
|
+
private numberOfBuckets;
|
|
4
|
+
private bucketDuration;
|
|
5
|
+
private tiers;
|
|
6
|
+
private timeProvider;
|
|
7
|
+
static readonly DefaultNumberOfBuckets: number;
|
|
8
|
+
static readonly DefaultBucketDurationInSeconds: number;
|
|
9
|
+
static readonly DefaultTiers: number[];
|
|
10
|
+
static readonly DefaultTimeProviderInSeconds: () => number;
|
|
11
|
+
private accounts;
|
|
12
|
+
constructor(numberOfBuckets?: number, bucketDuration?: number, tiers?: number[], timeProvider?: () => number);
|
|
13
|
+
logResultToAccount(accountName: string, result: boolean): void;
|
|
14
|
+
registerStorageAccount(accountName: string): void;
|
|
15
|
+
getStorageAccount(accountName: string): RankedStorageAccount;
|
|
16
|
+
getRankedShuffledAccounts(): RankedStorageAccount[];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=rankedStorageAccountSet.d.ts.map
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { Client } from "azure-kusto-data";
|
|
2
|
+
import { TableClient } from "@azure/data-tables";
|
|
3
|
+
export declare enum ResourceType {
|
|
4
|
+
Queue = 0,
|
|
5
|
+
Container = 1,
|
|
6
|
+
Table = 2
|
|
7
|
+
}
|
|
2
8
|
export declare class ResourceURI {
|
|
3
9
|
readonly uri: string;
|
|
4
|
-
|
|
10
|
+
readonly accountName: string;
|
|
11
|
+
readonly resourceType: ResourceType;
|
|
12
|
+
constructor(uri: string, accountName: string, resourceType: ResourceType);
|
|
5
13
|
}
|
|
6
14
|
export declare class IngestClientResources {
|
|
7
15
|
readonly securedReadyForAggregationQueues: ResourceURI[] | null;
|
|
8
16
|
readonly failedIngestionsQueues: ResourceURI[] | null;
|
|
9
17
|
readonly successfulIngestionsQueues: ResourceURI[] | null;
|
|
10
18
|
readonly containers: ResourceURI[] | null;
|
|
11
|
-
|
|
19
|
+
readonly statusTables: ResourceURI[] | null;
|
|
20
|
+
constructor(securedReadyForAggregationQueues?: ResourceURI[] | null, failedIngestionsQueues?: ResourceURI[] | null, successfulIngestionsQueues?: ResourceURI[] | null, containers?: ResourceURI[] | null, statusTables?: ResourceURI[] | null);
|
|
12
21
|
valid(): boolean;
|
|
13
22
|
}
|
|
14
23
|
export declare class ResourceManager {
|
|
@@ -22,12 +31,17 @@ export declare class ResourceManager {
|
|
|
22
31
|
authorizationContextLastUpdate: number | null;
|
|
23
32
|
private baseSleepTimeSecs;
|
|
24
33
|
private baseJitterSecs;
|
|
34
|
+
private rankedStorageAccountSet;
|
|
25
35
|
constructor(kustoClient: Client, isBrowser?: boolean);
|
|
26
36
|
refreshIngestClientResources(): Promise<IngestClientResources>;
|
|
27
37
|
getIngestClientResourcesFromService(): Promise<IngestClientResources>;
|
|
28
38
|
getResourceByName(table: {
|
|
29
39
|
rows: () => any;
|
|
30
|
-
}, resourceName: string): ResourceURI[];
|
|
40
|
+
}, resourceName: string, resourceType: ResourceType): ResourceURI[];
|
|
41
|
+
pupulateStorageAccounts(): void;
|
|
42
|
+
groupResourcesByStorageAccount(resources: ResourceURI[]): Map<string, ResourceURI[]>;
|
|
43
|
+
getRankedAndShuffledStorageAccounts(resources: ResourceURI[]): ResourceURI[][];
|
|
44
|
+
getRoundRobinRankedAndShuffledResources(resources: ResourceURI[]): ResourceURI[];
|
|
31
45
|
refreshAuthorizationContext(): Promise<string>;
|
|
32
46
|
tryRefresh(isAuthContextFetch: boolean): Promise<Error | null>;
|
|
33
47
|
getAuthorizationContextFromService(): Promise<string>;
|
|
@@ -36,8 +50,11 @@ export declare class ResourceManager {
|
|
|
36
50
|
getSuccessfulIngestionsQueues(): Promise<ResourceURI[] | null>;
|
|
37
51
|
getContainers(): Promise<ResourceURI[] | null>;
|
|
38
52
|
getAuthorizationContext(): Promise<string>;
|
|
39
|
-
|
|
53
|
+
getStatusTables(): Promise<ResourceURI[] | null>;
|
|
54
|
+
createStatusTable(): Promise<TableClient>;
|
|
40
55
|
close(): void;
|
|
56
|
+
reportResourceUsageResult(accountName: string, success: boolean): void;
|
|
41
57
|
}
|
|
58
|
+
export declare const createStatusTableClient: (uri: string) => TableClient;
|
|
42
59
|
export default ResourceManager;
|
|
43
60
|
//# sourceMappingURL=resourceManager.d.ts.map
|
|
@@ -4,7 +4,7 @@ import { StreamDescriptor } from "./descriptors";
|
|
|
4
4
|
import { FileDescriptor } from "./fileDescriptor.browser";
|
|
5
5
|
import { KustoStreamingIngestClientBase } from "./streamingIngestClientBase";
|
|
6
6
|
declare class KustoStreamingIngestClient extends KustoStreamingIngestClientBase {
|
|
7
|
-
constructor(kcsb: string | KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput);
|
|
7
|
+
constructor(kcsb: string | KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput, autoCorrectEndpoint?: boolean);
|
|
8
8
|
/**
|
|
9
9
|
* Use Readable for Node.js and ArrayBuffer in browser
|
|
10
10
|
*/
|
|
@@ -6,7 +6,7 @@ import { StreamDescriptor } from "./descriptors";
|
|
|
6
6
|
import { FileDescriptor } from "./fileDescriptor";
|
|
7
7
|
import { KustoStreamingIngestClientBase } from "./streamingIngestClientBase";
|
|
8
8
|
declare class KustoStreamingIngestClient extends KustoStreamingIngestClientBase {
|
|
9
|
-
constructor(kcsb: string | KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput);
|
|
9
|
+
constructor(kcsb: string | KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput, autoCorrectEndpoint?: boolean);
|
|
10
10
|
/**
|
|
11
11
|
* Use Readable for Node.js and ArrayBuffer in browser
|
|
12
12
|
*/
|
|
@@ -4,7 +4,7 @@ import { AbstractKustoClient } from "./abstractKustoClient";
|
|
|
4
4
|
import { Client as KustoClient, KustoConnectionStringBuilder } from "azure-kusto-data";
|
|
5
5
|
export declare abstract class KustoStreamingIngestClientBase extends AbstractKustoClient {
|
|
6
6
|
protected kustoClient: KustoClient;
|
|
7
|
-
constructor(kcsb: string | KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput);
|
|
7
|
+
constructor(kcsb: string | KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput, autoCorrectEndpoint?: boolean);
|
|
8
8
|
ingestFromBlob(blob: string | BlobDescriptor, ingestionProperties?: IngestionPropertiesInput, clientRequestId?: string): Promise<any>;
|
|
9
9
|
close(): void;
|
|
10
10
|
}
|