GraphSearch Undeliverable Message Handling - Aster Execution Engine

Teradata Aster® Developer Guide

Product
Aster Execution Engine
Release Number
7.00.02
Published
July 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
xnl1494366523182.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
ffu1489104705746
lifecycle
previous
Product Category
Software

A graph function must implement an undeliverableMessageHandler method that handles with any undeliverable vertex messages. The following example shows the GraphSearch implementation of the undeliverableMessageHandler method. The method simply issues a global halt if any undeliverable messages are received. Another option would have been for the method to log each message and return, thus allowing graph processing to proceed.

/**
* If there are any undeliverable messages, then stop graph processing. 
* Alternatively, one can log messages and continued.
* @param globals - provides the iteration number and other global state
* @param undeliverableMessages - the messages that could not be delivered
*/
public void undeliverableMessagesHandler(GraphGlobals globals,
VertexMessageIterator undeliverableMessages) {
   if (undeliverableMessages.advanceToNextMessage()){
      globals.globalHalt();
   }
   return;
}