本文整理汇总了Java中cascading.scheme.Scheme类的典型用法代码示例。如果您正苦于以下问题:Java Scheme类的具体用法?Java Scheme怎么用?Java Scheme使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Scheme类属于cascading.scheme包,在下文中一共展示了Scheme类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OutputStreamTap
import cascading.scheme.Scheme; //导入依赖的package包/类
public OutputStreamTap(Scheme<Properties, ?, OutputStream, ?, ?> scheme, OutputStream os) {
super(scheme, SinkMode.UPDATE);
this.os = os;
}
示例2: createTap
import cascading.scheme.Scheme; //导入依赖的package包/类
public Tap createTap(Scheme scheme, String path, SinkMode sinkMode, Properties properties) {
if (!(scheme instanceof EsScheme)) {
throw new EsHadoopIllegalArgumentException("Unknown scheme; expected " + EsScheme.class.getName());
}
String host = properties.getProperty("host");
String portString = properties.getProperty("port");
int port = (StringUtils.hasText(portString) ? Integer.parseInt(portString) : -1);
String query = properties.getProperty("query");
return CascadingUtils.hadoopTap(host, port, path, query, ((EsScheme) scheme).fields, properties);
}
示例3: testCreateTap
import cascading.scheme.Scheme; //导入依赖的package包/类
@Test
public void testCreateTap() {
Fields fl = new Fields();
Properties props = new Properties();
Scheme scheme = factory.createScheme(fl, props);
Tap tap = factory.createTap(scheme, "somePath", SinkMode.KEEP, props);
assertThat(tap, notNullValue());
assertThat(tap.getClass().getName(), containsString("HadoopTap"));
}
示例4: TemplateScheme
import cascading.scheme.Scheme; //导入依赖的package包/类
public TemplateScheme(Scheme scheme, Fields pathFields) {
this.scheme = scheme;
if (pathFields == null || pathFields.isAll())
this.pathFields = null;
else if (pathFields.isDefined())
this.pathFields = pathFields;
else
throw new IllegalArgumentException(
"pathFields must be defined or the ALL substitution, got: "
+ pathFields.printVerbose());
}
示例5: createScheme
import cascading.scheme.Scheme; //导入依赖的package包/类
public Scheme createScheme(Fields fields, Properties properties) {
return new EsScheme(fields);
}
示例6: getDefaultIntermediateSchemeClass
import cascading.scheme.Scheme; //导入依赖的package包/类
@Override
protected Class<? extends Scheme> getDefaultIntermediateSchemeClass() {
return null; // not required for Flink
}
示例7: getTap
import cascading.scheme.Scheme; //导入依赖的package包/类
@Override
public Tap getTap(Scheme scheme, String filename, SinkMode mode) {
return new Hfs(scheme, filename, mode);
}
示例8: getTestConfigDefScheme
import cascading.scheme.Scheme; //导入依赖的package包/类
@Override
public Scheme getTestConfigDefScheme() {
return new FlinkConfigDefScheme( new Fields( "line" ));
}
示例9: getTestFailScheme
import cascading.scheme.Scheme; //导入依赖的package包/类
@Override
public Scheme getTestFailScheme() {
return new HadoopFailScheme( new Fields( "line" ) );
}
示例10: TestHfs
import cascading.scheme.Scheme; //导入依赖的package包/类
private TestHfs(@SuppressWarnings("rawtypes") Scheme<Configuration, RecordReader, OutputCollector, ?, ?> scheme,
String stringPath) {
super(scheme, stringPath);
}
示例11: execute
import cascading.scheme.Scheme; //导入依赖的package包/类
public void execute(String inputPath1, String inputPath2, String outputPath) {
// define source and sink Taps.
Scheme sourceScheme = new TextLine( new Fields( "line" ) );
Tap lhSource = new Hfs( sourceScheme, inputPath1 );
Tap rhSource = new Hfs( sourceScheme, inputPath2 );
Scheme sinkScheme = new TextLine( new Fields( "source", "line" ) );
Tap sink = new Hfs( sinkScheme, outputPath, SinkMode.REPLACE );
/*
Pipe lhs = new Pipe("lhs");
lhs = new Each(lhs, new Fields("source", "line"), )
String regex = "(left|right)[\\s]+(.*)";
Function function = new RegexGenerator( new Fields( "source", "line" ), regex );
assembly = new Each( assembly, new Fields( "line" ), function );
// group the Tuple stream by the "word" value
assembly = new GroupBy( assembly, new Fields( "source" ) );
// For every Tuple group
// count the number of occurrences of "word" and store result in
// a field named "count"
Aggregator count = new Count( new Fields( "count" ) );
assembly = new Every( assembly, count );
// initialize app properties, tell Hadoop which jar file to use
Properties properties = new Properties();
FlowConnector.setApplicationJarClass( properties, WordCountCascading.class );
// plan a new Flow from the assembly using the source and sink Taps
// with the above properties
FlowConnector flowConnector = new FlowConnector( properties );
Flow flow = flowConnector.connect( "word-count", source, sink, assembly );
// execute the flow, block until complete
flow.complete();
*/
}
示例12: VersionedTap
import cascading.scheme.Scheme; //导入依赖的package包/类
public VersionedTap(String dir, Scheme<JobConf,RecordReader,OutputCollector,?,?> scheme, TapMode mode)
throws IOException {
super(scheme, dir);
this.mode = mode;
}
示例13: tsv
import cascading.scheme.Scheme; //导入依赖的package包/类
static protected Scheme tsv() {
return tsv(Fields.ALL);
}