Class PipeTaskInfo

java.lang.Object
org.apache.iotdb.confignode.persistence.pipe.PipeTaskInfo
All Implemented Interfaces:
SnapshotProcessor

public class PipeTaskInfo extends Object implements SnapshotProcessor
  • Constructor Details

    • PipeTaskInfo

      public PipeTaskInfo()
  • Method Details

    • updateLastSyncedVersion

      public void updateLastSyncedVersion()
      Caller should ensure that the method is called in the lock acquireWriteLock().
    • canSkipNextSync

      public boolean canSkipNextSync()
    • checkBeforeCreatePipe

      public boolean checkBeforeCreatePipe(TCreatePipeReq createPipeRequest) throws PipeException
      Throws:
      PipeException
    • checkAndUpdateRequestBeforeAlterPipe

      public boolean checkAndUpdateRequestBeforeAlterPipe(TAlterPipeReq alterPipeRequest) throws PipeException
      Throws:
      PipeException
    • checkBeforeStartPipe

      public void checkBeforeStartPipe(String pipeName) throws PipeException
      Throws:
      PipeException
    • checkBeforeStopPipe

      public void checkBeforeStopPipe(String pipeName) throws PipeException
      Throws:
      PipeException
    • checkBeforeDropPipe

      public void checkBeforeDropPipe(String pipeName)
    • isPipeExisted

      public boolean isPipeExisted(String pipeName)
    • isPipeRunning

      public boolean isPipeRunning(String pipeName)
    • isPipeStoppedByUser

      public boolean isPipeStoppedByUser(String pipeName)
    • validatePipePluginUsageByPipe

      public void validatePipePluginUsageByPipe(String pluginName)
    • createPipe

      public TSStatus createPipe(CreatePipePlanV2 plan)
    • operateMultiplePipes

      public TSStatus operateMultiplePipes(OperateMultiplePipesPlanV2 plan)
    • alterPipe

      public TSStatus alterPipe(AlterPipePlanV2 plan)
    • setPipeStatus

      public TSStatus setPipeStatus(SetPipeStatusPlanV2 plan)
    • dropPipe

      public TSStatus dropPipe(DropPipePlanV2 plan)
    • showPipes

      public DataSet showPipes()
    • getPipeMetaList

      public Iterable<PipeMeta> getPipeMetaList()
    • getPipeMetaByPipeName

      public PipeMeta getPipeMetaByPipeName(String pipeName)
    • isEmpty

      public boolean isEmpty()
    • handleLeaderChange

      public TSStatus handleLeaderChange(PipeHandleLeaderChangePlan plan)
      Handle the region leader change event and update the pipe task meta accordingly.
    • handleMetaChanges

      public TSStatus handleMetaChanges(PipeHandleMetaChangePlan plan)
      Replace the local PipeMetas by the PipeMetas from the leader ConfigNode.
      Parameters:
      plan - The plan containing all the PipeMetas from leader ConfigNode
      Returns:
      TSStatusCode.SUCCESS_STATUS
    • isStoppedByRuntimeException

      public boolean isStoppedByRuntimeException(String pipeName)
    • clearExceptionsAndSetIsStoppedByRuntimeExceptionToFalse

      public void clearExceptionsAndSetIsStoppedByRuntimeExceptionToFalse(String pipeName)
      Clear the exceptions of a pipe locally after it starts successfully.

      If there are exceptions cleared or flag changed, the messages will then be updated to all the nodes through PipeHandleMetaChangeProcedure.

      Parameters:
      pipeName - The name of the pipe to be clear exception
    • setIsStoppedByRuntimeExceptionToFalse

      public void setIsStoppedByRuntimeExceptionToFalse(String pipeName)
    • recordDataNodePushPipeMetaExceptions

      public boolean recordDataNodePushPipeMetaExceptions(Map<Integer,TPushPipeMetaResp> respMap)
      Record the exceptions of all pipes locally if they encountered failure when pushing PipeMetas to dataNodes.

      If there are exceptions recorded, the related pipes will be stopped, and the exception messages will then be updated to all the nodes through PipeHandleMetaChangeProcedure.

      Parameters:
      respMap - The responseMap after pushing pipe meta
      Returns:
      true if there are exceptions encountered
    • autoRestart

      public boolean autoRestart()
    • handleSuccessfulRestart

      public void handleSuccessfulRestart()
    • removePipeMeta

      public void removePipeMeta(String pipeName)
    • processTakeSnapshot

      public boolean processTakeSnapshot(File snapshotDir) throws IOException
      Specified by:
      processTakeSnapshot in interface SnapshotProcessor
      Throws:
      IOException
    • processLoadSnapshot

      public void processLoadSnapshot(File snapshotDir) throws IOException
      Specified by:
      processLoadSnapshot in interface SnapshotProcessor
      Throws:
      IOException
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • runningPipeCount

      public long runningPipeCount()
    • droppedPipeCount

      public long droppedPipeCount()
    • userStoppedPipeCount

      public long userStoppedPipeCount()
    • exceptionStoppedPipeCount

      public long exceptionStoppedPipeCount()