@jupiterone/integration-sdk-runtime 10.0.0 → 10.2.0
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/src/api/index.d.ts +3 -1
- package/dist/src/api/index.js +2 -6
- package/dist/src/api/index.js.map +1 -1
- package/dist/src/storage/FileSystemGraphObjectStore/FileSystemGraphObjectStore.d.ts +9 -2
- package/dist/src/storage/FileSystemGraphObjectStore/FileSystemGraphObjectStore.js +16 -12
- package/dist/src/storage/FileSystemGraphObjectStore/FileSystemGraphObjectStore.js.map +1 -1
- package/dist/src/storage/memory.d.ts +14 -2
- package/dist/src/storage/memory.js +27 -2
- package/dist/src/storage/memory.js.map +1 -1
- package/dist/tsconfig.dist.tsbuildinfo +1 -1
- package/package.json +4 -4
package/dist/src/api/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { AlphaOptions } from '@lifeomic/alpha';
|
|
2
3
|
export type ApiClient = AxiosInstance;
|
|
3
4
|
interface CreateApiClientInput {
|
|
4
5
|
apiBaseUrl: string;
|
|
5
6
|
account: string;
|
|
6
7
|
accessToken?: string;
|
|
7
8
|
retryOptions?: RetryOptions;
|
|
9
|
+
alphaOptions?: AlphaOptions;
|
|
8
10
|
}
|
|
9
11
|
interface RetryOptions {
|
|
10
12
|
attempts?: number;
|
|
@@ -21,7 +23,7 @@ interface RetryOptions {
|
|
|
21
23
|
* In managed environments, this can be configured to
|
|
22
24
|
* hit public and private JupiterOne APIs.
|
|
23
25
|
*/
|
|
24
|
-
export declare function createApiClient({ apiBaseUrl, account, accessToken, retryOptions, }: CreateApiClientInput): ApiClient;
|
|
26
|
+
export declare function createApiClient({ apiBaseUrl, account, accessToken, retryOptions, alphaOptions, }: CreateApiClientInput): ApiClient;
|
|
25
27
|
interface GetApiBaseUrlInput {
|
|
26
28
|
dev: boolean;
|
|
27
29
|
}
|
package/dist/src/api/index.js
CHANGED
|
@@ -5,11 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getAccountFromEnvironment = exports.getApiKeyFromEnvironment = exports.getApiBaseUrl = exports.JUPITERONE_DEV_API_BASE_URL = exports.JUPITERONE_PROD_API_BASE_URL = exports.createApiClient = void 0;
|
|
7
7
|
const alpha_1 = require("@lifeomic/alpha");
|
|
8
|
-
const url_1 = require("@lifeomic/alpha/src/utils/url");
|
|
9
8
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
10
9
|
const dotenv_expand_1 = __importDefault(require("dotenv-expand"));
|
|
11
10
|
const error_1 = require("./error");
|
|
12
|
-
const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
|
|
13
11
|
/**
|
|
14
12
|
* Configures an api client for hitting JupiterOne APIs.
|
|
15
13
|
*
|
|
@@ -19,7 +17,7 @@ const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
|
|
|
19
17
|
* In managed environments, this can be configured to
|
|
20
18
|
* hit public and private JupiterOne APIs.
|
|
21
19
|
*/
|
|
22
|
-
function createApiClient({ apiBaseUrl, account, accessToken, retryOptions, }) {
|
|
20
|
+
function createApiClient({ apiBaseUrl, account, accessToken, retryOptions, alphaOptions, }) {
|
|
23
21
|
const headers = {
|
|
24
22
|
'LifeOmic-Account': account,
|
|
25
23
|
'Content-Type': 'application/json',
|
|
@@ -31,10 +29,8 @@ function createApiClient({ apiBaseUrl, account, accessToken, retryOptions, }) {
|
|
|
31
29
|
baseURL: apiBaseUrl,
|
|
32
30
|
headers,
|
|
33
31
|
retry: retryOptions ?? {},
|
|
32
|
+
...alphaOptions,
|
|
34
33
|
};
|
|
35
|
-
if ((0, url_1.isLambdaUrl)(apiBaseUrl)) {
|
|
36
|
-
opts.signAwsV4 = { credentials: (0, credential_provider_node_1.defaultProvider)({ maxRetries: 3 }) };
|
|
37
|
-
}
|
|
38
34
|
return new alpha_1.Alpha(opts);
|
|
39
35
|
}
|
|
40
36
|
exports.createApiClient = createApiClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";;;;;;AACA,2CAAsD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";;;;;;AACA,2CAAsD;AAEtD,oDAA4B;AAC5B,kEAAyC;AAEzC,mCAGiB;AAmBjB;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,OAAO,EACP,WAAW,EACX,YAAY,EACZ,YAAY,GACS;IACrB,MAAM,OAAO,GAA2B;QACtC,kBAAkB,EAAE,OAAO;QAC3B,cAAc,EAAE,kBAAkB;KACnC,CAAC;IAEF,IAAI,WAAW,EAAE;QACf,OAAO,CAAC,aAAa,GAAG,UAAU,WAAW,EAAE,CAAC;KACjD;IAED,MAAM,IAAI,GAAiB;QACzB,OAAO,EAAE,UAAU;QACnB,OAAO;QACP,KAAK,EAAE,YAAY,IAAI,EAAE;QACzB,GAAG,YAAY;KAChB,CAAC;IAEF,OAAO,IAAI,aAAK,CAAC,IAAI,CAAc,CAAC;AACtC,CAAC;AAxBD,0CAwBC;AAMY,QAAA,4BAA4B,GAAG,8BAA8B,CAAC;AAC9D,QAAA,2BAA2B,GAAG,+BAA+B,CAAC;AAE3E,SAAgB,aAAa,CAAC,EAAE,GAAG,KAAyB,EAAE,GAAG,EAAE,KAAK,EAAE;IACxE,IAAI,GAAG,EAAE;QACP,OAAO,mCAA2B,CAAC;KACpC;SAAM;QACL,OAAO,oCAA4B,CAAC;KACrC;AACH,CAAC;AAND,sCAMC;AAED,SAAS,UAAU,CACjB,YAAoB,EACpB,YAAwC;IAExC,IAAA,uBAAY,EAAC,gBAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAE9B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAExC,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,YAAY,EAAE,CAAC;KAC1B;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAEM,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAC3C,UAAU,CAAC,oBAAoB,EAAE,sCAA8B,CAAC,CAAC;AADtD,QAAA,wBAAwB,4BAC8B;AAE5D,MAAM,yBAAyB,GAAG,GAAG,EAAE,CAC5C,UAAU,CAAC,oBAAoB,EAAE,uCAA+B,CAAC,CAAC;AADvD,QAAA,yBAAyB,6BAC8B"}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { Entity, GraphObjectFilter, GraphObjectIteratee, Relationship, GraphObjectStore, GraphObjectIndexMetadata, GetIndexMetadataForGraphObjectTypeParams, IntegrationStep } from '@jupiterone/integration-sdk-core';
|
|
2
|
-
export declare const DEFAULT_GRAPH_OBJECT_BUFFER_THRESHOLD = 500;
|
|
3
2
|
export declare const DEFAULT_GRAPH_OBJECT_FILE_SIZE = 500;
|
|
3
|
+
export declare const DEFAULT_GRAPH_OBJECT_BUFFER_THRESHOLD_IN_BYTES = 5000000;
|
|
4
|
+
export declare const MAX_GRAPH_OBJECT_BUFFER_THRESHOLD_IN_BYTES = 1000000000;
|
|
4
5
|
export interface FileSystemGraphObjectStoreParams {
|
|
5
6
|
integrationSteps?: IntegrationStep[];
|
|
7
|
+
/**
|
|
8
|
+
* The maximum size in bytes of entities/relationships stored in memory at one time.
|
|
9
|
+
* default: 25_000_000
|
|
10
|
+
*/
|
|
11
|
+
graphObjectBufferThresholdInBytes?: number;
|
|
6
12
|
/**
|
|
7
13
|
* The maximum number of graph objects that this store can buffer in memory
|
|
8
14
|
* before writing to disk. Machines with more memory should consider bumping
|
|
9
15
|
* this value up.
|
|
10
16
|
*
|
|
11
17
|
* Default: 500
|
|
18
|
+
* @deprecated this argument is no longer used. Please use `graphObjectBufferThresholdInBytes` instead.
|
|
12
19
|
*/
|
|
13
20
|
graphObjectBufferThreshold?: number;
|
|
14
21
|
/**
|
|
@@ -23,8 +30,8 @@ export interface FileSystemGraphObjectStoreParams {
|
|
|
23
30
|
export declare class FileSystemGraphObjectStore implements GraphObjectStore {
|
|
24
31
|
private readonly semaphore;
|
|
25
32
|
private readonly localGraphObjectStore;
|
|
26
|
-
private readonly graphObjectBufferThreshold;
|
|
27
33
|
private readonly graphObjectFileSize;
|
|
34
|
+
private readonly graphObjectBufferThresholdInBytes;
|
|
28
35
|
private readonly prettifyFiles;
|
|
29
36
|
private readonly stepIdToGraphObjectIndexMetadataMap;
|
|
30
37
|
private readonly entityOnDiskLocationMap;
|
|
@@ -3,17 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FileSystemGraphObjectStore = exports.
|
|
6
|
+
exports.FileSystemGraphObjectStore = exports.MAX_GRAPH_OBJECT_BUFFER_THRESHOLD_IN_BYTES = exports.DEFAULT_GRAPH_OBJECT_BUFFER_THRESHOLD_IN_BYTES = exports.DEFAULT_GRAPH_OBJECT_FILE_SIZE = void 0;
|
|
7
7
|
const async_sema_1 = require("async-sema");
|
|
8
8
|
const p_map_1 = __importDefault(require("p-map"));
|
|
9
9
|
const flushDataToDisk_1 = require("./flushDataToDisk");
|
|
10
10
|
const indices_1 = require("./indices");
|
|
11
|
-
const memory_1 = require("../memory");
|
|
12
11
|
const fileSystem_1 = require("../../fileSystem");
|
|
13
12
|
const bigMap_1 = require("../../execution/utils/bigMap");
|
|
14
13
|
const lodash_1 = require("lodash");
|
|
15
|
-
|
|
14
|
+
const memory_1 = require("../memory");
|
|
16
15
|
exports.DEFAULT_GRAPH_OBJECT_FILE_SIZE = 500;
|
|
16
|
+
exports.DEFAULT_GRAPH_OBJECT_BUFFER_THRESHOLD_IN_BYTES = 5000000;
|
|
17
|
+
// no more than 10^9 bytes
|
|
18
|
+
exports.MAX_GRAPH_OBJECT_BUFFER_THRESHOLD_IN_BYTES = 1000000000;
|
|
17
19
|
// it is important that this value is set to 1
|
|
18
20
|
// to ensure that only one operation can be performed at a time.
|
|
19
21
|
const BINARY_SEMAPHORE_CONCURRENCY = 1;
|
|
@@ -47,11 +49,13 @@ class FileSystemGraphObjectStore {
|
|
|
47
49
|
this.localGraphObjectStore = new memory_1.InMemoryGraphObjectStore();
|
|
48
50
|
this.entityOnDiskLocationMap = new bigMap_1.BigMap(ENTITY_LOCATION_ON_DISK_DEFAULT_MAP_KEY_SPACE);
|
|
49
51
|
this.semaphore = new async_sema_1.Sema(BINARY_SEMAPHORE_CONCURRENCY);
|
|
50
|
-
this.graphObjectBufferThreshold =
|
|
51
|
-
params?.graphObjectBufferThreshold ||
|
|
52
|
-
exports.DEFAULT_GRAPH_OBJECT_BUFFER_THRESHOLD;
|
|
53
52
|
this.graphObjectFileSize =
|
|
54
53
|
params?.graphObjectFileSize || exports.DEFAULT_GRAPH_OBJECT_FILE_SIZE;
|
|
54
|
+
this.graphObjectBufferThresholdInBytes = (0, lodash_1.min)([
|
|
55
|
+
params?.graphObjectBufferThresholdInBytes ||
|
|
56
|
+
exports.DEFAULT_GRAPH_OBJECT_BUFFER_THRESHOLD_IN_BYTES,
|
|
57
|
+
exports.MAX_GRAPH_OBJECT_BUFFER_THRESHOLD_IN_BYTES,
|
|
58
|
+
]);
|
|
55
59
|
this.prettifyFiles = params?.prettifyFiles || false;
|
|
56
60
|
if (params?.integrationSteps) {
|
|
57
61
|
this.stepIdToGraphObjectIndexMetadataMap =
|
|
@@ -60,15 +64,15 @@ class FileSystemGraphObjectStore {
|
|
|
60
64
|
}
|
|
61
65
|
async addEntities(stepId, newEntities, onEntitiesFlushed) {
|
|
62
66
|
await this.localGraphObjectStore.addEntities(stepId, newEntities);
|
|
63
|
-
if (this.localGraphObjectStore.
|
|
64
|
-
this.
|
|
67
|
+
if (this.localGraphObjectStore.getTotalEntitySizeInBytes() >=
|
|
68
|
+
this.graphObjectBufferThresholdInBytes) {
|
|
65
69
|
await this.flushEntitiesToDisk(onEntitiesFlushed);
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
async addRelationships(stepId, newRelationships, onRelationshipsFlushed) {
|
|
69
73
|
await this.localGraphObjectStore.addRelationships(stepId, newRelationships);
|
|
70
|
-
if (this.localGraphObjectStore.
|
|
71
|
-
this.
|
|
74
|
+
if (this.localGraphObjectStore.getTotalRelationshipSizeInBytes() >=
|
|
75
|
+
this.graphObjectBufferThresholdInBytes) {
|
|
72
76
|
await this.flushRelationshipsToDisk(onRelationshipsFlushed);
|
|
73
77
|
}
|
|
74
78
|
}
|
|
@@ -144,7 +148,7 @@ class FileSystemGraphObjectStore {
|
|
|
144
148
|
}
|
|
145
149
|
}));
|
|
146
150
|
}
|
|
147
|
-
this.localGraphObjectStore.flushEntities(entities);
|
|
151
|
+
this.localGraphObjectStore.flushEntities(entities, stepId);
|
|
148
152
|
if (onEntitiesFlushed) {
|
|
149
153
|
await onEntitiesFlushed(entities);
|
|
150
154
|
}
|
|
@@ -173,7 +177,7 @@ class FileSystemGraphObjectStore {
|
|
|
173
177
|
});
|
|
174
178
|
}));
|
|
175
179
|
}
|
|
176
|
-
this.localGraphObjectStore.flushRelationships(relationships);
|
|
180
|
+
this.localGraphObjectStore.flushRelationships(relationships, stepId);
|
|
177
181
|
if (onRelationshipsFlushed) {
|
|
178
182
|
await onRelationshipsFlushed(relationships);
|
|
179
183
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystemGraphObjectStore.js","sourceRoot":"","sources":["../../../../src/storage/FileSystemGraphObjectStore/FileSystemGraphObjectStore.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAkC;AAClC,kDAAyB;AAazB,uDAAoD;AACpD,uCAImB;
|
|
1
|
+
{"version":3,"file":"FileSystemGraphObjectStore.js","sourceRoot":"","sources":["../../../../src/storage/FileSystemGraphOb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,kBAAkB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YAErE,IAAI,sBAAsB,EAAE;gBAC1B,MAAM,sBAAsB,CAAC,aAAa,CAAC,CAAC;aAC7C;QACH,CAAC,CACF,CACF,CAAC;IACJ,CAAC;IAED,kCAAkC,CAAC,EACjC,MAAM,EACN,KAAK,EACL,yBAAyB,GACgB;QAGzC,IAAI,CAAC,IAAI,CAAC,mCAAmC,EAAE;YAC7C,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,mCAAmC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjE,OAAO,GAAG,IAAI,GAAG,CAAC,yBAAyB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACK,KAAK,CAAC,aAAa,CAAI,SAA2B;QACxD,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QAC/B,IAAI;YACF,MAAM,SAAS,EAAE,CAAC;SACnB;gBAAS;YACR,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;SAC1B;IACH,CAAC;CACF;AAzQD,gEAyQC"}
|
|
@@ -7,6 +7,12 @@ export interface GraphObjectMetadata {
|
|
|
7
7
|
* memory before flushing to another datastore (e.g. disk).
|
|
8
8
|
*/
|
|
9
9
|
export declare class InMemoryGraphObjectStore implements GraphObjectStore {
|
|
10
|
+
/**
|
|
11
|
+
* Store the size in bytes for entities and relationships generated by each step.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
private entitySizeInBytes;
|
|
15
|
+
private relationshipSizeInBytes;
|
|
10
16
|
/**
|
|
11
17
|
* Maps to lookup entity/relationship with metadata by _key
|
|
12
18
|
*
|
|
@@ -50,20 +56,26 @@ export declare class InMemoryGraphObjectStore implements GraphObjectStore {
|
|
|
50
56
|
* steps have no interdependence. If we cleared it out, it's possible that
|
|
51
57
|
* two steps could be running in parallel and one of the steps may clear out
|
|
52
58
|
* the maps while the other is still relying on it.
|
|
59
|
+
* @remarks This should only be used to remove *ALL* the entities from a single step from the store
|
|
60
|
+
* @see {@link https://github.com/JupiterOne/sdk/pull/944#discussion_r1303284408}
|
|
53
61
|
*/
|
|
54
|
-
flushEntities(entities: Entity[]): void;
|
|
62
|
+
flushEntities(entities: Entity[], stepId: string): void;
|
|
55
63
|
/**
|
|
56
64
|
* Instead of clearing the entire map, we want to delete old data individually.
|
|
57
65
|
* This will allow us to eventually run steps in parallel without locking when
|
|
58
66
|
* steps have no interdependence. If we cleared it out, it's possible that
|
|
59
67
|
* two steps could be running in parallel and one of the steps may clear out
|
|
60
68
|
* the maps while the other is still relying on it.
|
|
69
|
+
* @remarks This should only be used to remove *ALL* the relationships from a single step from the store
|
|
70
|
+
* @see {@link https://github.com/JupiterOne/sdk/pull/944#discussion_r1303284408}
|
|
61
71
|
*/
|
|
62
|
-
flushRelationships(relationships: Relationship[]): void;
|
|
72
|
+
flushRelationships(relationships: Relationship[], stepId: string): void;
|
|
63
73
|
collectEntities(): Entity[];
|
|
64
74
|
collectRelationships(): Relationship[];
|
|
65
75
|
collectEntitiesByStep(): Map<string, Entity[]>;
|
|
66
76
|
collectRelationshipsByStep(): Map<string, Relationship[]>;
|
|
67
77
|
getTotalEntityItemCount(): number;
|
|
68
78
|
getTotalRelationshipItemCount(): number;
|
|
79
|
+
getTotalEntitySizeInBytes(): number;
|
|
80
|
+
getTotalRelationshipSizeInBytes(): number;
|
|
69
81
|
}
|
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InMemoryGraphObjectStore = void 0;
|
|
4
4
|
const integration_sdk_core_1 = require("@jupiterone/integration-sdk-core");
|
|
5
|
+
const batchBySize_1 = require("../synchronization/batchBySize");
|
|
5
6
|
/**
|
|
6
7
|
* Stores entities and relationships in memory and may be used to buffer data in
|
|
7
8
|
* memory before flushing to another datastore (e.g. disk).
|
|
8
9
|
*/
|
|
9
10
|
class InMemoryGraphObjectStore {
|
|
10
11
|
constructor() {
|
|
12
|
+
/**
|
|
13
|
+
* Store the size in bytes for entities and relationships generated by each step.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
this.entitySizeInBytes = {};
|
|
17
|
+
this.relationshipSizeInBytes = {};
|
|
11
18
|
/**
|
|
12
19
|
* Maps to lookup entity/relationship with metadata by _key
|
|
13
20
|
*
|
|
@@ -51,6 +58,9 @@ class InMemoryGraphObjectStore {
|
|
|
51
58
|
this.entityTypeToKeysMap.set(entity._type, new Map([[entity._key, true]]));
|
|
52
59
|
}
|
|
53
60
|
}
|
|
61
|
+
this.entitySizeInBytes[stepId] = this.entitySizeInBytes[stepId]
|
|
62
|
+
? this.entitySizeInBytes[stepId] + (0, batchBySize_1.getSizeOfObject)(newEntities)
|
|
63
|
+
: (0, batchBySize_1.getSizeOfObject)(newEntities);
|
|
54
64
|
return Promise.resolve();
|
|
55
65
|
}
|
|
56
66
|
addRelationships(stepId, newRelationships) {
|
|
@@ -67,6 +77,9 @@ class InMemoryGraphObjectStore {
|
|
|
67
77
|
this.relationshipTypeToKeysMap.set(relationship._type, new Map([[relationship._key, true]]));
|
|
68
78
|
}
|
|
69
79
|
}
|
|
80
|
+
this.relationshipSizeInBytes[stepId] = this.relationshipSizeInBytes[stepId]
|
|
81
|
+
? this.relationshipSizeInBytes[stepId] + (0, batchBySize_1.getSizeOfObject)(newRelationships)
|
|
82
|
+
: (0, batchBySize_1.getSizeOfObject)(newRelationships);
|
|
70
83
|
return Promise.resolve();
|
|
71
84
|
}
|
|
72
85
|
findEntity(_key) {
|
|
@@ -120,8 +133,10 @@ class InMemoryGraphObjectStore {
|
|
|
120
133
|
* steps have no interdependence. If we cleared it out, it's possible that
|
|
121
134
|
* two steps could be running in parallel and one of the steps may clear out
|
|
122
135
|
* the maps while the other is still relying on it.
|
|
136
|
+
* @remarks This should only be used to remove *ALL* the entities from a single step from the store
|
|
137
|
+
* @see {@link https://github.com/JupiterOne/sdk/pull/944#discussion_r1303284408}
|
|
123
138
|
*/
|
|
124
|
-
flushEntities(entities) {
|
|
139
|
+
flushEntities(entities, stepId) {
|
|
125
140
|
for (const entity of entities) {
|
|
126
141
|
this.entityKeyToEntityMap.delete(entity._key);
|
|
127
142
|
const entityTypeKeysMap = this.entityTypeToKeysMap.get(entity._type);
|
|
@@ -132,6 +147,7 @@ class InMemoryGraphObjectStore {
|
|
|
132
147
|
}
|
|
133
148
|
entityTypeKeysMap.delete(entity._key);
|
|
134
149
|
}
|
|
150
|
+
delete this.entitySizeInBytes[stepId];
|
|
135
151
|
}
|
|
136
152
|
/**
|
|
137
153
|
* Instead of clearing the entire map, we want to delete old data individually.
|
|
@@ -139,8 +155,10 @@ class InMemoryGraphObjectStore {
|
|
|
139
155
|
* steps have no interdependence. If we cleared it out, it's possible that
|
|
140
156
|
* two steps could be running in parallel and one of the steps may clear out
|
|
141
157
|
* the maps while the other is still relying on it.
|
|
158
|
+
* @remarks This should only be used to remove *ALL* the relationships from a single step from the store
|
|
159
|
+
* @see {@link https://github.com/JupiterOne/sdk/pull/944#discussion_r1303284408}
|
|
142
160
|
*/
|
|
143
|
-
flushRelationships(relationships) {
|
|
161
|
+
flushRelationships(relationships, stepId) {
|
|
144
162
|
for (const relationship of relationships) {
|
|
145
163
|
this.relationshipKeyToRelationshipMap.delete(relationship._key);
|
|
146
164
|
const relationshipTypeKeysMap = this.relationshipTypeToKeysMap.get(relationship._type);
|
|
@@ -151,6 +169,7 @@ class InMemoryGraphObjectStore {
|
|
|
151
169
|
}
|
|
152
170
|
relationshipTypeKeysMap.delete(relationship._key);
|
|
153
171
|
}
|
|
172
|
+
delete this.relationshipSizeInBytes[stepId];
|
|
154
173
|
}
|
|
155
174
|
collectEntities() {
|
|
156
175
|
const entities = [];
|
|
@@ -202,6 +221,12 @@ class InMemoryGraphObjectStore {
|
|
|
202
221
|
getTotalRelationshipItemCount() {
|
|
203
222
|
return this.relationshipKeyToRelationshipMap.size;
|
|
204
223
|
}
|
|
224
|
+
getTotalEntitySizeInBytes() {
|
|
225
|
+
return Object.values(this.entitySizeInBytes).reduce((partialSum, stepBytes) => partialSum + stepBytes, 0);
|
|
226
|
+
}
|
|
227
|
+
getTotalRelationshipSizeInBytes() {
|
|
228
|
+
return Object.values(this.relationshipSizeInBytes).reduce((partialSum, stepBytes) => partialSum + stepBytes, 0);
|
|
229
|
+
}
|
|
205
230
|
}
|
|
206
231
|
exports.InMemoryGraphObjectStore = InMemoryGraphObjectStore;
|
|
207
232
|
//# sourceMappingURL=memory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../src/storage/memory.ts"],"names":[],"mappings":";;;AAAA,2EAQ0C;
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../src/storage/memory.ts"],"names":[],"mappings":";;;AAAA,2EAQ0C;AAC1C,gEAAiE;AAcjE;;;GAGG;AACH,MAAa,wBAAwB;IAArC;QACE;;;WAGG;QACK,sBAAiB,GAA+B,EAAE,CAAC;QACnD,4BAAuB,GAA+B,EAAE,CAAC;QAEjE;;;;;;;WAOG;QACc,yBAAoB,GAAG,IAAI,GAAG,EAG5C,CAAC;QACa,qCAAgC,GAAG,IAAI,GAAG,EAGxD,CAAC;QAEJ;;;;;;;;;;;;;;;WAeG;QACc,wBAAmB,GAClC,IAAI,GAAG,EAAE,CAAC;QACK,8BAAyB,GAGtC,IAAI,GAAG,EAAE,CAAC;IA6PhB,CAAC;IA3PC,WAAW,CAAC,MAAc,EAAE,WAAqB;QAC/C,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE;YAChC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE;gBACzC,MAAM;gBACN,MAAM;aACP,CAAC,CAAC;YAEH,MAAM,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAA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