Skip to content

Commit 7a644d4

Browse files
Chen Zhilingkhorshuheng
authored andcommitted
Add pollingInterval config option (#565)
* Add pollingInterval config option * Add missing prefix * Increase polling interval
1 parent aed66a6 commit 7a644d4

6 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎core/src/main/java/feast/core/config/FeastProperties.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public static class JobProperties {
4545
public static class JobUpdatesProperties {
4646

4747
private long timeoutSeconds;
48+
private long pollingIntervalMillis;
4849
}
4950

5051
@Getter

‎core/src/main/java/feast/core/service/JobCoordinatorService.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package feast.core.service;
1818

19+
import com.google.protobuf.InvalidProtocolBufferException;
1920
import feast.core.CoreServiceProto.ListFeatureSetsRequest;
2021
import feast.core.CoreServiceProto.ListStoresRequest.Filter;
2122
import feast.core.CoreServiceProto.ListStoresResponse;
@@ -53,7 +54,6 @@
5354
@Service
5455
public class JobCoordinatorService {
5556

56-
private final long POLLING_INTERVAL_MILLISECONDS = 60000; // 1 min
5757
private JobRepository jobRepository;
5858
private FeatureSetRepository featureSetRepository;
5959
private SpecService specService;
@@ -86,8 +86,8 @@ public JobCoordinatorService(
8686
* <p>4) Updates Feature set statuses
8787
*/
8888
@Transactional
89-
@Scheduled(fixedDelay = POLLING_INTERVAL_MILLISECONDS)
90-
public void Poll() {
89+
@Scheduled(fixedDelayString = "${feast.jobs.updates.pollingIntervalMillis}")
90+
public void Poll() throws InvalidProtocolBufferException {
9191
log.info("Polling for new jobs...");
9292
List<JobUpdateTask> jobUpdateTasks = new ArrayList<>();
9393
ListStoresResponse listStoresResponse = specService.listStores(Filter.newBuilder().build());

‎core/src/main/resources/application.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ feast:
3131
# Key-value dict of job options to be passed to the population jobs.
3232
options: {}
3333
updates:
34+
# Job update polling interval in milliseconds: how often Feast checks if new jobs should be sent to the runner.
35+
pollingIntervalMillis: 60000
3436
# Timeout in seconds for each attempt to update or submit a new job to the runner.
3537
timeoutSeconds: 240
3638
metrics:

‎core/src/test/java/feast/core/service/JobCoordinatorServiceTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void setUp() {
7575
}
7676

7777
@Test
78-
public void shouldDoNothingIfNoStoresFound() {
78+
public void shouldDoNothingIfNoStoresFound() throws InvalidProtocolBufferException {
7979
when(specService.listStores(any())).thenReturn(ListStoresResponse.newBuilder().build());
8080
JobCoordinatorService jcs =
8181
new JobCoordinatorService(

‎infra/scripts/test-end-to-end-batch.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ feast:
120120
runner: DirectRunner
121121
options: {}
122122
updates:
123+
pollingIntervalMillis: 30000
123124
timeoutSeconds: 240
124125
metrics:
125126
enabled: false

‎infra/scripts/test-end-to-end.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ feast:
103103
runner: DirectRunner
104104
options: {}
105105
updates:
106+
pollingIntervalMillis: 30000
106107
timeoutSeconds: 240
107108
metrics:
108109
enabled: false

0 commit comments

Comments
 (0)