NIFI-10551: Improve GetHubSpot documentation

This closes #6452.

Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
This commit is contained in:
Lehel Boér 2022-09-27 11:34:13 +02:00 committed by Peter Turcsanyi
parent 34084d083a
commit f14f940389
No known key found for this signature in database
GPG Key ID: 55A813F1C3E553DC
3 changed files with 15 additions and 7 deletions

View File

@ -116,7 +116,7 @@ public class GetHubSpot extends AbstractProcessor {
" the previous run time and the current time (optionally adjusted by the Incremental Delay property).")
.required(true)
.allowableValues("true", "false")
.defaultValue("false")
.defaultValue("true")
.build();
static final PropertyDescriptor INCREMENTAL_DELAY = new PropertyDescriptor.Builder()
@ -124,9 +124,10 @@ public class GetHubSpot extends AbstractProcessor {
.displayName("Incremental Delay")
.description(("The ending timestamp of the time window will be adjusted earlier by the amount configured in this property." +
" For example, with a property value of 10 seconds, an ending timestamp of 12:30:45 would be changed to 12:30:35." +
" Set this property to avoid missing objects when the clock of your local machines and HubSpot servers' clock are not in sync."))
" Set this property to avoid missing objects when the clock of your local machines and HubSpot servers' clock are not in sync" +
" and to protect against HubSpot's mechanism that changes last updated timestamps after object creation."))
.required(true)
.defaultValue("3 sec")
.defaultValue("30 sec")
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
.addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)
.dependsOn(IS_INCREMENTAL, "true")

View File

@ -32,5 +32,14 @@
last run time of the processor are processed. The processor state can be reset in the context menu. The incremental loading
is based on the objects last modified time.
</p>
<h2>Paging</h2>
<p>
GetHubSpot supports both paging and incrementality at the same time. In case the number of results exceeds the 'Result Limit',
in the next processor run the remaining objects will be returned.
</p>
<p>
Due to the page handling mechanism of the HubSpot API, parallel deletions are not supported.
Some objects may be omitted if any object is deleted between fetching two pages.
</p>
</body>
</html>

View File

@ -135,7 +135,7 @@ class GetHubSpotTest {
server.enqueue(new MockResponse().setBody(response));
final String limit = "2";
final int defaultDelay = 3000;
final int defaultDelay = 30000;
final String endTime = String.valueOf(Instant.now().toEpochMilli());
final Map<String, String> stateMap = new HashMap<>();
stateMap.put(END_INCREMENTAL_KEY, endTime);
@ -178,13 +178,11 @@ class GetHubSpotTest {
final String limit = "2";
final String after = "nextPage";
final String objectType = COMPANIES.getValue();
final String cursorKey = String.format(CURSOR_KEY, objectType);
final Instant now = Instant.now();
final String startTime = String.valueOf(now.toEpochMilli());
final String endTime = String.valueOf(now.plus(2, ChronoUnit.MINUTES).toEpochMilli());
final Map<String, String> stateMap = new HashMap<>();
stateMap.put(cursorKey, after);
stateMap.put(CURSOR_KEY, after);
stateMap.put(START_INCREMENTAL_KEY, startTime);
stateMap.put(END_INCREMENTAL_KEY, endTime);