[ 
https://issues.apache.org/jira/browse/GOBBLIN-1904?focusedWorklogId=880099&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-880099
 ]

ASF GitHub Bot logged work on GOBBLIN-1904:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Sep/23 04:42
            Start Date: 13/Sep/23 04:42
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3768:
URL: https://github.com/apache/gobblin/pull/3768#discussion_r1323959612


##########
gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceHistogramService.java:
##########
@@ -0,0 +1,373 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.gobblin.salesforce;
+
+import com.google.common.math.DoubleMath;
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.text.StrSubstitutor;
+import org.apache.gobblin.configuration.SourceState;
+import org.apache.gobblin.source.extractor.DataRecordException;
+import org.apache.gobblin.source.extractor.exception.RestApiClientException;
+import 
org.apache.gobblin.source.extractor.exception.RestApiConnectionException;
+import 
org.apache.gobblin.source.extractor.exception.RestApiProcessingException;
+import org.apache.gobblin.source.extractor.extract.Command;
+import org.apache.gobblin.source.extractor.extract.CommandOutput;
+import org.apache.gobblin.source.extractor.extract.restapi.RestApiConnector;
+import org.apache.gobblin.source.extractor.partition.Partition;
+import org.apache.gobblin.source.extractor.partition.Partitioner;
+import org.apache.gobblin.source.extractor.utils.Utils;
+
+import static org.apache.gobblin.configuration.ConfigurationKeys.*;
+
+
+/**
+ * This class encapsulates everything related to histogram calculation for 
Salesforce. A histogram here refers to a
+ * mapping of number of records to be fetched by time intervals.

Review Comment:
   is the histogram for per-record last modified time buckets?  and is the 
sketch of the time distribution useful for guiding "multi partitioning"?
   
   while also worth describing via javadoc, probably best to clearly describe 
the nature of the histogram into the class name. e .g. 
`gobblin.salesforce.RecordModTimeHistogramService`





Issue Time Tracking
-------------------

    Worklog Id:     (was: 880099)
    Time Spent: 1h 10m  (was: 1h)

> Refactor Salesforce Source to promote testability
> -------------------------------------------------
>
>                 Key: GOBBLIN-1904
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1904
>             Project: Apache Gobblin
>          Issue Type: Improvement
>          Components: gobblin-core
>            Reporter: William Lo
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Salesforce source is difficult to test due to many internal classes that 
> cannot mock inputs and outputs. We should clean this class and use 
> composition to promote testability.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to