Skip to content

Removing Custom...Server.java classes and replacing with Thrift implementation#6454

Open
Amemeda wants to merge 7 commits into
apache:mainfrom
Amemeda:cleanup
Open

Removing Custom...Server.java classes and replacing with Thrift implementation#6454
Amemeda wants to merge 7 commits into
apache:mainfrom
Amemeda:cleanup

Conversation

@Amemeda

@Amemeda Amemeda commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Investigated relevance of CustomThreadedSelectorServer.java

  • This file overrides getRunnable method from TThreadedSelectorServer.java.
  • CustomThreadedSelectorServer.java had only 1 usage in TServerUtils.java: return new ServerAddress(new CustomThreadedSelectorServer(options), address);

Result:

  • Deleted file CustomThreadedSelectorServer.java
  • replaced its 1 usage with TThreadedSelectorServer.java
  • Added file ThriftServerEventHandler.java
  • in TServerUtils.java, implementing method setServerEventHandler(new ThriftServerEventHandler()); to applicable tservers

@Amemeda Amemeda marked this pull request as ready for review June 30, 2026 16:03
@Amemeda

Amemeda commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@ctubbsii

@DomGarguilo DomGarguilo added this to the 4.0.0 milestone Jun 30, 2026
@DomGarguilo DomGarguilo requested a review from ctubbsii June 30, 2026 21:04
@Amemeda Amemeda requested a review from dlmarion July 8, 2026 16:23

@Override
public <T> T unwrap(Class<T> iface) {
return null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should throw an UnsupportedOperationException here. According to the ServerContext javadoc, this is the correct action.

https://github.com/apache/thrift/blob/master/lib/java/src/main/java/org/apache/thrift/server/ServerContext.java#L35

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This still needs to be done I think

}

return new ServerAddress(new CustomNonBlockingServer(options), address);
CustomNonBlockingServer server = new CustomNonBlockingServer(options);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It appears the CustomNonBlockingServer is also custom solely to get the client address. We might be able to remove this as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ive removed that one, I think that's all the custom server classes. The only remaining custom classes I see are CustomObjectMapper and CustomHsHaNestedIT

@Amemeda Amemeda changed the title Removing CustomThreadedSelectorServer.java Removing Custom...Server.java classes and replacing with Thrift implementation Jul 9, 2026
@Amemeda Amemeda requested a review from dlmarion July 10, 2026 14:19
TThreadPoolServer.Args options = new TThreadPoolServer.Args(transport);
options.protocolFactory(protocolFactory);
options.transportFactory(transportFactory);
options.processorFactory(new ClientInfoProcessorFactory(clientAddress, processor));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure that this is needed anymore (the method call and the ClientInfoProcessorFactory class). Look at other calls to 'processorFactory' to see how they are used in this class.


@Override
public <T> T unwrap(Class<T> iface) {
return null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This still needs to be done I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants