Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
arjun4084346 committed Sep 9, 2024
1 parent 295b529 commit cf2d4e8
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"namespace" : "org.apache.gobblin.service",
"path" : "/flowstatuses",
"schema" : "org.apache.gobblin.service.FlowStatus",
"doc" : "Resource for handling flow status requests. Deprecated, use {@link FlowExecutionResource}\n\ngenerated from: org.apache.gobblin.service.FlowStatusResource",
"doc" : "Deprecated, use {@link FlowExecutionResource}\n\nResource for handling flow status requests. generated from: org.apache.gobblin.service.FlowStatusResource",
"collection" : {
"identifier" : {
"name" : "id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
"namespace" : "org.apache.gobblin.service",
"path" : "/flowstatuses",
"schema" : "org.apache.gobblin.service.FlowStatus",
"doc" : "Resource for handling flow status requests. Deprecated, use {@link FlowExecutionResource}\n\ngenerated from: org.apache.gobblin.service.FlowStatusResource",
"doc" : "Deprecated, use {@link FlowExecutionResource}\n\nResource for handling flow status requests. generated from: org.apache.gobblin.service.FlowStatusResource",
"collection" : {
"identifier" : {
"name" : "id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


// Unlike FlowConfigsV2ResourceHandler, this is an interface rather than a class because it's implementation needs
// classes from gobblin-service module, and adding gobblin-service as a dependency will cause circular dependency,
// classes from gobblin-service module, and adding gobblin-service as a dependency will cause circular dependency
public interface FlowExecutionResourceHandlerInterface {
/**
* Get {@link FlowExecution}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.apache.gobblin.service.modules.restli.FlowConfigsV2ResourceHandler;


public class FlowConfigResourceLocalHandlerTest {
public class FlowConfigsV2ResourceHandlerTest {
private static final String TEST_GROUP_NAME = "testGroup1";
private static final String TEST_FLOW_NAME = "testFlow1";
private static final String TEST_SCHEDULE = "0 1/0 * ? * *";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.testng.annotations.Test;


public class FlowExecutionResourceLocalHandlerTest {
public class FlowExecutionResourceHandlerTest {

@Test
public void testEstimateCopyTimeLeftSanityCheck() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private void registerServicesInLauncher(){
private void configureServices(){
if (configuration.isRestLIServerEnabled()) {
this.restliServer = EmbeddedRestliServer.builder()
.resources(Lists.newArrayList(FlowConfigsV2Resource.class, FlowConfigsV2Resource.class))
.resources(Lists.newArrayList(FlowConfigsV2Resource.class))
.injector(injector)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
import org.apache.gobblin.service.monitoring.FlowStatusGenerator;


/**
* This is associated with {@link FlowExecutionResource} and handles all the requests FlowExecutionResource get.
*/
@Slf4j
public class FlowExecutionResourceHandler implements FlowExecutionResourceHandlerInterface {
private final DagManagementStateStore dagManagementStateStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


@Test(groups = { "gobblin.service" }, singleThreaded = true)
public class FlowExecutionTest {
public class FlowExecutionClientTest {
private FlowExecutionClient client;
private EmbeddedRestliServer _server;
private List<List<org.apache.gobblin.service.monitoring.JobStatus>> _listOfJobStatusLists;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,25 @@ public class DagUtilsTest {
.withValue(ConfigurationKeys.SPECEXECUTOR_INSTANCE_URI_KEY, ConfigValueFactory.fromAnyRef(
MySqlDagManagementStateStoreTest.TEST_SPEC_EXECUTOR_URI));

@Test
void slaConfigCheck() throws Exception {
Dag<JobExecutionPlan> dag = DagTestUtils.buildDag("5", 123456783L, "FINISH_RUNNING", 1);
Assert.assertEquals(DagUtils.getFlowFinishDeadline(dag.getStartNodes().get(0)), ServiceConfigKeys.DEFAULT_FLOW_FINISH_DEADLINE_MILLIS);

Config jobConfig = dag.getStartNodes().get(0).getValue().getJobSpec().getConfig();
jobConfig = jobConfig
.withValue(ConfigurationKeys.GOBBLIN_FLOW_FINISH_DEADLINE_TIME, ConfigValueFactory.fromAnyRef("7"))
.withValue(ConfigurationKeys.GOBBLIN_FLOW_FINISH_DEADLINE_TIME_UNIT, ConfigValueFactory.fromAnyRef(TimeUnit.SECONDS.name()));
dag.getStartNodes().get(0).getValue().getJobSpec().setConfig(jobConfig);
Assert.assertEquals(DagUtils.getFlowFinishDeadline(dag.getStartNodes().get(0)), TimeUnit.SECONDS.toMillis(7L));

Config jobConfig2 = jobConfig
.withValue(ConfigurationKeys.GOBBLIN_FLOW_FINISH_DEADLINE_TIME, ConfigValueFactory.fromAnyRef("8"))
.withValue(ConfigurationKeys.GOBBLIN_FLOW_FINISH_DEADLINE_TIME_UNIT, ConfigValueFactory.fromAnyRef(TimeUnit.MINUTES.name()));
dag.getStartNodes().get(0).getValue().getJobSpec().setConfig(jobConfig2);
Assert.assertEquals(DagUtils.getFlowFinishDeadline(dag.getStartNodes().get(0)), TimeUnit.MINUTES.toMillis(8L));
}

@Test
void deadlineConfigCheck() throws Exception {
Dag<JobExecutionPlan> dag = DagTestUtils.buildDag("5", 123456783L, "FINISH_RUNNING", 1);
Expand Down

0 comments on commit cf2d4e8

Please sign in to comment.