Skip to content

Commit 6fb393f

Browse files
authored
Emit java method name to IDL/Snapshot to enable generating java stub … (#832)
1 parent 1ac01d8 commit 6fb393f

File tree

177 files changed

+3403
-532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+3403
-532
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ and what APIs have changed, if applicable.
1414

1515
## [Unreleased]
1616

17+
## [29.38.3] - 2022-09-07
18+
- Emit java method name in the IDL/Snapshot to enable us to generate a java stub back from the IDL.
19+
1720
## [29.38.2] - 2022-09-07
1821
- Removing the release candidate version number
1922

@@ -5331,7 +5334,8 @@ patch operations can re-use these classes for generating patch messages.
53315334

53325335
## [0.14.1]
53335336

5334-
[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.38.2...master
5337+
[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.38.3...master
5338+
[29.38.3]: https://github.com/linkedin/rest.li/compare/v29.38.2...v29.38.3
53355339
[29.38.2]: https://github.com/linkedin/rest.li/compare/v29.38.1-rc.1...v29.38.2
53365340
[29.38.1-rc.1]: https://github.com/linkedin/rest.li/compare/v29.38.0...v29.38.1-rc.1
53375341
[29.38.0]: https://github.com/linkedin/rest.li/compare/v29.37.19...v29.38.0

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=29.38.2
1+
version=29.38.3
22
group=com.linkedin.pegasus
33
org.gradle.configureondemand=true
44
org.gradle.parallel=true

restli-common/src/main/pegasus/com/linkedin/restli/restspec/ActionSchema.pdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ record ActionSchema includes CustomAnnotationSchema, ServiceErrorsSchema, Succes
1010
*/
1111
name: string
1212

13+
/**
14+
* Java method name for this rest method
15+
*/
16+
javaMethodName: optional string
17+
1318
/**
1419
* Java method type for this finder method
1520
*/

restli-common/src/main/pegasus/com/linkedin/restli/restspec/FinderSchema.pdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ record FinderSchema includes CustomAnnotationSchema, ServiceErrorsSchema, Succes
1010
*/
1111
name: optional string
1212

13+
/**
14+
* Java method name for this rest method
15+
*/
16+
javaMethodName: optional string
17+
1318
/**
1419
* Java method type for this finder method
1520
*/

restli-common/src/main/pegasus/com/linkedin/restli/restspec/RestMethodSchema.pdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ record RestMethodSchema includes CustomAnnotationSchema, ServiceErrorsSchema, Su
1010
*/
1111
method: string
1212

13+
/**
14+
* Java method name for this rest method
15+
*/
16+
javaMethodName: optional string
17+
1318
/**
1419
* Java method type for this rest method
1520
*/

restli-int-test-api/src/main/idl/com.linkedin.restli.examples.defaults.api.fillInDefaults.restspec.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,30 @@
1111
},
1212
"supports" : [ "batch_get", "get", "get_all" ],
1313
"methods" : [ {
14-
"method" : "get"
14+
"method" : "get",
15+
"javaMethodName" : "get",
16+
"javaMethodType" : "SYNC",
17+
"javaReturnsResultWrapper" : false
1518
}, {
16-
"method" : "batch_get"
19+
"method" : "batch_get",
20+
"javaMethodName" : "batchGet",
21+
"javaMethodType" : "SYNC",
22+
"javaReturnsResultWrapper" : false
1723
}, {
1824
"method" : "get_all",
25+
"javaMethodName" : "getAllHighLevelRecordWithDefault",
26+
"javaMethodType" : "SYNC",
27+
"javaReturnsResultWrapper" : true,
1928
"metadata" : {
2029
"type" : "com.linkedin.restli.examples.defaults.api.LowLevelRecordWithDefault"
2130
},
2231
"pagingSupported" : true
2332
} ],
2433
"finders" : [ {
2534
"name" : "findRecords",
35+
"javaMethodName" : "findRecords",
36+
"javaMethodType" : "SYNC",
37+
"javaReturnsResultWrapper" : true,
2638
"parameters" : [ {
2739
"name" : "noDefaultFieldA",
2840
"type" : "int"
@@ -33,6 +45,9 @@
3345
} ],
3446
"batchFinders" : [ {
3547
"name" : "searchRecords",
48+
"javaMethodName" : "searchRecords",
49+
"javaMethodType" : "SYNC",
50+
"javaReturnsResultWrapper" : true,
3651
"parameters" : [ {
3752
"name" : "criteria",
3853
"type" : "{ \"type\" : \"array\", \"items\" : \"com.linkedin.restli.examples.defaults.api.RecordCriteria\" }"
@@ -44,6 +59,9 @@
4459
} ],
4560
"actions" : [ {
4661
"name" : "defaultFillAction",
62+
"javaMethodName" : "takeAction",
63+
"javaMethodType" : "SYNC",
64+
"javaReturnsResultWrapper" : true,
4765
"parameters" : [ {
4866
"name" : "actionParam",
4967
"type" : "long"

restli-int-test-api/src/main/idl/com.linkedin.restli.examples.greetings.client.actions.restspec.json

Lines changed: 90 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,81 +6,135 @@
66
"actionsSet" : {
77
"actions" : [ {
88
"name" : "arrayPromise",
9+
"javaMethodName" : "arrayPromise",
10+
"javaMethodType" : "PROMISE",
11+
"javaReturnsResultWrapper" : false,
912
"returns" : "{ \"type\" : \"array\", \"items\" : \"int\" }"
1013
}, {
1114
"name" : "customTypeRef",
15+
"javaMethodName" : "customTypeRef",
16+
"javaMethodType" : "SYNC",
17+
"javaReturnsResultWrapper" : false,
1218
"parameters" : [ {
1319
"name" : "customLong",
1420
"type" : "com.linkedin.restli.examples.typeref.api.CustomLongRef"
1521
} ],
1622
"returns" : "com.linkedin.restli.examples.typeref.api.CustomLongRef"
1723
}, {
1824
"name" : "echo",
25+
"javaMethodName" : "echo",
26+
"javaMethodType" : "SYNC",
27+
"javaReturnsResultWrapper" : false,
1928
"parameters" : [ {
2029
"name" : "input",
2130
"type" : "string"
2231
} ],
2332
"returns" : "string"
2433
}, {
2534
"name" : "echoMessage",
35+
"javaMethodName" : "echoMessage",
36+
"javaMethodType" : "SYNC",
37+
"javaReturnsResultWrapper" : false,
2638
"parameters" : [ {
2739
"name" : "message",
2840
"type" : "com.linkedin.restli.examples.greetings.api.Message"
2941
} ],
3042
"returns" : "com.linkedin.restli.examples.greetings.api.Message"
3143
}, {
3244
"name" : "echoMessageArray",
45+
"javaMethodName" : "echoMessage",
46+
"javaMethodType" : "SYNC",
47+
"javaReturnsResultWrapper" : false,
3348
"parameters" : [ {
3449
"name" : "messages",
3550
"type" : "{ \"type\" : \"array\", \"items\" : \"com.linkedin.restli.examples.greetings.api.Message\" }"
3651
} ],
3752
"returns" : "{ \"type\" : \"array\", \"items\" : \"com.linkedin.restli.examples.greetings.api.Message\" }"
3853
}, {
3954
"name" : "echoStringArray",
55+
"javaMethodName" : "echoStringArray",
56+
"javaMethodType" : "SYNC",
57+
"javaReturnsResultWrapper" : false,
4058
"parameters" : [ {
4159
"name" : "strings",
4260
"type" : "{ \"type\" : \"array\", \"items\" : \"string\" }"
4361
} ],
4462
"returns" : "{ \"type\" : \"array\", \"items\" : \"string\" }"
4563
}, {
4664
"name" : "echoToneArray",
65+
"javaMethodName" : "echoToneArray",
66+
"javaMethodType" : "SYNC",
67+
"javaReturnsResultWrapper" : false,
4768
"parameters" : [ {
4869
"name" : "tones",
4970
"type" : "{ \"type\" : \"array\", \"items\" : \"com.linkedin.restli.examples.greetings.api.Tone\" }"
5071
} ],
5172
"returns" : "{ \"type\" : \"array\", \"items\" : \"com.linkedin.restli.examples.greetings.api.Tone\" }"
5273
}, {
5374
"name" : "failCallbackCall",
75+
"javaMethodName" : "failCall",
76+
"javaMethodType" : "ASYNC",
77+
"javaReturnsResultWrapper" : false,
5478
"doc" : "Action that fails by calling the callback"
5579
}, {
5680
"name" : "failCallbackThrow",
81+
"javaMethodName" : "failThrow",
82+
"javaMethodType" : "ASYNC",
83+
"javaReturnsResultWrapper" : false,
5784
"doc" : "Action that fails by throwing an exception"
5885
}, {
5986
"name" : "failPromiseCall",
87+
"javaMethodName" : "failPromiseCall",
88+
"javaMethodType" : "PROMISE",
89+
"javaReturnsResultWrapper" : false,
6090
"doc" : "Action that fails by calling SettablePromise.fail"
6191
}, {
6292
"name" : "failPromiseThrow",
93+
"javaMethodName" : "failPromiseThrow",
94+
"javaMethodType" : "PROMISE",
95+
"javaReturnsResultWrapper" : false,
6396
"doc" : "Action that fails by throwing an exception, returning a promise"
6497
}, {
6598
"name" : "failTaskCall",
99+
"javaMethodName" : "failTaskCall",
100+
"javaMethodType" : "TASK",
101+
"javaReturnsResultWrapper" : false,
66102
"doc" : "Action that fails by calling SettablePromise.fail promise in a task"
67103
}, {
68104
"name" : "failTaskThrow",
105+
"javaMethodName" : "failTaskThrow",
106+
"javaMethodType" : "TASK",
107+
"javaReturnsResultWrapper" : false,
69108
"doc" : "Action that fails by throwing an exception, returning a task"
70109
}, {
71110
"name" : "failThrowInTask",
111+
"javaMethodName" : "failThrowInTask",
112+
"javaMethodType" : "TASK",
113+
"javaReturnsResultWrapper" : false,
72114
"doc" : "Action that fails by throwing an exception in the task"
73115
}, {
74116
"name" : "get",
117+
"javaMethodName" : "get",
118+
"javaMethodType" : "SYNC",
119+
"javaReturnsResultWrapper" : false,
75120
"returns" : "string"
76121
}, {
77122
"name" : "nullPromise",
123+
"javaMethodName" : "nullPromise",
124+
"javaMethodType" : "PROMISE",
125+
"javaReturnsResultWrapper" : false,
78126
"returns" : "string"
79127
}, {
80128
"name" : "nullTask",
129+
"javaMethodName" : "nullTask",
130+
"javaMethodType" : "TASK",
131+
"javaReturnsResultWrapper" : false,
81132
"returns" : "string"
82133
}, {
83134
"name" : "parseq",
135+
"javaMethodName" : "parseqAction",
136+
"javaMethodType" : "PROMISE",
137+
"javaReturnsResultWrapper" : false,
84138
"doc" : "Performs three \"slow\" tasks and collects the results. This uses the passed context\n parameter to execute tasks. The position of the context argument is arbitrary.\nService Returns: Concatenation of binary representation of a, all caps of b, and string value\nof c",
85139
"parameters" : [ {
86140
"name" : "a",
@@ -95,6 +149,9 @@
95149
"returns" : "string"
96150
}, {
97151
"name" : "parseq3",
152+
"javaMethodName" : "parseqAction3",
153+
"javaMethodType" : "TASK",
154+
"javaReturnsResultWrapper" : false,
98155
"doc" : "Performs three \"slow\" tasks and collects the results. This returns a task and lets\n the RestLi server invoke it.\nService Returns: Concatenation of binary representation of a, all caps of b, and string value\nof c",
99156
"parameters" : [ {
100157
"name" : "a",
@@ -109,9 +166,15 @@
109166
"returns" : "string"
110167
}, {
111168
"name" : "returnBool",
169+
"javaMethodName" : "returnBool",
170+
"javaMethodType" : "SYNC",
171+
"javaReturnsResultWrapper" : false,
112172
"returns" : "boolean"
113173
}, {
114174
"name" : "returnBoolOptionalParam",
175+
"javaMethodName" : "returnBoolOptionalParam",
176+
"javaMethodType" : "SYNC",
177+
"javaReturnsResultWrapper" : false,
115178
"parameters" : [ {
116179
"name" : "param",
117180
"type" : "boolean",
@@ -120,19 +183,31 @@
120183
"returns" : "boolean"
121184
}, {
122185
"name" : "returnInt",
186+
"javaMethodName" : "returnPrimitive",
187+
"javaMethodType" : "SYNC",
188+
"javaReturnsResultWrapper" : false,
123189
"returns" : "int"
124190
}, {
125191
"name" : "returnIntOptionalParam",
192+
"javaMethodName" : "returnIntOptionalParam",
193+
"javaMethodType" : "SYNC",
194+
"javaReturnsResultWrapper" : false,
126195
"parameters" : [ {
127196
"name" : "param",
128197
"type" : "int",
129198
"optional" : true
130199
} ],
131200
"returns" : "int"
132201
}, {
133-
"name" : "returnVoid"
202+
"name" : "returnVoid",
203+
"javaMethodName" : "returnVoid",
204+
"javaMethodType" : "SYNC",
205+
"javaReturnsResultWrapper" : true
134206
}, {
135207
"name" : "taskCreationDelay",
208+
"javaMethodName" : "taskCreationDelay",
209+
"javaMethodType" : "TASK",
210+
"javaReturnsResultWrapper" : false,
136211
"doc" : "Simulates a delay in an asynchronous resource caused by ParSeq execution plan creation. The delay is simulated as\n {@link Thread#sleep(long)} because execution plan creation is a synchronous operation.\nService Returns: Nothing",
137212
"parameters" : [ {
138213
"name" : "delay",
@@ -141,18 +216,30 @@
141216
} ]
142217
}, {
143218
"name" : "taskExecutionDelay",
219+
"javaMethodName" : "taskExecutionDelay",
220+
"javaMethodType" : "TASK",
221+
"javaReturnsResultWrapper" : false,
144222
"doc" : "Simulates a delay in an asynchronous resource. The delay is simulated using a scheduled task (asynchronously).\n That is how a typical async resource looks like in terms of delays.\nService Returns: Nothing",
145223
"parameters" : [ {
146224
"name" : "delay",
147225
"type" : "int",
148226
"doc" : "the number of milliseconds it will take this resource to create an execution plan"
149227
} ]
150228
}, {
151-
"name" : "timeout"
229+
"name" : "timeout",
230+
"javaMethodName" : "timeout",
231+
"javaMethodType" : "PROMISE",
232+
"javaReturnsResultWrapper" : false
152233
}, {
153-
"name" : "timeoutCallback"
234+
"name" : "timeoutCallback",
235+
"javaMethodName" : "timeout",
236+
"javaMethodType" : "ASYNC",
237+
"javaReturnsResultWrapper" : false
154238
}, {
155239
"name" : "ultimateAnswer",
240+
"javaMethodName" : "testAction",
241+
"javaMethodType" : "SYNC",
242+
"javaReturnsResultWrapper" : false,
156243
"returns" : "int"
157244
} ]
158245
}

0 commit comments

Comments
 (0)