Skip to content
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

Eliminate duplicate random suffix generation code #15015

Merged
merged 5 commits into from
Nov 16, 2022

Conversation

findepi
Copy link
Member

@findepi findepi commented Nov 14, 2022

No description provided.

Remove the `min(... random number.length())`.
This is more a style fix, but also makes the code less error-prone (what
happens if RANDOM_SUFFIX_LENGTH is changed to a big value? nothinng).
@findepi findepi added the no-release-notes This pull request does not require release notes entry label Nov 14, 2022
@cla-bot cla-bot bot added the cla-signed label Nov 14, 2022
Comment on lines -27 to -28
private static final SecureRandom random = new SecureRandom();
private static final int RANDOM_SUFFIX_LENGTH = 12;
Copy link
Member

Choose a reason for hiding this comment

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

I wonder how much time were we wasting here. 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

the new impl is for sure slower

Comment on lines +157 to +162
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-testing-services</artifactId>
<scope>test</scope>
</dependency>

Copy link
Member

Choose a reason for hiding this comment

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

The move to trino-testing-services is for the product tests - correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@findepi findepi merged commit 4e41df9 into trinodb:master Nov 16, 2022
@findepi findepi deleted the findepi/random-names branch November 16, 2022 16:28
@github-actions github-actions bot added this to the 404 milestone Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed no-release-notes This pull request does not require release notes entry ready to merge
Development

Successfully merging this pull request may close these issues.

2 participants