Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Amar3tto committed Dec 16, 2022
1 parent 34bc5d0 commit 8bf3087
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions examples/java/cdap/hubspot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ dependencies {
implementation project(":sdks:java:io:hadoop-common")
implementation library.java.cdap_api
implementation library.java.cdap_api_commons
permitUnusedDeclared library.java.cdap_api_commons
implementation library.java.cdap_etl_api
permitUnusedDeclared library.java.cdap_etl_api
implementation library.java.cdap_etl_api_spark
permitUnusedDeclared library.java.cdap_etl_api_spark
implementation library.java.cdap_hydrator_common
//TODO: modify to 'implementation library.java.cdap_plugin_hubspot',
// when new release with HasOffset interface will be published
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import static org.apache.beam.sdk.util.Preconditions.checkStateNotNull;

import com.google.gson.JsonElement;
import io.cdap.cdap.api.data.format.StructuredRecord;
import io.cdap.cdap.etl.api.streaming.StreamingSource;
import io.cdap.plugin.hubspot.common.SourceHubspotConfig;
import io.cdap.plugin.hubspot.source.batch.HubspotBatchSource;
import io.cdap.plugin.hubspot.source.streaming.HubspotReceiver;
Expand Down Expand Up @@ -69,8 +67,6 @@ public static CdapIO.Read<NullWritable, JsonElement> readFromCdapHubspot(
public static CdapIO.Read<NullWritable, String> readFromCdapHubspotStreaming(
Map<String, Object> pluginConfigParams, Long pullFrequencySec, Long startOffset) {

Class<? extends StreamingSource<StructuredRecord>> pluginClass = HubspotStreamingSource.class;

final HubspotStreamingSourceConfig pluginConfig =
new ConfigWrapper<>(HubspotStreamingSourceConfig.class)
.withParams(pluginConfigParams)
Expand All @@ -81,8 +77,8 @@ public static CdapIO.Read<NullWritable, String> readFromCdapHubspotStreaming(
CdapIO.<NullWritable, String>read()
.withCdapPlugin(
Plugin.createStreaming(
pluginClass,
GetOffsetUtils.getOffsetFnForCdapPlugin(pluginClass),
HubspotStreamingSource.class,
GetOffsetUtils.getOffsetFnForCdapPlugin(HubspotStreamingSource.class),
HubspotReceiver.class))
.withPluginConfig(pluginConfig)
.withKeyClass(NullWritable.class)
Expand Down

0 comments on commit 8bf3087

Please sign in to comment.