本文整理汇总了Java中avro.shaded.com.google.common.base.Joiner类的典型用法代码示例。如果您正苦于以下问题:Java Joiner类的具体用法?Java Joiner怎么用?Java Joiner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Joiner类属于avro.shaded.com.google.common.base包,在下文中一共展示了Joiner类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EmbeddedWikipediaExample
import avro.shaded.com.google.common.base.Joiner; //导入依赖的package包/类
@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));
}
示例2: buildNs
import avro.shaded.com.google.common.base.Joiner; //导入依赖的package包/类
private String buildNs(DataTable table, MetaVersion ver) {
return Joiner.on(".").join(Utils.getDataSourceNamespace(), table.getSchema(), table.getTableName(),
ver.getVersion(), 0, table.isPartationTable() ? "*" : 0);
}
示例3: verifyPrecedenceWithDefaultConfigFile
import avro.shaded.com.google.common.base.Joiner; //导入依赖的package包/类
@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"));
}
示例4: verifyPrecedenceWithExplicitConfigFile
import avro.shaded.com.google.common.base.Joiner; //导入依赖的package包/类
@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"));
}