Skip to content

PHOENIX-6342 RoundRobinResultIterator doesn't close itself when resul… - #1114

Closed
stoty wants to merge 1 commit into
apache:masterfrom
stoty:PHOENIX-6342
Closed

PHOENIX-6342 RoundRobinResultIterator doesn't close itself when resul…#1114
stoty wants to merge 1 commit into
apache:masterfrom
stoty:PHOENIX-6342

Conversation

@stoty

Copy link
Copy Markdown
Contributor

…t size = fetchsize-1

index = (index + 1) % size;
}
}
close();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When RRIterator#peek() (next result) is null, we close the iterator. But if we don't get any next result after looping through all RRIterators, we should close() here, that's the plan right?
Although this looks good, curious if caller can implement the logic of calling RRResultIterator#close() if RRResultIterator#next() returns null. But if caller logic turns out to be more complicated, sure we should go this route I believe.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we already do have practice of closing iterators when next() exhausts all rows e.g ConcatResultIterator, LimitingResultIterator. I think we are good here.

@stotystotyJan 27, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When RRIterator#peek() (next result) is null, we close the iterator. But if we don't get any next result after looping through all RRIterators, we should close() here, that's the plan right?

Yes. When all iterators set numScannersCacheExhausted , and we're at the end, getIterators() will return an empty collection, and close() is skipped.

Although this looks good, curious if caller can implement the logic of calling RRResultIterator#close() if RRResultIterator#next() returns null. But if caller logic turns out to be more complicated, sure we should go this route I believe.

This is is the pattern everywhere in the code. This is also less error-prone, and encapsulates the logic within the class, I see no reason to change this, either.

@virajjasanivirajjasani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 (non-binding)

@stotystoty closed this Jan 27, 2021
@stoty

Copy link
Copy Markdown
ContributorAuthor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 34sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚mvninstall15m 51smaster passed
+0hbaserecompile22m 16sHBase recompiled.
+1 💚compile1m 3smaster passed
+1 💚checkstyle0m 34smaster passed
+1 💚javadoc0m 51smaster passed
+0 🆗spotbugs3m 2sphoenix-core in master has 955 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall8m 21sthe patch passed
+0hbaserecompile17m 47sHBase recompiled.
+1 💚compile1m 5sthe patch passed
+1 💚javac1m 5sthe patch passed
+1 💚checkstyle0m 35sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 51sthe patch passed
+1 💚spotbugs3m 9sthe patch passed
_ Other Tests _
-1 ❌unit111m 12sphoenix-core in the patch failed.
+1 💚asflicense0m 44sThe patch does not generate ASF License warnings.
163m 55s
ReasonTests
Failed junit testsphoenix.end2end.PermissionNSEnabledIT
phoenix.end2end.PermissionsCacheIT
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1114/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1114
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
unameLinux 9ea94fa310ed 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / ba47233
Default JavaPrivate Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1114/1/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1114/1/testReport/
Max. process+thread count12456 (vs. ulimit of 30000)
modulesC: phoenix-core U: phoenix-core
Console outputhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1114/1/console
versionsgit=2.7.4 maven=3.3.9 spotbugs=4.1.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@stoty
stoty deleted the PHOENIX-6342 branch July 29, 2021 14:22
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@stoty@virajjasani