Class MonitoringUtil


  • public class MonitoringUtil
    extends java.lang.Object
    A helper class for monitoring jobs submitted to the service.
    • Constructor Summary

      Constructors 
      Constructor Description
      MonitoringUtil​(DataflowClient dataflowClient)
      Construct a helper for monitoring.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.lang.String getGcloudCancelCommand​(DataflowPipelineOptions options, java.lang.String jobId)  
      java.util.List<com.google.api.services.dataflow.model.JobMessage> getJobMessages​(java.lang.String jobId, long startTimestampMs)
      Return job messages sorted in ascending order by timestamp.
      static java.lang.String getJobMonitoringPageURL​(java.lang.String projectName, java.lang.String jobId)
      Deprecated.
      this method defaults the region to "us-central1".
      static java.lang.String getJobMonitoringPageURL​(java.lang.String projectName, java.lang.String regionId, java.lang.String jobId)  
      static org.apache.beam.sdk.PipelineResult.State toState​(@Nullable java.lang.String stateName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MonitoringUtil

        public MonitoringUtil​(DataflowClient dataflowClient)
        Construct a helper for monitoring.
    • Method Detail

      • getJobMessages

        public java.util.List<com.google.api.services.dataflow.model.JobMessage> getJobMessages​(java.lang.String jobId,
                                                                                                long startTimestampMs)
                                                                                         throws java.io.IOException
        Return job messages sorted in ascending order by timestamp.
        Parameters:
        jobId - The id of the job to get the messages for.
        startTimestampMs - Return only those messages with a timestamp greater than this value.
        Returns:
        collection of messages
        Throws:
        java.io.IOException
      • getJobMonitoringPageURL

        @Deprecated
        public static java.lang.String getJobMonitoringPageURL​(java.lang.String projectName,
                                                               java.lang.String jobId)
        Deprecated.
        this method defaults the region to "us-central1". Prefer using the overload with an explicit regionId parameter.
      • getJobMonitoringPageURL

        public static java.lang.String getJobMonitoringPageURL​(java.lang.String projectName,
                                                               java.lang.String regionId,
                                                               java.lang.String jobId)
      • getGcloudCancelCommand

        public static java.lang.String getGcloudCancelCommand​(DataflowPipelineOptions options,
                                                              java.lang.String jobId)
      • toState

        public static org.apache.beam.sdk.PipelineResult.State toState​(@Nullable java.lang.String stateName)