Class Communication

  • All Implemented Interfaces:
    Cloneable

    public class Communication
    extends Object
    implements Cloneable
    一个任务的所有状态存储 全局上下文对象 动作的耗时单独计算
    Author:
    lb
    Date:
    2023年12月4日
    • Constructor Detail

      • Communication

        public Communication()
    • Method Detail

      • reset

        public void reset()
      • getStartTime

        public long getStartTime()
      • setStartTime

        public void setStartTime​(long startTime)
      • getEndTime

        public long getEndTime()
      • getState

        public State getState()
      • setState

        public void setState​(State state,
                             boolean isForce)
      • setState

        public void setState​(State state)
      • getThrowable

        public Throwable getThrowable()
      • getThrowableMessage

        public String getThrowableMessage()
      • setThrowable

        public void setThrowable​(Throwable throwable)
      • setThrowable

        public void setThrowable​(Throwable throwable,
                                 boolean isForce)
      • getTimestamp

        public long getTimestamp()
      • setTimestamp

        public void setTimestamp​(long timestamp)
      • addMessage

        public void addMessage​(String key,
                               String value)
      • getLongCounter

        public Long getLongCounter​(String key)
      • setLongCounter

        public void setLongCounter​(String key,
                                   long value)
      • getDoubleCounter

        public Double getDoubleCounter​(String key)
      • setDoubleCounter

        public void setDoubleCounter​(String key,
                                     double value)
      • increaseCounter

        public void increaseCounter​(String key,
                                    long deltaValue)
        增加某个key的数量
        Parameters:
        key -
        deltaValue -
      • runing

        public boolean runing()
        启动任务
        Returns:
      • mergeStateFrom

        public State mergeStateFrom​(Communication otherComm)
        合并state,优先级: (Failed | Killed) > Running > Success 这里不会出现 Killing 状态,killing 状态只在 Job 自身状态上才有.
      • isFinished

        public boolean isFinished()