-
Notifications
You must be signed in to change notification settings - Fork 263
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
Add multiple endpoint listener for fluss server. #531
Conversation
3390a81
to
3321cac
Compare
3321cac
to
a1662d1
Compare
@wuchong , rebase and refactor this pr, CC |
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.
- Please update
server.yaml
as well. - Please create an issue to update
local_cluster.sh
to adapt the config changes. - Please create an issue to update all the documentation.
- Validate the configs, e.g, all listener names are not duplicated, ports are not duplicated. All the listener names in
advertised.listeners
andinternal.listener.name
can be found inbind.listeners
? Take Kafkakafka.utils.CoreUtils.listenerListToEndPoints
as an example, and add tests.
fluss-server/src/test/java/com/alibaba/fluss/server/testutils/FlussClusterExtension.java
Outdated
Show resolved
Hide resolved
fluss-server/src/test/java/com/alibaba/fluss/server/testutils/FlussClusterExtension.java
Outdated
Show resolved
Hide resolved
fluss-common/src/test/java/com/alibaba/fluss/config/EndPointTest.java
Outdated
Show resolved
Hide resolved
fluss-server/src/test/java/com/alibaba/fluss/server/testutils/FlussClusterExtension.java
Outdated
Show resolved
Hide resolved
fluss-server/src/test/java/com/alibaba/fluss/server/testutils/FlussClusterExtension.java
Outdated
Show resolved
Hide resolved
fluss-common/src/test/java/com/alibaba/fluss/config/EndPointTest.java
Outdated
Show resolved
Hide resolved
fluss-server/src/test/java/com/alibaba/fluss/server/coordinator/CoordinatorServerTest.java
Outdated
Show resolved
Hide resolved
fluss-server/src/test/java/com/alibaba/fluss/server/tablet/TabletServerTest.java
Outdated
Show resolved
Hide resolved
pbCoordinatorServer.getNodeId(), | ||
pbCoordinatorServer.getHost(), | ||
pbCoordinatorServer.getPort(), | ||
Endpoint.parseEndpoints(pbCoordinatorServer.getListeners()), |
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.
to support compatible with old version (host & prot).
and add UT for the compatibility test (similar to com.alibaba.fluss.server.coordinator.TableManagerITCase#testMetadata
)
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.
Add com.alibaba.fluss.server.coordinator.TableManagerITCase#testMetadataCompatibility
fluss-rpc/src/test/java/com/alibaba/fluss/rpc/netty/client/NettyClientTest.java
Outdated
Show resolved
Hide resolved
349a666
to
6a37208
Compare
6a37208
to
6b61950
Compare
|
package com.alibaba.fluss.exception; | ||
|
||
/** Exception thrown when the endpoint is not available. */ | ||
public class EndpointNotAvailableException extends ApiException { |
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 is only used in the server, so doesn't need to be an ApiException
. Move it to com.alibaba.fluss.server.exception
. Besides, ApiException
strips the exception stack, which is very inconvenient to debug. Here it should extend RuntimeException
.
return Objects.hash(host, port, listenerName); | ||
} | ||
|
||
public String connectionString() { |
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.
listenerString
to keep align with toListenersString
, fromListenersString
.
* limitations under the License. | ||
*/ | ||
|
||
package cluster; |
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.
wrong package
@@ -621,8 +670,24 @@ public Builder setClusterConf(Configuration clusterConf) { | |||
return this; | |||
} | |||
|
|||
/** Sets the listeners of tablet servers. */ | |||
public Builder setTabletServerListeners(String tabletServerListeners) { |
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.
Good refactor!
required int32 port = 3; | ||
// host and port is used for client. | ||
optional string host = 2; | ||
optional int32 port = 3; |
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.
we can't change required
to optional
as it breaks compatibility, new version server sent events to the old version server, the events will be failed to deserialize on the old version server.
I pushed a commit to fix the remaining minor comments. |
@loserwang1024 I'm going to merge it. If there are any problems, we can fix in the following PRs. |
Purpose
Linked issue: close #421 , add multiple endpoint listener for fluss server.
Brief change log
Deprecated config:
Added config
Tests
API and Format
Documentation