Commit 1b2b295
Update microsoft-365 source pagination logic to not skip time range (#5979)
**Description**
This commit updates microsoft-365 source pagination to not skip
events in certain cases.
PaginationCrawler saves Item lastModifiedAt as next poll attempt's
startTime in the coordinator table. Currently m365 source sets
Instant.now as lastModifiedAt(nextPollAttemptTime), which could skip
new arrived events between current last event's contentCreated time
and current timestamp.
The lastModifiedAt is updated to be contentCreated time(original
implementation) when there is next page, and eventTime+1ms when there
is no new page. This can ensure no missing event in any scenario as
well as no duplicate event in common scenario.
Signed-off-by: Wenjie Yao <wjyao@amazon.com>
Co-authored-by: Wenjie Yao <wjyao@amazon.com>1 parent 0a06b2a commit 1b2b295
2 files changed
Lines changed: 47 additions & 16 deletions
File tree
- data-prepper-plugins/saas-source-plugins/microsoft-office365-source/src
- main/java/org/opensearch/dataprepper/plugins/source/microsoft_office365/service
- test/java/org/opensearch/dataprepper/plugins/source/microsoft_office365/service
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | 111 | | |
113 | | - | |
| 112 | + | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
143 | | - | |
| 142 | + | |
| 143 | + | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
145 | 151 | | |
146 | 152 | | |
147 | | - | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
151 | | - | |
| 157 | + | |
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | | - | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
91 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
92 | 101 | | |
93 | 102 | | |
94 | 103 | | |
| |||
112 | 121 | | |
113 | 122 | | |
114 | 123 | | |
115 | | - | |
| 124 | + | |
116 | 125 | | |
117 | 126 | | |
118 | 127 | | |
119 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
120 | 145 | | |
121 | 146 | | |
122 | 147 | | |
| |||
153 | 178 | | |
154 | 179 | | |
155 | 180 | | |
156 | | - | |
| 181 | + | |
157 | 182 | | |
158 | 183 | | |
159 | 184 | | |
| |||
192 | 217 | | |
193 | 218 | | |
194 | 219 | | |
195 | | - | |
| 220 | + | |
196 | 221 | | |
197 | 222 | | |
198 | 223 | | |
| |||
263 | 288 | | |
264 | 289 | | |
265 | 290 | | |
266 | | - | |
| 291 | + | |
267 | 292 | | |
268 | | - | |
269 | | - | |
| 293 | + | |
| 294 | + | |
270 | 295 | | |
271 | 296 | | |
272 | 297 | | |
| |||
0 commit comments