[
https://issues.apache.org/jira/browse/GOBBLIN-1904?focusedWorklogId=880364&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-880364
]
ASF GitHub Bot logged work on GOBBLIN-1904:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 14/Sep/23 11:42
Start Date: 14/Sep/23 11:42
Worklog Time Spent: 10m
Work Description: gautamguptabasant commented on code in PR #3768:
URL: https://github.com/apache/gobblin/pull/3768#discussion_r1325822508
##########
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:
Yes that's right:
* The histograms are based on the last modified time buckets.
* The time distribution is used in determining the right boundaries for each
partition, so that the number of records to process in each partition is close
to uniform.
Updated the class name, thanks.
Issue Time Tracking
-------------------
Worklog Id: (was: 880364)
Time Spent: 1h 40m (was: 1.5h)
> 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 40m
> 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)