Skip to content

Removed TabletIteratorEnvironment, replaced with smaller impl #5587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 5, 2025

Conversation

dlmarion
Copy link
Contributor

In #5490 we created a ClientIteratorEnvironment builder and class. As part of that change we added a constructor to TabletIteratorEnvironment for use in testing. Issue #5503 was created to subsequently remove that constructor. This change removes TabletIteratorEnvironment entirely and replaces it with a subclass of ClientIteratorEnvironment.

Closes #5503

In apache#5490 we created a ClientIteratorEnvironment builder and class.
As part of that change we added a constructor to TabletIteratorEnvironment
for use in testing. Issue apache#5503 was created to subsequently
remove that constructor. This change removes TabletIteratorEnvironment
entirely and replaces it with a subclass of ClientIteratorEnvironment.

Closes apache#5503
@dlmarion dlmarion added this to the 2.1.4 milestone May 28, 2025
@dlmarion dlmarion requested a review from keith-turner May 28, 2025 21:14
@dlmarion dlmarion self-assigned this May 28, 2025
@dlmarion dlmarion linked an issue May 28, 2025 that may be closed by this pull request
Copy link
Member

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

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

I think the main concern I would have for these is whether or not they affect the public API or SPI. It does not appear that this change affects either. It's just an internal impl change. So, I think this change should be fine.

@dlmarion
Copy link
Contributor Author

Full IT build successful


@Override
public boolean isFullMajorCompaction() {
if (getIteratorScope() != IteratorScope.majc) {
Copy link
Contributor

Choose a reason for hiding this comment

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

could this check be pushed to the super class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used super class method in 744c9e7


@Override
public boolean isUserCompaction() {
if (getIteratorScope() != IteratorScope.majc) {
Copy link
Contributor

Choose a reason for hiding this comment

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

could this check be pushed to the super class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the parent class this checks that the scope is scan for some reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I remove this, then IteratorEnvIT fails at line 165. I' not sure why ClientIteratorEnvironment.isUserCompaction is checking for scope == scan. I'm going to look into this further as that would fix this issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I resolved the disparity. In the client context, this throws an exception if the scope is scan. In the server context, this throws an exception if the scope is minc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used super class method in 744c9e7

Comment on lines 107 to 114
@Override
public boolean isSamplingEnabled() {
if (getSamplerConfiguration() == null) {
return false;
} else {
return true;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Sample config could be present w/o sampling being enabled. Seems like this should just return if the boolean is set in the super class that indicates sampling is enabled.

Suggested change
@Override
public boolean isSamplingEnabled() {
if (getSamplerConfiguration() == null) {
return false;
} else {
return true;
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed method in SystemIteratorEnvironmentImpl in bf54f5d


@Deprecated(since = "2.0.0")
@Override
public AccumuloConfiguration getConfig() {
Copy link
Contributor

Choose a reason for hiding this comment

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

There will be a different configuration object impl returned for this methiod now that could have slightly different behavior. Not sure if this would ever matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I can tell, all of the places where this was used, it's based off Context.getTableConfiguration(TableId).

@dlmarion
Copy link
Contributor Author

dlmarion commented Jun 4, 2025

Full IT build successful after the latest round of changes.

@dlmarion dlmarion merged commit b3aed75 into apache:2.1 Jun 5, 2025
8 checks passed
@dlmarion dlmarion deleted the 5503-tablet-iter-ctor branch June 5, 2025 12:29
dlmarion added a commit to dlmarion/accumulo that referenced this pull request Jun 9, 2025
SystemIteratorEnvironmentImpl was added in apache#5587, but did not implement
the isRunningLowOnMemory method. It deferred to its parent class
implementation, ClientIteratorEnvironment.isRunningLowOnMemory, which
just returns false.
dlmarion added a commit that referenced this pull request Jun 10, 2025
…ory (#5624)

SystemIteratorEnvironmentImpl was added in #5587, but did not implement
the isRunningLowOnMemory method. It deferred to its parent class
implementation, ClientIteratorEnvironment.isRunningLowOnMemory, which
just returns false.
Sign up for free to 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.

Reconsider TabletEnvironmentIterator constructor
3 participants