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

Teradata Ecosystem Manager API Reference

prodname
Teradata Ecosystem Manager
vrm_release
16.10
created_date
June 2017
category
Programming Reference
featnum
B035-3204-067K
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);