-
Notifications
You must be signed in to change notification settings - Fork 471
Use ServerId to represent a server address #5875
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
Draft
dlmarion
wants to merge
14
commits into
apache:main
Choose a base branch
from
dlmarion:5648-cached-transport-optimization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a0172de
Use ServerId to represent a server address
dlmarion 0a358b3
Update ITs
dlmarion 4039d38
Merge branch 'main' into 5648-cached-transport-optimization
dlmarion dad2c16
Add resource group to zk path and wal file name
dlmarion 2ca5f4e
Merge branch 'main' into 5648-cached-transport-optimization
dlmarion 7f11006
Removed HostAndPort from ServerId public API
dlmarion 9f76bdf
Merge branch 'main' into 5648-cached-transport-optimization
dlmarion fb6acbb
Created ServerIdUtil
dlmarion e342779
Fixed some ITs, handle older server wal file name serializations
dlmarion eb9f0df
Fixed SuspendedTabletsIT
dlmarion 345dc62
Merge branch 'main' into 5648-cached-transport-optimization
dlmarion c550f28
Merge branch 'main' into 5648-cached-transport-optimization
dlmarion 20ad0e6
Fix AdvertiseAndBindIT
dlmarion 007b2dd
Update ManagerApiIT to make clear TServerInstance is expected
dlmarion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,24 +23,26 @@ | |
| import java.util.HashSet; | ||
| import java.util.Set; | ||
|
|
||
| import org.apache.accumulo.core.client.admin.servers.ServerId; | ||
|
|
||
| /** | ||
| * @since 1.5.0 | ||
| */ | ||
| public class TimedOutException extends RuntimeException { | ||
|
|
||
| private final HashSet<String> timedoutServers = new HashSet<>(); | ||
| private final HashSet<ServerId> timedoutServers = new HashSet<>(); | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| private static String shorten(Set<String> set) { | ||
| private static String shorten(Set<ServerId> set) { | ||
| if (set.size() < 10) { | ||
| return set.toString(); | ||
| } | ||
|
|
||
| return new ArrayList<>(set).subList(0, 10) + " ... " + (set.size() - 10) + " servers not shown"; | ||
| } | ||
|
|
||
| public TimedOutException(Set<String> timedoutServers) { | ||
| public TimedOutException(Set<ServerId> timedoutServers) { | ||
| super("Servers timed out " + shorten(timedoutServers)); | ||
| this.timedoutServers.addAll(timedoutServers); | ||
|
|
||
|
|
@@ -50,7 +52,7 @@ public TimedOutException(String msg) { | |
| super(msg); | ||
| } | ||
|
|
||
| public Set<String> getTimedOutSevers() { | ||
| public Set<ServerId> getTimedOutSevers() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could leave this as string since this is a public API method |
||
| return Collections.unmodifiableSet(timedoutServers); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| import org.apache.accumulo.core.client.admin.servers.ServerId; | ||
| import org.apache.accumulo.core.data.Range; | ||
| import org.apache.accumulo.core.data.TabletId; | ||
|
|
||
|
|
@@ -50,5 +51,5 @@ public interface Locations { | |
| * | ||
| * @return A tablet server location in the form of {@code <host>:<port>} | ||
| */ | ||
| String getTabletLocation(TabletId tabletId); | ||
| ServerId getTabletLocation(TabletId tabletId); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could leave this as string also since its public API |
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is public API. Its in a dark corner of the API, could change it. May be easiest to just leave itas string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, my concern about leaving these types of things as String, is that there is not enough information to reconstitute a ServerId in the event that it's needed.