Java Code Examples for org.pentaho.di.core.Const#HEARTBEAT_PERIODIC_INTERVAL_IN_SECS

The following examples show how to use org.pentaho.di.core.Const#HEARTBEAT_PERIODIC_INTERVAL_IN_SECS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Job.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private int getHeartbeatIntervalInSeconds() {

    JobMeta meta = this.jobMeta;

    // 1 - check if there's a user defined value ( job-specific ) heartbeat periodic interval;
    // 2 - check if there's a default defined value ( job-specific ) heartbeat periodic interval;
    // 3 - use default Const.HEARTBEAT_PERIODIC_INTERVAL_IN_SECS if none of the above have been set

    try {

      if ( meta != null ) {

        return Const.toInt( meta.getParameterValue( Const.VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS ), Const.toInt( meta
            .getParameterDefault( Const.VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS ),
            Const.HEARTBEAT_PERIODIC_INTERVAL_IN_SECS ) );
      }

    } catch ( Exception e ) {
      /* do nothing, return Const.HEARTBEAT_PERIODIC_INTERVAL_IN_SECS */
    }

    return Const.HEARTBEAT_PERIODIC_INTERVAL_IN_SECS;
  }
 
Example 2
Source File: Trans.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private int getHeartbeatIntervalInSeconds() {

    TransMeta meta = this.getTransMeta();

    // 1 - check if there's a user defined value ( transformation-specific ) heartbeat periodic interval;
    // 2 - check if there's a default defined value ( transformation-specific ) heartbeat periodic interval;
    // 3 - use default Const.HEARTBEAT_PERIODIC_INTERVAL_IN_SECS if none of the above have been set

    try {

      if ( meta != null ) {

        return Const.toInt( meta.getParameterValue( Const.VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS ), Const.toInt( meta
            .getParameterDefault( Const.VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS ),
          Const.HEARTBEAT_PERIODIC_INTERVAL_IN_SECS ) );
      }

    } catch ( Exception e ) {
      /* do nothing, return Const.HEARTBEAT_PERIODIC_INTERVAL_IN_SECS */
    }

    return Const.HEARTBEAT_PERIODIC_INTERVAL_IN_SECS;
  }