Tabnine Logo
FlowConfigClient.createFlowConfig
Code IndexAdd Tabnine to your IDE (free)

How to use
createFlowConfig
method
in
org.apache.gobblin.service.FlowConfigClient

Best Java code snippets using org.apache.gobblin.service.FlowConfigClient.createFlowConfig (Showing top 10 results out of 315)

origin: apache/incubator-gobblin

 @SuppressWarnings("DLS_DEAD_LOCAL_STORE")
 private static void testGobblinService(GobblinServiceManager gobblinServiceManager) {

  FlowConfigClient client =
    new FlowConfigClient(String.format("http://localhost:%s/", gobblinServiceManager.restliServer.getPort()));

  Map<String, String> flowProperties = Maps.newHashMap();
  flowProperties.put("param1", "value1");

  final String TEST_GROUP_NAME = "testGroup1";
  final String TEST_FLOW_NAME = "testFlow1";
  final String TEST_SCHEDULE = "0 1/0 * ? * *";
  final String TEST_TEMPLATE_URI = "FS:///templates/test.template";

  FlowConfig flowConfig = new FlowConfig().setId(new FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME))
    .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new Schedule().setCronSchedule(TEST_SCHEDULE).
      setRunImmediately(true))
    .setProperties(new StringMap(flowProperties));

  try {
   client.createFlowConfig(flowConfig);
  } catch (RemoteInvocationException e) {
   throw new RuntimeException(e);
  }
 }
}
origin: apache/incubator-gobblin

@Test (dependsOnMethods = "testCreate")
public void testCreateAgain() throws Exception {
 Map<String, String> flowProperties = Maps.newHashMap();
 flowProperties.put("param1", "value1");
 flowProperties.put(ServiceConfigKeys.FLOW_SOURCE_IDENTIFIER_KEY, TEST_SOURCE_NAME);
 flowProperties.put(ServiceConfigKeys.FLOW_DESTINATION_IDENTIFIER_KEY, TEST_SINK_NAME);
 FlowConfig flowConfig = new FlowConfig().setId(new FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME))
   .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new Schedule().setCronSchedule(TEST_SCHEDULE))
   .setProperties(new StringMap(flowProperties));
 try {
  this.flowConfigClient.createFlowConfig(flowConfig);
 } catch (RestLiResponseException e) {
  Assert.fail("Create Again should pass without complaining that the spec already exists.");
 }
}
origin: apache/incubator-gobblin

@Test
public void testCreate() throws Exception {
 Map<String, String> flowProperties = Maps.newHashMap();
 flowProperties.put("param1", "value1");
 flowProperties.put(ServiceConfigKeys.FLOW_SOURCE_IDENTIFIER_KEY, TEST_SOURCE_NAME);
 flowProperties.put(ServiceConfigKeys.FLOW_DESTINATION_IDENTIFIER_KEY, TEST_SINK_NAME);
 FlowConfig flowConfig = new FlowConfig().setId(new FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME))
   .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new Schedule().setCronSchedule(TEST_SCHEDULE).setRunImmediately(true))
   .setProperties(new StringMap(flowProperties));
 this.flowConfigClient.createFlowConfig(flowConfig);
 Assert.assertTrue(this.gobblinServiceManager.flowCatalog.getSpecs().size() == 1, "Flow that was created is not "
   + "reflecting in FlowCatalog");
}
origin: apache/incubator-gobblin

@Test (dependsOnMethods = "testCreate")
public void testCreateAgain() throws Exception {
 Map<String, String> flowProperties = Maps.newHashMap();
 flowProperties.put("param1", "value1");
 FlowConfig flowConfig = new FlowConfig().setId(new FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME))
   .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new Schedule().setCronSchedule(TEST_SCHEDULE))
   .setProperties(new StringMap(flowProperties));
 try {
  _client.createFlowConfig(flowConfig);
 } catch (RestLiResponseException e) {
  Assert.fail("Create Again should pass without complaining that the spec already exists.");
 }
}
origin: apache/incubator-gobblin

@Test
public void testCreate() throws Exception {
 Map<String, String> flowProperties = Maps.newHashMap();
 flowProperties.put("param1", "value1");
 FlowConfig flowConfig = new FlowConfig().setId(new FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME))
   .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new Schedule().setCronSchedule(TEST_SCHEDULE).
     setRunImmediately(true))
   .setProperties(new StringMap(flowProperties));
 _client.createFlowConfig(flowConfig);
}
origin: apache/incubator-gobblin

@Test
public void testCreateBadSchedule() throws Exception {
 Map<String, String> flowProperties = Maps.newHashMap();
 flowProperties.put("param1", "value1");
 FlowConfig flowConfig = new FlowConfig().setId(new FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME))
   .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new Schedule().setCronSchedule("bad schedule").
     setRunImmediately(true))
   .setProperties(new StringMap(flowProperties));
 try {
  _client.createFlowConfig(flowConfig);
 } catch (RestLiResponseException e) {
  Assert.assertEquals(e.getStatus(), HttpStatus.S_422_UNPROCESSABLE_ENTITY.getCode());
  return;
 }
 Assert.fail("Get should have gotten a 422 error");
}
origin: apache/incubator-gobblin

