Skip to content

Commit

Permalink
fix: now reserves first tuple correctly; fixed some typos
Browse files Browse the repository at this point in the history
Signed-off-by: Alwin Zomotor <[email protected]>
  • Loading branch information
CRAlwin committed Aug 30, 2024
1 parent 4372482 commit 9eb7718
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,12 @@ ArrayList<TupleChunkFragmentEntity> lockAndRetrieveReservedTuplesForConsumption(
+ TUPLE_CHUNK_ID_COLUMN
+ " = :tupleChunkId AND "
+ START_INDEX_COLUMN
+ " = :startIdx RETURNING "
+ " <= :startIdx AND "
+ END_INDEX_COLUMN
+ " > :startIdx RETURNING "
+ RESERVATION_ID_COLUMN,
nativeQuery = true)
String lockFirstTupleReturningReservatioId(
String lockFirstFragmentReturningReservationId(
@Param("tupleChunkId") UUID tupleChunkId, @Param("startIdx") long startIdx);

@Transactional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public ArrayList<TupleChunkFragmentEntity> lockReservedFragments(String reservat
public int lockReservedFragmentsWithoutRetrieving(
UUID tupleChunkId, long startIdx, String reservationId) {
String deletedId =
fragmentRepository.lockFirstTupleReturningReservatioId(tupleChunkId, startIdx);
fragmentRepository.lockFirstFragmentReturningReservationId(tupleChunkId, startIdx);
if (deletedId != null && deletedId.equals(reservationId))
return 1 + fragmentRepository.lockRemainingTuplesWithoutRetrieving(reservationId);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void testComposing() {
Answer mocklockFirstTupleReturningReservationId =
(Answer)
invocation -> {
return tupleChunkFragmentRepository.lockFirstTupleReturningReservatioId(
return tupleChunkFragmentRepository.lockFirstFragmentReturningReservationId(
invocation.getArgument(0, UUID.class), invocation.getArgument(1, Long.class));
};

Expand Down

0 comments on commit 9eb7718

Please sign in to comment.