This is an automated email from the ASF dual-hosted git repository.

turcsanyi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new f14f940389 NIFI-10551: Improve GetHubSpot documentation
f14f940389 is described below

commit f14f940389346a2b6e6a1940accbda69cde62ab9
Author: Lehel Boér <[email protected]>
AuthorDate: Tue Sep 27 11:34:13 2022 +0200

    NIFI-10551: Improve GetHubSpot documentation
    
    This closes #6452.
    
    Signed-off-by: Peter Turcsanyi <[email protected]>
---
 .../main/java/org/apache/nifi/processors/hubspot/GetHubSpot.java | 7 ++++---
 .../additionalDetails.html                                       | 9 +++++++++
 .../java/org/apache/nifi/processors/hubspot/GetHubSpotTest.java  | 6 ++----
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git 
a/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/java/org/apache/nifi/processors/hubspot/GetHubSpot.java
 
b/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/java/org/apache/nifi/processors/hubspot/GetHubSpot.java
index 58c0d02c58..ccac612157 100644
--- 
a/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/java/org/apache/nifi/processors/hubspot/GetHubSpot.java
+++ 
b/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/java/org/apache/nifi/processors/hubspot/GetHubSpot.java
@@ -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")
diff --git 
a/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/resources/docs/org.apache.nifi.processors.hubspot.GetHubSpot/additionalDetails.html
 
b/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/resources/docs/org.apache.nifi.processors.hubspot.GetHubSpot/additionalDetails.html
index 6f2dd67fa6..86bfec9d94 100644
--- 
a/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/resources/docs/org.apache.nifi.processors.hubspot.GetHubSpot/additionalDetails.html
+++ 
b/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/main/resources/docs/org.apache.nifi.processors.hubspot.GetHubSpot/additionalDetails.html
@@ -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>
\ No newline at end of file
diff --git 
a/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/test/java/org/apache/nifi/processors/hubspot/GetHubSpotTest.java
 
b/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/test/java/org/apache/nifi/processors/hubspot/GetHubSpotTest.java
index 410a279ce7..d18b49d316 100644
--- 
a/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/test/java/org/apache/nifi/processors/hubspot/GetHubSpotTest.java
+++ 
b/nifi-nar-bundles/nifi-hubspot-bundle/nifi-hubspot-processors/src/test/java/org/apache/nifi/processors/hubspot/GetHubSpotTest.java
@@ -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);
 

Reply via email to