@Test
public void testCreateBadTemplateUri() throws Exception {
 Map<String, String> flowProperties = Maps.newHashMap();
 flowProperties.put("param1", "value1");
 FlowConfig flowConfig = new FlowConfig().setId(new FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME))
   .setTemplateUris("FILE://bad/uri").setSchedule(new Schedule().setCronSchedule(TEST_SCHEDULE).
     setRunImmediately(true))
   .setProperties(new StringMap(flowProperties));
 try {
  _client.createFlowConfig(flowConfig);
 } catch (RestLiResponseException e) {
  Assert.assertEquals(e.getStatus(), HttpStatus.S_422_UNPROCESSABLE_ENTITY.getCode());
  return;
 }
 Assert.fail("Get should have gotten a 422 error");
}
origin: apache/incubator-gobblin

this.node1FlowConfigClient.createFlowConfig(flowConfig1);
this.node2FlowConfigClient.createFlowConfig(flowConfig2);
origin: apache/incubator-gobblin

@Test (dependsOnMethods = "testCreate")
public void testCreateAgain() throws Exception {
 logger.info("+++++++++++++++++++ testCreateAgain START");
 Map<String, String> flowProperties = Maps.newHashMap();
 flowProperties.put("param1", "value1");
 flowProperties.put(ServiceConfigKeys.FLOW_SOURCE_IDENTIFIER_KEY, TEST_SOURCE_NAME);
 flowProperties.put(ServiceConfigKeys.FLOW_DESTINATION_IDENTIFIER_KEY, TEST_SINK_NAME);
 FlowConfig flowConfig1 = new FlowConfig()
   .setId(new FlowId().setFlowGroup(TEST_GROUP_NAME_1).setFlowName(TEST_FLOW_NAME_1))
   .setTemplateUris(TEST_TEMPLATE_URI_1).setSchedule(new Schedule().setCronSchedule(TEST_SCHEDULE_1).
     setRunImmediately(true))
   .setProperties(new StringMap(flowProperties));
 FlowConfig flowConfig2 = new FlowConfig()
   .setId(new FlowId().setFlowGroup(TEST_GROUP_NAME_2).setFlowName(TEST_FLOW_NAME_2))
   .setTemplateUris(TEST_TEMPLATE_URI_2).setSchedule(new Schedule().setCronSchedule(TEST_SCHEDULE_2).
     setRunImmediately(true))
   .setProperties(new StringMap(flowProperties));
 // Try create on both nodes
 try {
  this.node1FlowConfigClient.createFlowConfig(flowConfig1);
 } catch (RestLiResponseException e) {
  Assert.fail("Create Again should pass without complaining that the spec already exists.");
 }
 try {
  this.node2FlowConfigClient.createFlowConfig(flowConfig2);
 } catch (RestLiResponseException e) {
  Assert.fail("Create Again should pass without complaining that the spec already exists.");
 }
 logger.info("+++++++++++++++++++ testCreateAgain END");
}
origin: org.apache.gobblin/gobblin-service

 @SuppressWarnings("DLS_DEAD_LOCAL_STORE")
 private static void testGobblinService(GobblinServiceManager gobblinServiceManager) {

  FlowConfigClient client =
    new FlowConfigClient(String.format("http://localhost:%s/", gobblinServiceManager.restliServer.getPort()));

  Map<String, String> flowProperties = Maps.newHashMap();
  flowProperties.put("param1", "value1");

  final String TEST_GROUP_NAME = "testGroup1";
  final String TEST_FLOW_NAME = "testFlow1";
  final String TEST_SCHEDULE = "0 1/0 * ? * *";
  final String TEST_TEMPLATE_URI = "FS:///templates/test.template";

  FlowConfig flowConfig = new FlowConfig().setId(new FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME))
    .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new Schedule().setCronSchedule(TEST_SCHEDULE).
      setRunImmediately(true))
    .setProperties(new StringMap(flowProperties));

  try {
   client.createFlowConfig(flowConfig);
  } catch (RemoteInvocationException e) {
   throw new RuntimeException(e);
  }
 }
}
org.apache.gobblin.serviceFlowConfigClientcreateFlowConfig

Javadoc

Create a flow configuration

Popular methods of FlowConfigClient

  • <init>
    Construct a FlowConfigClient to communicate with http flow config server at URI serverUri
  • deleteFlowConfig
    Delete a flow configuration
  • getFlowConfig
    Get a flow configuration
  • updateFlowConfig
    Update a flow configuration
  • close

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Table (org.hibernate.mapping)
    A relational table
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now