mapContext.isRestarted

Property Description

Indicates whether the map(mapContext) function has run before for this key-value pair.

For an overview of events that can cause a restart, see System Response After a Map/Reduce Interruption.

When the map function restarts for a key-value pair, any data it wrote last time is deleted. Some of its logic might still have run before the interruption, though, so if mapContext.isRestarted is true, your script should take steps to avoid duplicate processing. For examples, see Adding Logic to Handle Map/Reduce Restarts.

Related properties include mapContext.executionNo and mapContext.errors.

Type

boolean

Since

2016.1

Syntax

The following code snippet shows the syntax for this member. It's not a functional example. For a complete script example, see SuiteScript 2.x Map/Reduce Script Code Samples.

          // Add additional code.
...
function map(context) {
    if (context.isRestarted)
    {
        // Add logic designed to assess how much processing was completed for this key-value pair and react accordingly. 
    }
    else
    {
        // Let full processing continue for the key-value pair.
    }
  ...
// Add additional code. 

        

Related Topics

General Notices