[ https://issues.apache.org/jira/browse/IGNITE-25479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexander Lapin updated IGNITE-25479: ------------------------------------- Description: h3. Motivation Current implementation of AssignmnetsQueue is a bit strange e.g. following test will fail with AssertionError {code:java} public void fooBar() { AssignmentsQueue originalAssignmentsQueue = new AssignmentsQueue(testAssignments(false, false)); originalAssignmentsQueue.poll(); originalAssignmentsQueue.poll(); } {code} which contradicts with common queue behaviour {code:java} /** * Retrieves and removes the head of this queue, * or returns {@code null} if this queue is empty. * * @return the head of this queue, or {@code null} if this queue is empty */ E poll(); {code} h3. Definition of Done * Refactor AssignmentsQueue in order to match common Queue contract. ** pull() and others should not through AssertionErrors. * Lack of assignments should be treated as empty queue instead of null AssignmentsQueue. > Rework AssignmentsQueue > ----------------------- > > Key: IGNITE-25479 > URL: https://issues.apache.org/jira/browse/IGNITE-25479 > Project: Ignite > Issue Type: Improvement > Reporter: Alexander Lapin > Priority: Major > Labels: ignite-3 > > h3. Motivation > Current implementation of AssignmnetsQueue is a bit strange e.g. following > test will fail with AssertionError > > {code:java} > public void fooBar() { > AssignmentsQueue originalAssignmentsQueue = new > AssignmentsQueue(testAssignments(false, false)); > originalAssignmentsQueue.poll(); > originalAssignmentsQueue.poll(); > } {code} > which contradicts with common queue behaviour > > > {code:java} > /** > * Retrieves and removes the head of this queue, > * or returns {@code null} if this queue is empty. > * > * @return the head of this queue, or {@code null} if this queue is empty > */ > E poll(); {code} > h3. Definition of Done > * Refactor AssignmentsQueue in order to match common Queue contract. > ** pull() and others should not through AssertionErrors. > * Lack of assignments should be treated as empty queue instead of null > AssignmentsQueue. > -- This message was sent by Atlassian Jira (v8.20.10#820010)