Class ExtractionPipelineRuns.Heartbeat

    • Constructor Detail

      • Heartbeat

        public Heartbeat()
    • Method Detail

      • of

        public static ExtractionPipelineRuns.Heartbeat of​(CogniteClient client,
                                                          String extractionPipelineExtId)
        Create the heartbeat object. The heartbeat object will post a regular heartbeat to a specified extraction pipeline. You start the heartbeat by calling start(). This will start a background thread posting a heartbeat to Cognite Data Fusion until you call stop(). You can also push a single heartbeat by calling sendHeartbeat().
        Parameters:
        client - The cognite client for connecting to CDF.
        extractionPipelineExtId - The external id of the extraction pipeline to post the heartbeat to.
        Returns:
        the heartbeat object.
      • sendHeartbeat

        public void sendHeartbeat()
                           throws Exception
        Push a heartbeat ExtractionPipelineRun.Status.SEEN to Cognite Data Fusion.
        Throws:
        Exception
      • start

        public boolean start()
        Start the heartbeat thread to perform an upload every interval. The default heartbeat interval is every 60 seconds. If the heartbeat thread has already been started (for example by an earlier call to start() then this method does nothing and returns false.
        Returns:
        true if the heartbeat thread started successfully, false if the heartbeat thread has already been started.
      • close

        public void close()
        A mirror of the stop() method to support auto close in a try-with-resources statement.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        See Also:
        stop()
      • stop

        public boolean stop()
        Stops the heartbeat thread if it is running.
        Returns:
        true if the heartbeat thread stopped successfully, false if the heartbeat thread was not started in the first place.