Commit 88b2b2f
authored
use configurable logger instead of slf4j logger everywhere. (Azure#21076)
- use configurable logger instead of slf4j logger everywhere in the spark connector layer (doesn't touch the SDK).
- wired up per request operation/response (for query, and write operations) against spark diagnostics.
please look at these classes for starting to review:
DiagnosticsProvider.scala
SparkTaskContext.scala
PointWriter
For point writes when diagnostics enabled we will get something as follows:
```
21/06/01 11:18:21 INFO PointWriter: SparkTaskContext(correlationActivityId=abc7c1bc-1d3d-456b-bd43-27f63419f3c8,stageId=0,partitionId=0,details=), response: response{statusCode:200, headers{activityId:befce693-c305-11eb-a373-b51dba521584}}
21/06/01 11:18:21 INFO PointWriter: UpsertOperation(SparkTaskContext(correlationActivityId=abc7c1bc-1d3d-456b-bd43-27f63419f3c8,stageId=0,partitionId=0,details=PointWriter),CosmosItemIdentifier(bat,["bat"])) completed
21/06/01 11:18:21 INFO PointWriter: SparkTaskContext(correlationActivityId=abc7c1bc-1d3d-456b-bd43-27f63419f3c8,stageId=0,partitionId=0,details=), response: response{statusCode:200, headers{activityId:befd82d4-c305-11eb-a373-b51dba521584}}
21/06/01 11:18:21 INFO PointWriter: UpsertOperation(SparkTaskContext(correlationActivityId=abc7c1bc-1d3d-456b-bd43-27f63419f3c8,stageId=0,partitionId=0,details=PointWriter),CosmosItemIdentifier(mouse,["mouse"])) completed
21/06/01 11:18:21 INFO PointWriter: SparkTaskContext(correlationActivityId=abc7c1bc-1d3d-456b-bd43-27f63419f3c8,stageId=0,partitionId=0,details=), response: response{statusCode:200, headers{activityId:befda9e5-c305-11eb-a373-b51dba521584}}
21/06/01 11:18:21 INFO PointWriter: UpsertOperation(SparkTaskContext(correlationActivityId=abc7c1bc-1d3d-456b-bd43-27f63419f3c8,stageId=0,partitionId=0,details=PointWriter),CosmosItemIdentifier(horse,["horse"])) completed
```
for bulk write when diagnostics enabled we get something like following.
```
21/06/01 11:13:59 INFO BulkWriter: SparkTaskContext(correlationActivityId=1fe6232b-809c-4e2b-98eb-c10708656300,stageId=0,partitionId=0,details=), request: request{operationType:Batch, resourceType:Document, partitionKey:null, resourceAddress:dbs/testDB/colls/testContainer, headers{activityId:22f471f7-c305-11eb-98b7-f93f10f7d1fe, items:3}}
21/06/01 11:13:59 INFO BulkWriter: SparkTaskContext(correlationActivityId=1fe6232b-809c-4e2b-98eb-c10708656300,stageId=0,partitionId=0,details=), response: response{statusCode:200, headers{activityId:22f471f7-c305-11eb-98b7-f93f10f7d1fe, itemCount:3, continuationToken:null}}
```
similar to point write, if we agree on the design I can add the per item details to bulk as1 parent c4905e7 commit 88b2b2f
File tree
61 files changed
+1027
-352
lines changed- sdk/cosmos
- azure-cosmos-spark_3-1_2-12/src
- main/scala/com/azure/cosmos
- implementation
- spark
- diagnostics
- test/scala
- com/azure/cosmos/spark
- org/apache/spark
- azure-cosmos/src
- main/java/com/azure/cosmos
- implementation
- batch
- models
- test/java/com/azure/cosmos
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
61 files changed
+1027
-352
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
Lines changed: 59 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | | - | |
8 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
| 19 | + | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
| 24 | + | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | | - | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
65 | 97 | | |
66 | 98 | | |
67 | | - | |
| 99 | + | |
68 | 100 | | |
69 | 101 | | |
70 | 102 | | |
| |||
78 | 110 | | |
79 | 111 | | |
80 | 112 | | |
81 | | - | |
| 113 | + | |
82 | 114 | | |
83 | | - | |
| 115 | + | |
84 | 116 | | |
85 | 117 | | |
86 | 118 | | |
87 | 119 | | |
88 | 120 | | |
89 | | - | |
| 121 | + | |
90 | 122 | | |
91 | 123 | | |
92 | 124 | | |
| |||
102 | 134 | | |
103 | 135 | | |
104 | 136 | | |
105 | | - | |
| 137 | + | |
106 | 138 | | |
107 | 139 | | |
108 | 140 | | |
109 | 141 | | |
110 | 142 | | |
111 | 143 | | |
112 | 144 | | |
113 | | - | |
| 145 | + | |
114 | 146 | | |
115 | 147 | | |
116 | 148 | | |
| |||
131 | 163 | | |
132 | 164 | | |
133 | 165 | | |
134 | | - | |
| 166 | + | |
135 | 167 | | |
136 | 168 | | |
137 | 169 | | |
| |||
150 | 182 | | |
151 | 183 | | |
152 | 184 | | |
153 | | - | |
| 185 | + | |
154 | 186 | | |
155 | 187 | | |
156 | 188 | | |
157 | 189 | | |
158 | 190 | | |
159 | | - | |
| 191 | + | |
160 | 192 | | |
161 | 193 | | |
162 | 194 | | |
163 | 195 | | |
164 | 196 | | |
165 | 197 | | |
166 | 198 | | |
167 | | - | |
| 199 | + | |
168 | 200 | | |
169 | 201 | | |
170 | 202 | | |
| |||
202 | 234 | | |
203 | 235 | | |
204 | 236 | | |
205 | | - | |
| 237 | + | |
206 | 238 | | |
207 | | - | |
| 239 | + | |
208 | 240 | | |
209 | 241 | | |
210 | 242 | | |
| |||
218 | 250 | | |
219 | 251 | | |
220 | 252 | | |
221 | | - | |
| 253 | + | |
222 | 254 | | |
223 | 255 | | |
224 | 256 | | |
225 | 257 | | |
226 | 258 | | |
227 | | - | |
| 259 | + | |
228 | 260 | | |
229 | 261 | | |
230 | 262 | | |
231 | 263 | | |
232 | 264 | | |
233 | 265 | | |
234 | 266 | | |
235 | | - | |
| 267 | + | |
236 | 268 | | |
237 | 269 | | |
238 | 270 | | |
| |||
253 | 285 | | |
254 | 286 | | |
255 | 287 | | |
256 | | - | |
| 288 | + | |
257 | 289 | | |
258 | 290 | | |
259 | 291 | | |
| |||
264 | 296 | | |
265 | 297 | | |
266 | 298 | | |
267 | | - | |
| 299 | + | |
268 | 300 | | |
269 | 301 | | |
270 | 302 | | |
| |||
sdk/cosmos/azure-cosmos-spark_3-1_2-12/src/main/scala/com/azure/cosmos/spark/ChangeFeedBatch.scala
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | | - | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | | - | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
69 | | - | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | | - | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
Lines changed: 20 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | | - | |
27 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | | - | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
69 | | - | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | | - | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| |||
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
95 | | - | |
96 | | - | |
| 98 | + | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
| |||
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
116 | | - | |
| 119 | + | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
| |||
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
133 | | - | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | | - | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
168 | | - | |
| 171 | + | |
169 | 172 | | |
170 | 173 | | |
171 | 174 | | |
| |||
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
197 | | - | |
| 200 | + | |
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
| |||
203 | 206 | | |
204 | 207 | | |
205 | 208 | | |
206 | | - | |
| 209 | + | |
207 | 210 | | |
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
211 | 214 | | |
212 | 215 | | |
213 | | - | |
| 216 | + | |
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
0 commit comments