Class PipeOpSgManager
- java.lang.Object
-
- org.apache.iotdb.db.sync.datasource.PipeOpSgManager
-
public class PipeOpSgManager extends java.lang.ObjectThis class manage the operation data for 1 StorageGroup
-
-
Constructor Summary
Constructors Constructor Description PipeOpSgManager(java.lang.String storageGroupName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPipeOpBlock(AbstractOpBlock opBlock)Add 1 new operation block to SGjava.util.List<java.lang.Long>commitData(long committedIndex)Notify that the data (whose index <= committedIndex) has been committed.longgetFirstAvailableIndex()Get the first available data.longgetNextIndex()Get Next Operation Index after last operation.OperationgetOperation(long beginIndex, long length)Get Operations from current StorageGroup.booleanisEmpty()booleanopBlockNeedCommit(long commitIndex)Check whether this data commit-index will cause committing some opBlocks
-
-
-
Method Detail
-
addPipeOpBlock
public void addPipeOpBlock(AbstractOpBlock opBlock)
Add 1 new operation block to SG- Parameters:
opBlock- , 1 new operation block
-
getOperation
public Operation getOperation(long beginIndex, long length) throws java.io.IOException
Get Operations from current StorageGroup. returned Operations rang is [beginIndex, endIndex), endIndex <= (beginIndex+length). Note: Real returned Operations size can be <= length- Parameters:
beginIndex- , the start beginIndex of operationlength- , the max number of operations- Returns:
- Throws:
java.io.IOException
-
opBlockNeedCommit
public boolean opBlockNeedCommit(long commitIndex) throws java.io.IOExceptionCheck whether this data commit-index will cause committing some opBlocks- Parameters:
commitIndex-- Returns:
- Throws:
java.io.IOException
-
getFirstAvailableIndex
public long getFirstAvailableIndex()
Get the first available data. Note: Even if those committed data may still be available as long as it is not deleted.- Returns:
-
getNextIndex
public long getNextIndex()
Get Next Operation Index after last operation.- Returns:
-
isEmpty
public boolean isEmpty()
-
commitData
public java.util.List<java.lang.Long> commitData(long committedIndex)
Notify that the data (whose index <= committedIndex) has been committed. May remove the data entry whose whole data's index <= committedIndex.- Parameters:
committedIndex-- Returns:
- If successful, return filePipeSerialNumber. Otherwise, return Long.MIN_VALUE.
-
-