/** * Local wrapper for activities client invocation. This lets us specify * retry policy that handles failures from workers and from SWF itself. All * parameters passed directly to client and return whatever the client * returns. */ @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumRetryIntervalSeconds = 30, maximumAttempts = 5) @Asynchronous private Promise<Void> announceFinished(final String name, final Promise<?>... waitFor) { return this.announcer.announceFinished(name); }
/** * Local wrapper for activities client invocation. This lets us specify * retry policy that handles failures from workers and from SWF itself. All * parameters passed directly to client and return whatever the client * returns. */ @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumRetryIntervalSeconds = 30, maximumAttempts = 5) @Asynchronous private Promise<Void> announceInjury(final String name, final Promise<?>... waitFor) { return this.announcer.announceInjury(name); }
/** * Local wrapper for activities client invocation. This lets us specify * retry policy that handles failures from workers and from SWF itself. All * parameters passed directly to client and return whatever the client * returns. */ @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumRetryIntervalSeconds = 30, maximumAttempts = 5) @Asynchronous private Promise<Void> announceLap(final String name, final int lap, final Promise<?>... waitFor) { return this.announcer.announceLap(name, lap); }
/** * Local wrapper for activities client invocation. This lets us specify * retry policy that handles failures from workers and from SWF itself. All * parameters passed directly to client and return whatever the client * returns. */ @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumRetryIntervalSeconds = 30, maximumAttempts = 5) @Asynchronous private Promise<Void> announceMissing(final String name, final Promise<?>... waitFor) { return this.announcer.announceMissing(name); }
/** * Local wrapper for activities client invocation. This lets us specify * retry policy that handles failures from workers and from SWF itself. All * parameters passed directly to client and return whatever the client * returns. */ @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumRetryIntervalSeconds = 30, maximumAttempts = 5) @Asynchronous private Promise<Void> announcePlace(final String name, final Integer place, final Promise<?>... waitFor) { return this.announcer.announcePlace(name, place); }
/** * Local wrapper for activities client invocation. This lets us specify * retry policy that handles failures from workers and from SWF itself. All * parameters passed directly to client and return whatever the client * returns. */ @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumRetryIntervalSeconds = 30, maximumAttempts = 5) @Asynchronous private Promise<Void> announceRace(final Promise<List<String>> horses, final Promise<Integer> laps, final Promise<?>... waitFor) { return this.announcer.announceRace(horses, laps); }
/** * Local wrapper for activities client invocation. This lets us specify * retry policy that handles failures from workers and from SWF itself. All * parameters passed directly to client and return whatever the client * returns. */ @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumRetryIntervalSeconds = 30, maximumAttempts = 5) @Asynchronous private Promise<Void> arriveGate(final String name, final Promise<?>... waitFor) { return this.horses.arriveGate(name); }
/** * Local wrapper for activities client invocation. This lets us specify * retry policy that handles failures from workers and from SWF itself. All * parameters passed directly to client and return whatever the client * returns. */ @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumRetryIntervalSeconds = 30, maximumAttempts = 5) @Asynchronous private Promise<Status> runLap(final String name, final int lapNum, final Promise<?>... waitFor) { return this.horses.runLap(name, lapNum); }
@ExponentialRetry(initialRetryIntervalSeconds = 10, maximumAttempts = 10) int computeSumForChunk(String bucketName, String filename, int chunkNumber, int chunkSize) throws IOException;
@Description( value = "Create role $params.get(0) with permission to SWF task list $params.get(1) that caller account can assume", result = "Role with ARN $output" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) String createAgentControllerRole( String roleName, String workflowTaskList, Identity clientIdentity );
@Description( value = "Determine UserData of worker EC2 instance" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) String createAgentUserData( String roleArn, String workflowTaskList );
@Description( value = "Determine temporary database instance name for snapshot $params.get(0)" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) String createDatabaseName( String snapshotName );
@Description( value = "Determine snapshot name of database instance $params.get(0)" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) String createSnapshotName( String databaseName );
@Description( "Delete role $params.get(0)" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void deleteRole( String roleName );
@ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void notifyActionCompleted( String actionId, String result, long elapsedMillis );
@ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void notifyActionFailed( String actionId, String result, String failureDetails, long elaspsedMillis );
@ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) String notifyActionStarted( String actionName, String description );
@ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void notifyJobCompleted();
@ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void notifyJobFailed( Throwable e );
@ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void notifyJobStarted();
@Description( "Create database snapshot $params.get(0) from RDS instance $params.get(1)" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void createSnapshot( String snapshotName, String instanceName, Identity identity );
@Description( "Delete database snapshot $params.get(0)" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void deleteSnapshot( String snapshotName, Identity identity );
@Description( value = "Check status of RDS instance $params.get(0)", result = "$output.instanceStatus" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) DatabaseInstance describeInstance( String instanceName, Identity identity );
@Description( value = "Check status of database snapshot $params.get(0)", result = "$output" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) String getSnapshotStatus( String snapshotName, Identity identity );
@Description( "Restore RDS instance $params.get(1) from database snapshot $params.get(0) in subnet $params.get(2)" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) DatabaseInstance restoreSnapshot( String snapshotName, String instanceName, String subnetId, Identity identity );
@Description( "Terminate RDS instance $params.get(0)" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void terminateInstance( String instanceName, Identity identity );
@Description( "Create instance profile $params.get(0) under caller's account with permission to assume role $params.get(1)" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void createAgentInstanceProfile( String profileName, String controllerRoleArn, Identity identity );
@Description( "Delete instance profile $params.get(0)" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void deleteInstanceProfile( String profileName, Identity identity );
@Description( value = "Check status of EC2 instance $params.get(0)", result = "$output.instanceStatus" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) WorkerInstance describeInstance( String instanceId, Identity identity );
@Description( value = "Launch EC2 instance with under caller's account with instance profile $params.get(0).getInstanceProfileName()", result = "EC2 instance $output" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) String launchInstance( CreateInstanceOptions options, Identity identity );
@Description( "Terminate EC2 instance $params.get(0) under caller's account" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) void terminateInstance( String instanceId, Identity identity );
@Description( value = "Run command from EC2 instance", result = "Job printed out [$output.standardOutput] and returned $output.exitCode after $output.elapsedMillis milliseconds" ) @ExponentialRetry( initialRetryIntervalSeconds = 30, maximumAttempts = 5 ) JobResult runJob( Job job );
/** * Upload a file to storage. * * @param bucketName Name of the S3 bucket to upload to * @param localName Local name of the file to upload to S3 * @param remoteName Name of the file to use when uploaded to S3 */ @ExponentialRetry(initialRetryIntervalSeconds = 10, maximumAttempts = 10) void upload(String bucketName, String localName, String remoteName);
/** * Download a file from storage. * * @param bucketName Name of the S3 bucket to download from * @param remoteName Name of the file to download from S3 * @param localName Local name of the file to download to */ @ExponentialRetry(initialRetryIntervalSeconds = 10, maximumAttempts = 10) String download(String bucketName, String remoteName, String localName) throws Exception;
/** * Delete temporary local files. * * @param fileName Name of file to delete from temporary folder */ @ExponentialRetry(initialRetryIntervalSeconds = 10) void deleteLocalFile(String fileName);
/** * Local wrapper for activities client invocation. This lets us specify * retry policy that handles failures from workers and from SWF itself. All * parameters passed directly to client and return whatever the client * returns. */ @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumRetryIntervalSeconds = 30, maximumAttempts = 5) @Asynchronous private Promise<Void> announceEnd(final Promise<?>... waitFor) { return this.announcer.announceEnd(); }
/** * use @ExponentialRetry annotation to define the retry policy. The * parameter initialRetryIntervalSeconds indicates the time period to wait * for the first retry attempt. The parameter maximumAttempts specifies the * number of attempts after which the retry will stop. The exceptionsToRetry * parameter indicates that only exceptions in the exceptionsToRetry list * will be retried. */ @ExponentialRetry(initialRetryIntervalSeconds = 5, maximumAttempts = 5, exceptionsToRetry = IllegalStateException.class) public void unreliableActivity();
/** * * @param localName * Name of the file to upload from temporary directory * @param remoteName * Name of the file to use on S3 bucket after upload * @param fromBox * Machine name which has the file that needs to be uploaded * @return */ @ExponentialRetry(initialRetryIntervalSeconds = 10, maximumAttempts = 10) public void upload(String bucketName, String localName, String targetName);
/** * * @param remoteName * Name of the file to download from S3 bucket * @param localName * Name of the file used locally after download * @param toBox * This is an output parameter here. * Used to communicate the name of the box that runs download activity */ @ExponentialRetry(initialRetryIntervalSeconds = 10, maximumAttempts = 10) public String download(String bucketName, String remoteName, String localName) throws Exception;
/** * * @param fileName * Name of file to delete from temporary folder * @param machineName * Machine which has the file locally * @return */ @ExponentialRetry(initialRetryIntervalSeconds=10) public void deleteLocalFile(String fileName);