Skip to content

Commit e14722f

Browse files
alparishAlekhya Parisha
andauthored
Rename Atlassian state classes to PaginationCrawler (#5718)
Signed-off-by: Alekhya Parisha <aparisha@amazon.com> Co-authored-by: Alekhya Parisha <aparisha@amazon.com>
1 parent d76fe17 commit e14722f

17 files changed

Lines changed: 65 additions & 65 deletions

File tree

data-prepper-plugins/saas-source-plugins/confluence-source/src/main/java/org/opensearch/dataprepper/plugins/source/confluence/ConfluenceClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.opensearch.dataprepper.plugins.source.source_crawler.base.CrawlerClient;
2626
import org.opensearch.dataprepper.plugins.source.source_crawler.base.CrawlerSourceConfig;
2727
import org.opensearch.dataprepper.plugins.source.source_crawler.base.PluginExecutorServiceProvider;
28-
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.AtlassianWorkerProgressState;
28+
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.PaginationCrawlerWorkerProgressState;
2929
import org.opensearch.dataprepper.plugins.source.source_crawler.model.ItemInfo;
3030
import org.slf4j.Logger;
3131
import org.slf4j.LoggerFactory;
@@ -49,7 +49,7 @@
4949
* This class represents a Confluence client.
5050
*/
5151
@Named
52-
public class ConfluenceClient implements CrawlerClient<AtlassianWorkerProgressState> {
52+
public class ConfluenceClient implements CrawlerClient<PaginationCrawlerWorkerProgressState> {
5353

5454
private static final Logger log = LoggerFactory.getLogger(ConfluenceClient.class);
5555
private ObjectMapper objectMapper = new ObjectMapper();
@@ -81,7 +81,7 @@ public void injectObjectMapper(ObjectMapper objectMapper) {
8181
}
8282

8383
@Override
84-
public void executePartition(AtlassianWorkerProgressState state,
84+
public void executePartition(PaginationCrawlerWorkerProgressState state,
8585
Buffer<Record<Event>> buffer,
8686
AcknowledgementSet acknowledgementSet) {
8787
log.trace("Executing the partition: {} with {} ticket(s)",

data-prepper-plugins/saas-source-plugins/confluence-source/src/main/java/org/opensearch/dataprepper/plugins/source/confluence/ConfluenceSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.opensearch.dataprepper.plugins.source.source_crawler.base.LeaderProgressState;
2929
import org.opensearch.dataprepper.plugins.source.source_crawler.base.PaginationCrawler;
3030
import org.opensearch.dataprepper.plugins.source.source_crawler.base.PluginExecutorServiceProvider;
31-
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.AtlassianLeaderProgressState;
31+
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.PaginationCrawlerLeaderProgressState;
3232
import org.slf4j.Logger;
3333
import org.slf4j.LoggerFactory;
3434
import java.time.Instant;
@@ -74,7 +74,7 @@ public void start(Buffer<Record<Event>> buffer) {
7474

7575
@Override
7676
protected LeaderProgressState createLeaderProgressState() {
77-
return new AtlassianLeaderProgressState(Instant.EPOCH);
77+
return new PaginationCrawlerLeaderProgressState(Instant.EPOCH);
7878
}
7979

8080
@Override

data-prepper-plugins/saas-source-plugins/confluence-source/src/test/java/org/opensearch/dataprepper/plugins/source/confluence/ConfluenceClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.opensearch.dataprepper.model.event.Event;
2424
import org.opensearch.dataprepper.model.record.Record;
2525
import org.opensearch.dataprepper.plugins.source.source_crawler.base.PluginExecutorServiceProvider;
26-
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.AtlassianWorkerProgressState;
26+
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.PaginationCrawlerWorkerProgressState;
2727
import java.time.Instant;
2828
import java.util.ArrayList;
2929
import java.util.Collection;
@@ -48,7 +48,7 @@ public class ConfluenceClientTest {
4848
@Mock
4949
private Buffer<Record<Event>> buffer;
5050
@Mock
51-
private AtlassianWorkerProgressState saasWorkerProgressState;
51+
private PaginationCrawlerWorkerProgressState saasWorkerProgressState;
5252
@Mock
5353
private AcknowledgementSet acknowledgementSet;
5454
@Mock

data-prepper-plugins/saas-source-plugins/jira-source/src/main/java/org/opensearch/dataprepper/plugins/source/jira/JiraClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.opensearch.dataprepper.plugins.source.source_crawler.base.CrawlerClient;
2424
import org.opensearch.dataprepper.plugins.source.source_crawler.base.CrawlerSourceConfig;
2525
import org.opensearch.dataprepper.plugins.source.source_crawler.base.PluginExecutorServiceProvider;
26-
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.AtlassianWorkerProgressState;
26+
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.PaginationCrawlerWorkerProgressState;
2727
import org.opensearch.dataprepper.plugins.source.source_crawler.model.ItemInfo;
2828
import org.slf4j.Logger;
2929
import org.slf4j.LoggerFactory;
@@ -47,7 +47,7 @@
4747
* This class represents a Jira client.
4848
*/
4949
@Named
50-
public class JiraClient implements CrawlerClient<AtlassianWorkerProgressState> {
50+
public class JiraClient implements CrawlerClient<PaginationCrawlerWorkerProgressState> {
5151

5252
private static final Logger log = LoggerFactory.getLogger(JiraClient.class);
5353
private ObjectMapper objectMapper = new ObjectMapper();
@@ -79,7 +79,7 @@ void injectObjectMapper(ObjectMapper objectMapper) {
7979
}
8080

8181
@Override
82-
public void executePartition(AtlassianWorkerProgressState state,
82+
public void executePartition(PaginationCrawlerWorkerProgressState state,
8383
Buffer<Record<Event>> buffer,
8484
AcknowledgementSet acknowledgementSet) {
8585
log.trace("Executing the partition: {} with {} ticket(s)",

data-prepper-plugins/saas-source-plugins/jira-source/src/main/java/org/opensearch/dataprepper/plugins/source/jira/JiraSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.opensearch.dataprepper.plugins.source.source_crawler.base.LeaderProgressState;
2929
import org.opensearch.dataprepper.plugins.source.source_crawler.base.PaginationCrawler;
3030
import org.opensearch.dataprepper.plugins.source.source_crawler.base.PluginExecutorServiceProvider;
31-
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.AtlassianLeaderProgressState;
31+
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.PaginationCrawlerLeaderProgressState;
3232
import org.slf4j.Logger;
3333
import org.slf4j.LoggerFactory;
3434
import java.time.Instant;
@@ -74,7 +74,7 @@ public void start(Buffer<Record<Event>> buffer) {
7474

7575
@Override
7676
protected LeaderProgressState createLeaderProgressState() {
77-
return new AtlassianLeaderProgressState(Instant.EPOCH);
77+
return new PaginationCrawlerLeaderProgressState(Instant.EPOCH);
7878
}
7979

8080
@Override

data-prepper-plugins/saas-source-plugins/jira-source/src/test/java/org/opensearch/dataprepper/plugins/source/jira/JiraClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.opensearch.dataprepper.model.event.Event;
2424
import org.opensearch.dataprepper.model.record.Record;
2525
import org.opensearch.dataprepper.plugins.source.source_crawler.base.PluginExecutorServiceProvider;
26-
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.AtlassianWorkerProgressState;
26+
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.PaginationCrawlerWorkerProgressState;
2727
import java.time.Instant;
2828
import java.util.ArrayList;
2929
import java.util.Collection;
@@ -48,7 +48,7 @@ public class JiraClientTest {
4848
@Mock
4949
private Buffer<Record<Event>> buffer;
5050
@Mock
51-
private AtlassianWorkerProgressState saasWorkerProgressState;
51+
private PaginationCrawlerWorkerProgressState saasWorkerProgressState;
5252
@Mock
5353
private AcknowledgementSet acknowledgementSet;
5454
@Mock

data-prepper-plugins/saas-source-plugins/source-crawler/src/main/java/org/opensearch/dataprepper/plugins/source/source_crawler/base/LeaderProgressState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package org.opensearch.dataprepper.plugins.source.source_crawler.base;
22
import com.fasterxml.jackson.annotation.JsonSubTypes;
33
import com.fasterxml.jackson.annotation.JsonTypeInfo;
4-
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.AtlassianLeaderProgressState;
4+
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.PaginationCrawlerLeaderProgressState;
55
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.CrowdStrikeLeaderProgressState;
66

77
import java.time.Instant;
88

99
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
1010
@JsonSubTypes({
11-
@JsonSubTypes.Type(value = AtlassianLeaderProgressState.class),
11+
@JsonSubTypes.Type(value = PaginationCrawlerLeaderProgressState.class),
1212
@JsonSubTypes.Type(value = CrowdStrikeLeaderProgressState.class)
1313
})
1414
public interface LeaderProgressState {

data-prepper-plugins/saas-source-plugins/source-crawler/src/main/java/org/opensearch/dataprepper/plugins/source/source_crawler/base/PaginationCrawler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.opensearch.dataprepper.model.source.coordinator.enhanced.EnhancedSourceCoordinator;
1111
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.partition.LeaderPartition;
1212
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.partition.SaasSourcePartition;
13-
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.AtlassianWorkerProgressState;
13+
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.PaginationCrawlerWorkerProgressState;
1414
import org.opensearch.dataprepper.plugins.source.source_crawler.model.ItemInfo;
1515
import org.slf4j.Logger;
1616
import org.slf4j.LoggerFactory;
@@ -27,7 +27,7 @@
2727
import static org.opensearch.dataprepper.plugins.source.source_crawler.coordination.scheduler.LeaderScheduler.DEFAULT_EXTEND_LEASE_MINUTES;
2828

2929
@Named
30-
public class PaginationCrawler implements Crawler<AtlassianWorkerProgressState> {
30+
public class PaginationCrawler implements Crawler<PaginationCrawlerWorkerProgressState> {
3131
private static final Logger log = LoggerFactory.getLogger(PaginationCrawler.class);
3232
private static final int batchSize = 50;
3333
private static final String PAGINATION_WORKER_PARTITIONS_CREATED = "paginationWorkerPartitionsCreated";
@@ -89,7 +89,7 @@ public Instant crawl(LeaderPartition leaderPartition,
8989
return latestModifiedTime;
9090
}
9191

92-
public void executePartition(AtlassianWorkerProgressState state, Buffer<Record<Event>> buffer, AcknowledgementSet acknowledgementSet) {
92+
public void executePartition(PaginationCrawlerWorkerProgressState state, Buffer<Record<Event>> buffer, AcknowledgementSet acknowledgementSet) {
9393
client.executePartition(state, buffer, acknowledgementSet);
9494
}
9595

@@ -107,7 +107,7 @@ private void createPartition(List<ItemInfo> itemInfoList, EnhancedSourceCoordina
107107
ItemInfo itemInfo = itemInfoList.get(0);
108108
String partitionKey = itemInfo.getPartitionKey();
109109
List<String> itemIds = itemInfoList.stream().map(ItemInfo::getId).collect(Collectors.toList());
110-
AtlassianWorkerProgressState state = new AtlassianWorkerProgressState();
110+
PaginationCrawlerWorkerProgressState state = new PaginationCrawlerWorkerProgressState();
111111
state.setKeyAttributes(itemInfo.getKeyAttributes());
112112
state.setItemIds(itemIds);
113113
state.setExportStartTime(Instant.now());

data-prepper-plugins/saas-source-plugins/source-crawler/src/main/java/org/opensearch/dataprepper/plugins/source/source_crawler/base/SaasWorkerProgressState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
import com.fasterxml.jackson.annotation.JsonSubTypes;
55
import com.fasterxml.jackson.annotation.JsonTypeInfo;
6-
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.AtlassianWorkerProgressState;
6+
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.PaginationCrawlerWorkerProgressState;
77
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.CrowdStrikeWorkerProgressState;
88

99
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
1010
@JsonSubTypes({
11-
@JsonSubTypes.Type(value = AtlassianWorkerProgressState.class, name = "atlassian"),
11+
@JsonSubTypes.Type(value = PaginationCrawlerWorkerProgressState.class, name = "pagination_crawler"),
1212
@JsonSubTypes.Type(value = CrowdStrikeWorkerProgressState.class, name = "crowdstrike")
1313
})
1414
public interface SaasWorkerProgressState {

data-prepper-plugins/saas-source-plugins/source-crawler/src/main/java/org/opensearch/dataprepper/plugins/source/source_crawler/coordination/state/AtlassianLeaderProgressState.java renamed to data-prepper-plugins/saas-source-plugins/source-crawler/src/main/java/org/opensearch/dataprepper/plugins/source/source_crawler/coordination/state/PaginationCrawlerLeaderProgressState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
import java.time.Instant;
88
@Data
9-
public class AtlassianLeaderProgressState implements LeaderProgressState {
9+
public class PaginationCrawlerLeaderProgressState implements LeaderProgressState {
1010

1111
@JsonProperty("initialized")
1212
private boolean initialized = false;
1313

1414
@JsonProperty("last_poll_time")
1515
private Instant lastPollTime;
1616

17-
public AtlassianLeaderProgressState(@JsonProperty("last_poll_time") final Instant lastPollTime) {
17+
public PaginationCrawlerLeaderProgressState(@JsonProperty("last_poll_time") final Instant lastPollTime) {
1818
this.lastPollTime = lastPollTime;
1919
}
2020
}

0 commit comments

Comments
 (0)