Package org.apache.iotdb.db.sync.common
Class SyncInfo
- java.lang.Object
-
- org.apache.iotdb.db.sync.common.SyncInfo
-
public class SyncInfo extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerLOGGERprotected java.util.Map<java.lang.String,java.util.List<PipeMessage>>pipeMessageMapprotected SyncLogWritersyncLogWriter
-
Constructor Summary
Constructors Constructor Description SyncInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPipe(CreatePipeStatement createPipeStatement, long createTime)voidaddPipe(CreatePipePlan plan, long createTime)voidaddPipeSink(CreatePipeSinkStatement createPipeSinkStatement)voidaddPipeSink(CreatePipeSinkPlan plan)voidclose()voiddropPipeSink(java.lang.String name)java.util.List<PipeInfo>getAllPipeInfos()java.util.List<PipeSink>getAllPipeSink()PipeMessagegetPipeMessage(java.lang.String pipeName, long createTime, boolean consume)read the most important message about one pipe.java.util.List<PipeMessage>getPipeMessages(java.lang.String pipeName, long createTime, boolean consume)read recent messages about one pipePipeSinkgetPipeSink(java.lang.String name)PipeInfogetRunningPipeInfo()voidoperatePipe(java.lang.String pipeName, StatementType statementType)voidwritePipeMessage(java.lang.String pipeName, long createTime, PipeMessage message)write a single message and serialize to disk
-
-
-
Field Detail
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
pipeMessageMap
protected java.util.Map<java.lang.String,java.util.List<PipeMessage>> pipeMessageMap
-
syncLogWriter
protected SyncLogWriter syncLogWriter
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
addPipeSink
public void addPipeSink(CreatePipeSinkPlan plan) throws PipeSinkException, java.io.IOException
- Throws:
PipeSinkExceptionjava.io.IOException
-
addPipeSink
public void addPipeSink(CreatePipeSinkStatement createPipeSinkStatement) throws PipeSinkException, java.io.IOException
- Throws:
PipeSinkExceptionjava.io.IOException
-
dropPipeSink
public void dropPipeSink(java.lang.String name) throws PipeSinkException, java.io.IOException- Throws:
PipeSinkExceptionjava.io.IOException
-
getPipeSink
public PipeSink getPipeSink(java.lang.String name)
-
getAllPipeSink
public java.util.List<PipeSink> getAllPipeSink()
-
addPipe
public void addPipe(CreatePipePlan plan, long createTime) throws PipeException, java.io.IOException
- Throws:
PipeExceptionjava.io.IOException
-
addPipe
public void addPipe(CreatePipeStatement createPipeStatement, long createTime) throws PipeException, java.io.IOException
- Throws:
PipeExceptionjava.io.IOException
-
operatePipe
public void operatePipe(java.lang.String pipeName, StatementType statementType) throws PipeException, java.io.IOException- Throws:
PipeExceptionjava.io.IOException
-
getAllPipeInfos
public java.util.List<PipeInfo> getAllPipeInfos()
-
getRunningPipeInfo
public PipeInfo getRunningPipeInfo()
- Returns:
- null if no pipe has been created
-
writePipeMessage
public void writePipeMessage(java.lang.String pipeName, long createTime, PipeMessage message)write a single message and serialize to disk- Parameters:
pipeName- name of pipecreateTime- createTime of pipemessage- pipe message
-
getPipeMessages
public java.util.List<PipeMessage> getPipeMessages(java.lang.String pipeName, long createTime, boolean consume)
read recent messages about one pipe- Parameters:
pipeName- name of pipecreateTime- createTime of pipeconsume- if consume is true, these messages will not be deleted. Otherwise, these messages can be read next time.- Returns:
- recent messages
-
getPipeMessage
public PipeMessage getPipeMessage(java.lang.String pipeName, long createTime, boolean consume)
read the most important message about one pipe. ERROR > WARN > INFO.- Parameters:
pipeName- name of pipecreateTime- createTime of pipeconsume- if consume is true, recent messages will not be deleted. Otherwise, these messages can be read next time.- Returns:
- the most important message
-
-