Use better names

Signed-off-by: Damon Kaswell <damon.kaswell1@hp.com>
This commit is contained in:
Damon Kaswell
2022-11-30 15:45:21 -08:00
parent 1520967c50
commit e3576b80ec
3 changed files with 13 additions and 13 deletions
@@ -62,8 +62,8 @@ export interface IncrementalEntityProviderOptions {
backoff?: DurationObjectUnits[];
burstInterval: DurationObjectUnits;
burstLength: DurationObjectUnits;
rejectEmptyEntityCollections?: boolean;
removalThreshold?: number;
rejectEmptySourceCollections?: boolean;
rejectRemovalsAbovePercentage?: number;
restLength: DurationObjectUnits;
}
@@ -283,7 +283,7 @@ export class IncrementalIngestionEngine implements IterationEngine {
const { total } = result;
let doRemoval = true;
if (this.options.rejectEmptyEntityCollections) {
if (this.options.rejectEmptySourceCollections) {
if (total === 0) {
this.options.logger.error(
`incremental-engine: Ingestion '${id}': Rejecting empty entity collection!`,
@@ -292,12 +292,12 @@ export class IncrementalIngestionEngine implements IterationEngine {
}
}
if (this.options.removalThreshold) {
if (this.options.rejectRemovalsAbovePercentage) {
// If the total entities upserted in this ingestion is 0, then
// 100% of entities are stale and marked for removal.
const percentRemoved =
total > 0 ? (result.removed.length / total) * 100 : 100;
if (percentRemoved <= this.options.removalThreshold) {
if (percentRemoved <= this.options.rejectRemovalsAbovePercentage) {
this.options.logger.info(
`incremental-engine: Ingestion '${id}': Removing ${result.removed.length} entities that have no matching assets`,
);
@@ -129,15 +129,15 @@ export interface IncrementalEntityProviderOptions {
* Backstage removing all associated entities. To avoid that, set
* a percentage of entities past which removal will be disallowed.
*/
removalThreshold?: number;
rejectRemovalsAbovePercentage?: number;
/**
* Similar to the removalThreshold, this option prevents removals
* in circumstances where a data source has improperly returned 0
* assets. If set to `true`, Backstage will reject removals when
* that happens.
* Similar to the rejectRemovalsAbovePercentage, this option
* prevents removals in circumstances where a data source has
* improperly returned 0 assets. If set to `true`, Backstage will
* reject removals when that happens.
*/
rejectEmptyEntityCollections?: boolean;
rejectEmptySourceCollections?: boolean;
}
/** @public */
@@ -162,6 +162,6 @@ export interface IterationEngineOptions {
restLength: DurationObjectUnits;
ready: Promise<void>;
backoff?: IncrementalEntityProviderOptions['backoff'];
removalThreshold?: number;
rejectEmptyEntityCollections?: boolean;
rejectRemovalsAbovePercentage?: number;
rejectEmptySourceCollections?: boolean;
}