avro.shaded.com.google.common.base.Joiner Java Examples

The following examples show how to use avro.shaded.com.google.common.base.Joiner. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EmbeddedWikipediaExample.java    From incubator-gobblin with Apache License 2.0 5 votes vote down vote up
@CliObjectSupport(argumentNames = {"topics"})
public EmbeddedWikipediaExample(String... topics) throws JobTemplate.TemplateException, IOException {
  super("Wikipedia");
  try {
    setTemplate(ResourceBasedJobTemplate.forResourcePath("wikipedia.template"));
  } catch (URISyntaxException | SpecNotFoundException exc) {
    throw new RuntimeException("Could not instantiate an " + EmbeddedWikipediaExample.class.getName(), exc);
  }
  this.setConfiguration("titles", Joiner.on(",").join(topics));
}
 
Example #2
Source File: HeartbeatDefaultHandler.java    From DBus with Apache License 2.0 4 votes vote down vote up
private String buildNs(DataTable table, MetaVersion ver) {
    return Joiner.on(".").join(Utils.getDataSourceNamespace(), table.getSchema(), table.getTableName(),
            ver.getVersion(), 0, table.isPartationTable() ? "*" : 0);
}
 
Example #3
Source File: ConfigIT.java    From digdag with Apache License 2.0 4 votes vote down vote up
@Test
public void verifyPrecedenceWithDefaultConfigFile()
        throws Exception
{
    Path projectDir = folder.newFolder().toPath();
    addWorkflow(projectDir, "acceptance/params.dig");

    Path home = folder.newFolder().toPath().resolve("home");
    Path configFile = home.resolve(".config").resolve("digdag").resolve("config");
    Files.createDirectories(configFile.getParent());

    TestUtils.fakeHome(home.toString(), () -> {
        Files.write(configFile, asList(
                "params.param1=defaultConfigValue1",
                "params.param2=defaultConfigValue2",
                "params.param3=defaultConfigValue3",
                "params.param4=defaultConfigValue4"
        ));
        Map<String, String> env = ImmutableMap.of(
                "DIGDAG_CONFIG", Joiner.on('\n').join(
                        "params.param2=envConfigValue2",
                        "params.param3=envConfigValue3",
                        "params.param4=envConfigValue4"
                )
        );
        TestUtils.withSystemProperties(ImmutableMap.of(
                "params.param3", "systemPropValue3",
                "params.param4", "systemPropValue4"), () -> {
            main(env,
                    "run",
                    "-o", folder.newFolder().getAbsolutePath(),
                    "--project", projectDir.toString(),
                    "-p", "param4=commandLinePropValue4",
                    "params.dig");
        });
    });
    assertThat(Files.readAllLines(projectDir.resolve("param1.out")), contains("defaultConfigValue1"));
    assertThat(Files.readAllLines(projectDir.resolve("param2.out")), contains("envConfigValue2"));
    assertThat(Files.readAllLines(projectDir.resolve("param3.out")), contains("systemPropValue3"));
    assertThat(Files.readAllLines(projectDir.resolve("param4.out")), contains("commandLinePropValue4"));
}
 
Example #4
Source File: ConfigIT.java    From digdag with Apache License 2.0 4 votes vote down vote up
@Test
public void verifyPrecedenceWithExplicitConfigFile()
        throws Exception
{
    Path projectDir = folder.newFolder().toPath();
    addWorkflow(projectDir, "acceptance/params.dig");

    Path home = folder.newFolder().toPath().resolve("home");
    Path defaultConfigFile = home.resolve(".config").resolve("digdag").resolve("config");
    Files.createDirectories(defaultConfigFile.getParent());

    Path explicitConfig = folder.newFolder().toPath().resolve("explicit-config");
    Files.write(explicitConfig, asList(
            "params.param3=explicitConfigValue3",
            "params.param4=explicitConfigValue4"
    ));

    TestUtils.fakeHome(home.toString(), () -> {
        Files.write(defaultConfigFile, asList(
                "params.param1=defaultConfigValue1",
                "params.param2=defaultConfigValue2",
                "params.param3=defaultConfigValue3",
                "params.param4=defaultConfigValue4"
        ));
        Map<String, String> env = ImmutableMap.of(
                "DIGDAG_CONFIG", Joiner.on('\n').join(
                        "params.param1=envConfigValue1",
                        "params.param2=envConfigValue2",
                        "params.param3=envConfigValue3",
                        "params.param4=envConfigValue4"
                )
        );
        TestUtils.withSystemProperties(ImmutableMap.of(
                "params.param2", "systemPropValue2",
                "params.param3", "systemPropValue3",
                "params.param4", "systemPropValue4"), () -> {
            main(env,
                    "run",
                    "-o", folder.newFolder().getAbsolutePath(),
                    "--config", explicitConfig.toString(),
                    "--project", projectDir.toString(),
                    "-p", "param4=commandLinePropValue4",
                    "params.dig");
        });
    });
    assertThat(Files.readAllLines(projectDir.resolve("param1.out")), contains("envConfigValue1"));
    assertThat(Files.readAllLines(projectDir.resolve("param2.out")), contains("systemPropValue2"));
    assertThat(Files.readAllLines(projectDir.resolve("param3.out")), contains("explicitConfigValue3"));
    assertThat(Files.readAllLines(projectDir.resolve("param4.out")), contains("commandLinePropValue4"));
}