-
Notifications
You must be signed in to change notification settings - Fork 114
feat (thrift deprecation)!: replace thrift entities with internal ones #1022
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
base: master
Are you sure you want to change the base?
Conversation
f240cbb
to
c7070b3
Compare
Signed-off-by: Shijie Sheng <[email protected]>
|
||
if (response.getExecutionsSize() < listRequest.getMaximumPageSize()) { | ||
int neededPageSize = listRequest.getMaximumPageSize() - response.getExecutionsSize(); | ||
if (response.getExecutions().size() < listRequest.getMaximumPageSize()) { |
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.
if getExecutions() returns null this would cause a NPE. Not sure if that's actually possible based on the mapper and how protos behave.
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.
addressed similar cases with default initialization in the generated entity. For example,
@data
class SomeEntity {
List<String> SomeList = new ArrayList<>();
}
import org.apache.thrift.TException; | ||
import org.apache.thrift.async.AsyncMethodCallback; | ||
|
||
public interface IWorkflowService extends Iface, AsyncIface { |
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.
Let's remove IFace and AsyncIface. I think IWorkflowService works well enough as the main interface and none of our code refers to either of these explicitly. It's unlikely that user code does as well.
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.
removed
CadenceError; | ||
} | ||
|
||
interface AsyncIface { |
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.
Can we remove any of the methods in AsyncIface that were never implemented? I recall there being a bunch that will just throw an exception. Users are unlikely to be calling them since they never worked in the first place.
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.
Huh it turns out they're pretty much all implemented in gRPC. I guess our gRPC support was more thorough than Thrift.
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.
Yeah, I'll just leave it unchanged.
return nullFields; | ||
} | ||
|
||
public static <E extends Enum<E> & TFieldIdEnum, M extends TBase<M, E>> void assertMissingFields( |
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 should be able to remove the thrift functions from here.
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.
removed all thrift related stuff
RequestMapper::registerDomainRequest, | ||
"emitMetric"), // Thrift has this field but proto doens't have it | ||
RequestMapper | ||
::registerDomainRequest), // Thrift has this field but proto doens't have it |
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.
Nit: Either the comment was incorrect or something weird is going on. Something should be changed here (maybe we just need to remove the comment).
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.
I've removed the comment
compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2' | ||
compile group: 'com.auth0', name: 'java-jwt', version:'3.10.2' | ||
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.21.9' | ||
compile group: 'com.google.api.grpc', name: 'proto-google-common-protos', version: '2.10.0' |
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.
I can't comment on the specific line (github won't let me), but we should remove the tchannel and libthrift dependencies that are above here.
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.
Also fine if that's a followup PR to remove the lingering references. It seems like thrift library types are still used here and there.
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.
I've cleaned up all thrift related logic.
What changed?
Migration Guide
new WorkflowServiceGrpc()
instead ofnew Thrift2ProtoAdapter(IGrpcServiceStubs.newInstance())
;TException
and now all workflow service method returnsCadenceError
instead;Why?
Java thrift deprecation
How did you test it?
Unit Test
Potential risks
Release notes
Documentation Changes