Skip to content

Commit

Permalink
mostly whitespace and docstring cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
beck3905 committed Feb 28, 2023
1 parent 8aa3927 commit b45b0a1
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions packages/@aws-cdk/aws-stepfunctions/lib/states/distributed-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface IItemReader {
/**
* Limits the number of items passed to the Distributed Map state
*
* @default - No maxItems
* @default - Distribute Map state will iterate over all items provided by the ItemReader
*/
readonly maxItems?: number

Expand All @@ -33,7 +33,6 @@ export interface IItemReader {
* Compile policy statements to provide relevent permissions to the state machine
*/
providePolicyStatements(): iam.PolicyStatement[]

}

/**
Expand All @@ -49,7 +48,7 @@ interface ItemReaderProps {
/**
* Limits the number of items passed to the Distributed Map state
*
* @default - No maxItems
* @default - Distribute Map state will iterate over all items provided by the ItemReader
*/
readonly maxItems?: number
}
Expand Down Expand Up @@ -91,6 +90,11 @@ export class S3ObjectsItemReader implements IItemReader {
* @default - No maxItems
*/
readonly maxItems?: number;

/**
* ARN for the `listObjectsV2` method of the S3 API
* This API method is used to iterate all objects in the S3 bucket/prefix
*/
private readonly resource: string = 'arn:aws:states:::s3:listObjectsV2'

constructor(props: S3ObjectsItemReaderProps) {
Expand Down Expand Up @@ -119,7 +123,6 @@ export class S3ObjectsItemReader implements IItemReader {
* Compile policy statements to provide relevent permissions to the state machine
*/
public providePolicyStatements(): iam.PolicyStatement[] {

const resource = `arn:aws:s3:::${this.bucket.bucketName}`;

return [
Expand All @@ -137,19 +140,16 @@ export class S3ObjectsItemReader implements IItemReader {
* Base interface for Item Reader configuration properties the iterate over entries in a S3 file
*/
export interface S3ItemReaderProps extends ItemReaderProps {

/**
* Key of file stored in S3 bucket containing an array to iterate over
*/
readonly key: string

}

/**
* Base Item Reader configuration for iterating over entries in a S3 file
*/
abstract class S3ItemReader implements IItemReader {

/**
* S3 Bucket containing a file with a list to iterate over
*/
Expand All @@ -166,6 +166,7 @@ abstract class S3ItemReader implements IItemReader {
* @default - No maxItems
*/
readonly maxItems?: number;

protected readonly resource: string = 'arn:aws:states:::s3:getObject'
protected abstract readonly inputType: string;

Expand Down Expand Up @@ -270,19 +271,16 @@ export class CsvHeaders {
this.headerLocation = headerLocation;
this.headers = headers;
}

}

/**
* Properties for configuring an Item Reader that iterates over items in a CSV file in S3
*/
export interface S3CsvItemReaderProps extends S3ItemReaderProps {

/**
* CSV file header configuration
*/
readonly csvHeaders: CsvHeaders

}

/**
Expand Down Expand Up @@ -684,7 +682,8 @@ export interface DistributedMapProps extends MapProps {
*/
export class DistributedMap extends Map implements INextable {

protected readonly mode: MapStateMode = MapStateMode.DISTRIBUTED
protected readonly mode: MapStateMode = MapStateMode.DISTRIBUTED;

private readonly mapExecutionType?: StateMachineType;
private readonly itemReader?: IItemReader;
private readonly toleratedFailurePercentage?: ToleratedFailurePercentage;
Expand All @@ -706,7 +705,6 @@ export class DistributedMap extends Map implements INextable {
this.maxInputBytesPerBatch = props.maxInputBytesPerBatch;
this.batchInput = props.batchInput;
this.resultWriter = props.resultWriter;

}

/**
Expand Down Expand Up @@ -797,5 +795,4 @@ export class DistributedMap extends Map implements INextable {
},
};
}

}

0 comments on commit b45b0a1

Please sign in to comment.