-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract event from the temporal worker run factory (#10739)
Extract of different events that can happen to a sync into a non temporal related interface.
- Loading branch information
1 parent
f3876df
commit b333204
Showing
15 changed files
with
144 additions
and
109 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
airbyte-scheduler/client/src/main/java/io/airbyte/scheduler/client/EventRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.scheduler.client; | ||
|
||
import io.airbyte.workers.temporal.TemporalClient.ManualSyncSubmissionResult; | ||
import java.util.Set; | ||
import java.util.UUID; | ||
|
||
public interface EventRunner { | ||
|
||
void createNewSchedulerWorkflow(final UUID connectionId); | ||
|
||
ManualSyncSubmissionResult startNewManualSync(final UUID connectionId); | ||
|
||
ManualSyncSubmissionResult startNewCancelation(final UUID connectionId); | ||
|
||
ManualSyncSubmissionResult resetConnection(final UUID connectionId); | ||
|
||
ManualSyncSubmissionResult synchronousResetConnection(final UUID connectionId); | ||
|
||
void deleteConnection(final UUID connectionId); | ||
|
||
void migrateSyncIfNeeded(final Set<UUID> connectionIds); | ||
|
||
void update(final UUID connectionId); | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
airbyte-scheduler/client/src/main/java/io/airbyte/scheduler/client/TemporalEventRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.scheduler.client; | ||
|
||
import io.airbyte.workers.temporal.TemporalClient; | ||
import io.airbyte.workers.temporal.TemporalClient.ManualSyncSubmissionResult; | ||
import java.util.Set; | ||
import java.util.UUID; | ||
import lombok.AllArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
public class TemporalEventRunner implements EventRunner { | ||
|
||
private final TemporalClient temporalClient; | ||
|
||
public void createNewSchedulerWorkflow(final UUID connectionId) { | ||
temporalClient.submitConnectionUpdaterAsync(connectionId); | ||
} | ||
|
||
public ManualSyncSubmissionResult startNewManualSync(final UUID connectionId) { | ||
return temporalClient.startNewManualSync(connectionId); | ||
} | ||
|
||
public ManualSyncSubmissionResult startNewCancelation(final UUID connectionId) { | ||
return temporalClient.startNewCancelation(connectionId); | ||
} | ||
|
||
public ManualSyncSubmissionResult resetConnection(final UUID connectionId) { | ||
return temporalClient.resetConnection(connectionId); | ||
} | ||
|
||
public ManualSyncSubmissionResult synchronousResetConnection(final UUID connectionId) { | ||
return temporalClient.synchronousResetConnection(connectionId); | ||
} | ||
|
||
public void deleteConnection(final UUID connectionId) { | ||
temporalClient.deleteConnection(connectionId); | ||
} | ||
|
||
public void migrateSyncIfNeeded(final Set<UUID> connectionIds) { | ||
temporalClient.migrateSyncIfNeeded(connectionIds); | ||
} | ||
|
||
public void update(final UUID connectionId) { | ||
temporalClient.update(connectionId); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.