16.20 - Send the Messages with Large UOWHealthAmount - Teradata Ecosystem Manager

Teradata® Ecosystem Manager API Reference

Product
Teradata Ecosystem Manager
Release Number
16.20
Published
December 2020
Language
English (United States)
Last Update
2020-12-23
dita:mapPath
loa1512743917841.ditamap
dita:ditavalPath
ft:empty
With large UOWHealthAmounts, it is strongly recommended that you use the BigDecimal constructor, which uses String as the input parameter to maintain the precision and scale. Using the BigDecimal constructor, which uses Double as the input parameter for large UOWHealthAmounts, can cause precision loss and unpredictable results.

For additional information on BigDecimal, refer to http://docs.oracle.com/javase/6/docs/api/java/math/BigDecimal.html.

Correct usage is

  • Single healthAmount
    //String based BigDecimal constructor for large UOWHealthAmount
    BigDecimal healthAmount = new BigDecimal(“123456789123456789123456789123456789.12”);
    //send healthcheck event
    Rsender.sendHealthCheckEvent(null,null,”HealthCheckMessage”,”TestTDPID”,
    ”TestResourceId”,”TestResourceType”,uow,null,healthAmount,”TestHealthString”,null,
    ”TestDatabase”,”TestTable”,”TestApplicationId”,null,null,null,null);
  • Multi-value healthAmount (applicable to HCHK and STEP only)
    List healthAmountList = new ArrayList<BigDecimal>();
    List healthStringList = new ArrayList<String>();
    healthAmountList.add(new BigDecimal("123456789123456789123456789123456789.12"));
    healthAmountList.add(new BigDecimal("12.3456789123456789123456789123456789"));
    healthStringList.add("Health_String_List1");
    healthStringList.add("Health_String_List2");
    //send multi-value HCHK event
     rsender.sendHealthCheckEvent(null,null,"HealthCheckMessage","TestTDPID","TestResource",
    resourceTypeList,uow,null,healthAmountList, healthStringList,null,"Test_DB","TestTable","TestApplicationID",null,null,null);