Class TxnBatchedPositionImpl
java.lang.Object
org.apache.bookkeeper.mledger.impl.PositionImpl
org.apache.pulsar.transaction.coordinator.impl.TxnBatchedPositionImpl
- All Implemented Interfaces:
Comparable<org.apache.bookkeeper.mledger.impl.PositionImpl>,org.apache.bookkeeper.mledger.Position
public class TxnBatchedPositionImpl
extends org.apache.bookkeeper.mledger.impl.PositionImpl
The difference with
PositionImpl is that there are two more parameters:
batchSize, batchIndex.-
Field Summary
Fields inherited from class org.apache.bookkeeper.mledger.impl.PositionImpl
ackSet, EARLIEST, entryId, LATEST, ledgerId -
Constructor Summary
ConstructorsConstructorDescriptionTxnBatchedPositionImpl(long ledgerId, long entryId, int batchSize, int batchIndex) TxnBatchedPositionImpl(org.apache.bookkeeper.mledger.Position position, int batchSize, int batchIndex) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(org.apache.bookkeeper.mledger.impl.PositionImpl that) It's exactly the same asPositionImpl,to make sure that when compare to the "markDeletePosition", it looks likePositionImpl.booleanIt's exactly the same asPositionImpl,make sure that whenTxnBatchedPositionImplused as the key of map same asPositionImpl.inthashCode()It's exactly the same asPositionImpl,make sure that whenTxnBatchedPositionImplused as the key of map same asPositionImpl.voidBuild the attribute ackSet to thatbatchIndexis false and others is true.Methods inherited from class org.apache.bookkeeper.mledger.impl.PositionImpl
compareTo, get, get, get, getAckSet, getEntryId, getLedgerId, getNext, getPositionInfo, hasAckSet, setAckSet, toString
-
Constructor Details
-
TxnBatchedPositionImpl
public TxnBatchedPositionImpl(long ledgerId, long entryId, int batchSize, int batchIndex) -
TxnBatchedPositionImpl
public TxnBatchedPositionImpl(org.apache.bookkeeper.mledger.Position position, int batchSize, int batchIndex)
-
-
Method Details
-
equals
It's exactly the same asPositionImpl,make sure that whenTxnBatchedPositionImplused as the key of map same asPositionImpl.batchSizeandbatchIndexshould not be involved in calculate, just likePositionImpl.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 classorg.apache.bookkeeper.mledger.impl.PositionImpl
-
hashCode
public int hashCode()It's exactly the same asPositionImpl,make sure that whenTxnBatchedPositionImplused as the key of map same asPositionImpl.batchSizeandbatchIndexshould not be involved in calculate, just likePositionImpl.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 classorg.apache.bookkeeper.mledger.impl.PositionImpl
-
compareTo
public int compareTo(org.apache.bookkeeper.mledger.impl.PositionImpl that) It's exactly the same asPositionImpl,to make sure that when compare to the "markDeletePosition", it looks likePositionImpl.batchSizeandbatchIndexshould not be involved in calculate, just likePositionImpl.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.- Specified by:
compareToin interfaceComparable<org.apache.bookkeeper.mledger.impl.PositionImpl>- Overrides:
compareToin classorg.apache.bookkeeper.mledger.impl.PositionImpl
-
setAckSetByIndex
public void setAckSetByIndex()Build the attribute ackSet to thatbatchIndexis false and others is true.
-