apache / accumulo

Apache Accumulo
https://accumulo.apache.org
Apache License 2.0
1.07k stars 445 forks source link

Improve TabletInformation.getLocation #4937

Closed keith-turner closed 1 month ago

keith-turner commented 1 month ago

Is your feature request related to a problem? Please describe.

TabletInformation.getLocation() returns an Optional<String>. However the javadoc does not explain what is in the string. Looking at the implementation the string seems to be of the form <location type>:<host>:<port>.

Describe the solution you'd like At the very least the javadoc should describe the contents of the string. However a specialized type would be better. Sigh, if only we could use records for this, this would be a great place to use a record to define a tuple the code is returning.

dlmarion commented 1 month ago

If / when #4851 is merged, you could use the ServerId class.

dlmarion commented 1 month ago

4851 has been merged, ServerId class is available now.

dlmarion commented 1 month ago

I updated the javadoc in #4967. I didn't create a new concrete type for it. The return value is only used in the ListTabletsCommand where the String is printed. If we created a concrete type for this that separated the parts, then we would have to concatenate them back together just to print them.