Class TxnBatchedPositionImpl
java.lang.Object
org.apache.bookkeeper.mledger.impl.AckSetPositionImpl
org.apache.pulsar.transaction.coordinator.impl.TxnBatchedPositionImpl
- All Implemented Interfaces:
Comparable<Position>,AckSetState,Position
The difference with
AckSetPositionImpl is that there are two more parameters:
batchSize, batchIndex.-
Field Summary
Fields inherited from class org.apache.bookkeeper.mledger.impl.AckSetPositionImpl
ackSet, entryId, ledgerId -
Constructor Summary
ConstructorsConstructorDescriptionTxnBatchedPositionImpl(long ledgerId, long entryId, int batchSize, int batchIndex) TxnBatchedPositionImpl(Position position, int batchSize, int batchIndex) -
Method Summary
Modifier and TypeMethodDescriptionintbooleanIt's exactly the same asPosition,make sure that whenTxnBatchedPositionImplused as the key of map same asPosition.inthashCode()It's exactly the same asPosition,make sure that whenTxnBatchedPositionImplused as the key of map same asPosition.voidBuild the attribute ackSet to thatbatchIndexis false and others is true.Methods inherited from class org.apache.bookkeeper.mledger.impl.AckSetPositionImpl
getAckSet, getEntryId, getExtension, getLedgerId, getNext, setAckSet, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.bookkeeper.mledger.impl.AckSetState
hasAckSetMethods inherited from interface org.apache.bookkeeper.mledger.Position
compareTo, getPositionAfterEntries, hasExtension, hashCodeForPosition
-
Constructor Details
-
TxnBatchedPositionImpl
public TxnBatchedPositionImpl(long ledgerId, long entryId, int batchSize, int batchIndex) -
TxnBatchedPositionImpl
-
-
Method Details
-
equals
It's exactly the same asPosition,make sure that whenTxnBatchedPositionImplused as the key of map same asPosition.batchSizeandbatchIndexshould not be involved in calculate, just like the includedAckSetPositionImpl.ackSetis not involved in calculate. Note: InConcurrentSkipListMap, it use theComparable.compareTo(Object)to determine whether the keys are the same. InHashMap, it use theObject.hashCode()&Object.equals(Object)to determine whether the keys are the same.- Overrides:
equalsin classAckSetPositionImpl
-
hashCode
public int hashCode()It's exactly the same asPosition,make sure that whenTxnBatchedPositionImplused as the key of map same asPosition.batchSizeandbatchIndexshould not be involved in calculate, just like the includedAckSetPositionImpl.ackSetis not involved in calculate. Note: InConcurrentSkipListMap, it use theComparable.compareTo(Object)to determine whether the keys are the same. InHashMap, it use theObject.hashCode()&Object.equals(Object)to determine whether the keys are the same.- Overrides:
hashCodein classAckSetPositionImpl
-
compareTo
It's exactly the same asPosition,to make sure that when compare to the "markDeletePosition", it looks likePosition.batchSizeandbatchIndexshould not be involved in calculate, just like the includedAckSetPositionImpl.ackSetis not involved in calculate. Note: InConcurrentSkipListMap, it use theComparable.compareTo(Object)to determine whether the keys are the same. InHashMap, it use theObject.hashCode()&Object.equals(Object)to determine whether the keys are the same. -
setAckSetByIndex
public void setAckSetByIndex()Build the attribute ackSet to thatbatchIndexis false and others is true.
-