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

RATIS-1116. Add DataStreamType. #238

Merged
merged 2 commits into from Oct 29, 2020
Merged

RATIS-1116. Add DataStreamType. #238

merged 2 commits into from Oct 29, 2020

Conversation

szetszwo
Copy link
Contributor

@szetszwo
Copy link
Contributor Author

I also took this chance to split the newFactory method into newClientFactory and newServerFactory so that the client factory for DISABLE can be moved to the ratis-client module.

.newDataStreamServerRpc(server, stateMachine, properties);
}

public DataStreamServerImpl(RaftServer server, StateMachine stateMachine,
RaftProperties properties, Parameters parameters){
final SupportedDataStreamType type = RaftConfigKeys.DataStream.type(properties, LOG::info);

this.serverRpc = DataStreamServerFactory.cast(type.newFactory(parameters))
this.serverRpc = DataStreamServerFactory.cast(type.newClientFactory(parameters))
Copy link
Contributor

Choose a reason for hiding this comment

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

newClientFactory -> newServerFactory ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. It should be newServerFactory.

Copy link
Contributor

@runzhiwang runzhiwang left a comment

Choose a reason for hiding this comment

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

LGTM

@runzhiwang runzhiwang merged commit af35841 into apache:master Oct 29, 2020
@runzhiwang
Copy link
Contributor

@szetszwo Thanks the patch. I have merged it.

@@ -41,7 +42,8 @@ public void testDataStreamDisabled() throws Exception {
setupServer();
setupClient();
exception.expect(UnsupportedOperationException.class);
exception.expectMessage("org.apache.ratis.server.impl.DisabledDataStreamFactory$1 does not support streamAsync");
exception.expectMessage(DisabledDataStreamClientFactory.class.getName()
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 this is a better test.

symious pushed a commit to symious/ratis that referenced this pull request Feb 7, 2024
* RATIS-1116. Add DataStreamType.

* Fix a bug and change the cast(..) method to newInstance(..).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants