当前位置: 首页>>代码示例>>Java>>正文


Java Scheme类代码示例

本文整理汇总了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;
}
 
开发者ID:xushjie1987,项目名称:es-hadoop-v2.2.0,代码行数:5,代码来源:OutputStreamTap.java

示例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);
}
 
开发者ID:xushjie1987,项目名称:es-hadoop-v2.2.0,代码行数:13,代码来源:EsFactory.java

示例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"));
}
 
开发者ID:xushjie1987,项目名称:es-hadoop-v2.2.0,代码行数:11,代码来源:EsFactoryTest.java

示例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());
}
 
开发者ID:guokr,项目名称:hebo,代码行数:13,代码来源:BaseTemplateTap.java

示例5: createScheme

import cascading.scheme.Scheme; //导入依赖的package包/类
public Scheme createScheme(Fields fields, Properties properties) {
    return new EsScheme(fields);
}
 
开发者ID:xushjie1987,项目名称:es-hadoop-v2.2.0,代码行数:4,代码来源:EsFactory.java

示例6: getDefaultIntermediateSchemeClass

import cascading.scheme.Scheme; //导入依赖的package包/类
@Override
protected Class<? extends Scheme> getDefaultIntermediateSchemeClass() {
	return null; // not required for Flink
}
 
开发者ID:dataArtisans,项目名称:cascading-flink,代码行数:5,代码来源:FlinkConnector.java

示例7: getTap

import cascading.scheme.Scheme; //导入依赖的package包/类
@Override
public Tap getTap(Scheme scheme, String filename, SinkMode mode) {
	return new Hfs(scheme, filename, mode);
}
 
开发者ID:dataArtisans,项目名称:cascading-flink,代码行数:5,代码来源:FlinkTestPlatform.java

示例8: getTestConfigDefScheme

import cascading.scheme.Scheme; //导入依赖的package包/类
@Override
public Scheme getTestConfigDefScheme() {
	return new FlinkConfigDefScheme( new Fields( "line" ));
}
 
开发者ID:dataArtisans,项目名称:cascading-flink,代码行数:5,代码来源:FlinkTestPlatform.java

示例9: getTestFailScheme

import cascading.scheme.Scheme; //导入依赖的package包/类
@Override
public Scheme getTestFailScheme() {
	return new HadoopFailScheme( new Fields( "line" ) );
}
 
开发者ID:dataArtisans,项目名称:cascading-flink,代码行数:5,代码来源:FlinkTestPlatform.java

示例10: TestHfs

import cascading.scheme.Scheme; //导入依赖的package包/类
private TestHfs(@SuppressWarnings("rawtypes") Scheme<Configuration, RecordReader, OutputCollector, ?, ?> scheme,
    String stringPath) {
  super(scheme, stringPath);
}
 
开发者ID:HotelsDotCom,项目名称:plunger,代码行数:5,代码来源:TapTypeUtilTest.java

示例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();    
        */    
    }
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:42,代码来源:BigDiffCascading.java

示例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;
}
 
开发者ID:indix,项目名称:dfs-datastores,代码行数:6,代码来源:VersionedTap.java

示例13: tsv

import cascading.scheme.Scheme; //导入依赖的package包/类
static protected Scheme tsv() {
  return tsv(Fields.ALL);
}
 
开发者ID:vijaykramesh,项目名称:sponges_and_filters,代码行数:4,代码来源:TapFactory.java


注:本文中的cascading.scheme.Scheme类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。