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


Java SourceCall.setContext方法代码示例

本文整理汇总了Java中cascading.scheme.SourceCall.setContext方法的典型用法代码示例。如果您正苦于以下问题:Java SourceCall.setContext方法的具体用法?Java SourceCall.setContext怎么用?Java SourceCall.setContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cascading.scheme.SourceCall的用法示例。


在下文中一共展示了SourceCall.setContext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourcePrepare(FlowProcess<Properties> flowProcess, SourceCall<Object[], ScrollQuery> sourceCall) throws IOException {
    super.sourcePrepare(flowProcess, sourceCall);

    Object[] context = new Object[1];
    Settings settings = HadoopSettingsManager.loadFrom(flowProcess.getConfigCopy()).merge(props);
    context[0] = CascadingUtils.alias(settings);
    sourceCall.setContext(context);
    IS_ES_20 = SettingsUtils.isEs20(settings);
}
 
开发者ID:xushjie1987,项目名称:es-hadoop-v2.2.0,代码行数:11,代码来源:EsLocalScheme.java

示例2: sourceCleanup

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourceCleanup(FlowProcess<Properties> flowProcess, SourceCall<Object[], ScrollQuery> sourceCall) throws IOException {
    // in case of a source there's no local client so do all reporting here
    report(sourceCall.getInput().stats(), flowProcess);
    report(sourceCall.getInput().repository().stats(), flowProcess);
    sourceCall.getInput().close();
    sourceCall.setContext(null);
    // used for consistency
    cleanupClient(flowProcess);
}
 
开发者ID:xushjie1987,项目名称:es-hadoop-v2.2.0,代码行数:11,代码来源:EsLocalScheme.java

示例3: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourcePrepare(FlowProcess<JobConf> flowProcess, SourceCall<Object[], RecordReader> sourceCall) throws IOException {
    super.sourcePrepare(flowProcess, sourceCall);

    Object[] context = new Object[3];
    context[0] = sourceCall.getInput().createKey();
    context[1] = sourceCall.getInput().createValue();
    // as the tuple _might_ vary (some objects might be missing), we use a map rather then a collection
    Settings settings = loadSettings(flowProcess.getConfigCopy(), true);
    context[2] = CascadingUtils.alias(settings);
    sourceCall.setContext(context);
    IS_ES_20 = SettingsUtils.isEs20(settings);
}
 
开发者ID:xushjie1987,项目名称:es-hadoop-v2.2.0,代码行数:14,代码来源:EsHadoopScheme.java

示例4: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourcePrepare(FlowProcess<JobConf> flowProcess, SourceCall<Object[], RecordReader> sourceCall) throws IOException {
  initIndices();
  if (sourceCall.getContext() == null) {
    sourceCall.setContext(new Object[2]);
  }
  sourceCall.getContext()[0] = sourceCall.getInput().createKey();
  sourceCall.getContext()[1] = sourceCall.getInput().createValue();
}
 
开发者ID:datascienceinc,项目名称:cascading.csv,代码行数:10,代码来源:CsvScheme.java

示例5: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourcePrepare(final FlowProcess<JobConf> flowProcess, final SourceCall<Object[], RecordReader> sourceCall) {
    sourceCall.setContext(new Object[4]);
    sourceCall.getContext()[0] = sourceCall.getInput().createKey();
    sourceCall.getContext()[1] = sourceCall.getInput().createValue();
    sourceCall.getContext()[2] = Charset.forName(charsetName);
    sourceCall.getContext()[3] = createCsvParser();
}
 
开发者ID:tresata,项目名称:cascading-opencsv,代码行数:9,代码来源:OpenCsvScheme.java

示例6: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourcePrepare(FlowProcess<JobConf> flowProcess,
                          SourceCall<Object[], RecordReader> sourceCall) {
    Object[] pair =
            new Object[]{sourceCall.getInput().createKey(), sourceCall.getInput().createValue()};

    sourceCall.setContext(pair);

    try {
        // Skip the header
        sourceCall.getInput().next(pair[0],pair[1]);
    } catch (IOException e) {
        throw new RuntimeException("Could not skip the header");
    }
}
 
开发者ID:yolodata,项目名称:tbana,代码行数:16,代码来源:SplunkScheme.java

示例7: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourcePrepare(FlowProcess<Properties> flowProcess, SourceCall<Object[], ScrollQuery> sourceCall) throws IOException {
    super.sourcePrepare(flowProcess, sourceCall);

    Object[] context = new Object[SRC_CTX_SIZE];
    Settings settings = HadoopSettingsManager.loadFrom(flowProcess.getConfigCopy()).merge(props);
    context[SRC_CTX_ALIASES] = CascadingUtils.alias(settings);
    context[SRC_CTX_OUTPUT_JSON] = settings.getOutputAsJson();
    sourceCall.setContext(context);
}
 
开发者ID:elastic,项目名称:elasticsearch-hadoop,代码行数:11,代码来源:EsLocalScheme.java

示例8: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourcePrepare(FlowProcess<JobConf> flowProcess, SourceCall<Object[], RecordReader> sourceCall) throws IOException {
    super.sourcePrepare(flowProcess, sourceCall);

    Object[] context = new Object[SRC_CTX_SIZE];
    context[SRC_CTX_KEY] = sourceCall.getInput().createKey();
    context[SRC_CTX_VALUE] = sourceCall.getInput().createValue();
    // as the tuple _might_ vary (some objects might be missing), we use a map rather then a collection
    Settings settings = loadSettings(flowProcess.getConfigCopy(), true);
    context[SRC_CTX_ALIASES] = CascadingUtils.alias(settings);
    context[SRC_CTX_OUTPUT_JSON] = settings.getOutputAsJson();
    sourceCall.setContext(context);
}
 
开发者ID:elastic,项目名称:elasticsearch-hadoop,代码行数:14,代码来源:EsHadoopScheme.java

示例9: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourcePrepare(FlowProcess<JobConf> flowProcess,
    SourceCall<Object[], RecordReader> sourceCall) {
  sourceCall.setContext(new Object[2]);

  sourceCall.getContext()[0] = sourceCall.getInput().createKey();
  sourceCall.getContext()[1] = sourceCall.getInput().createValue();
}
 
开发者ID:indix,项目名称:dfs-datastores,代码行数:9,代码来源:RawSequenceFile.java

示例10: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourcePrepare( FlowProcess<JobConf> flowProcess, SourceCall<Object[], RecordReader> sourceCall )
{
    Object[] pair = new Object[]{sourceCall.getInput().createKey(), sourceCall.getInput().createValue()};

    sourceCall.setContext( pair );
}
 
开发者ID:ParallelAI,项目名称:SpyGlass,代码行数:8,代码来源:JDBCScheme.java

示例11: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourcePrepare(FlowProcess<JobConf> flowProcess,
    SourceCall<Object[], RecordReader> sourceCall) {
  Object[] pair =
      new Object[]{sourceCall.getInput().createKey(), sourceCall.getInput().createValue()};

  sourceCall.setContext(pair);
}
 
开发者ID:ParallelAI,项目名称:SpyGlass,代码行数:9,代码来源:HBaseScheme.java

示例12: sourceCleanup

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourceCleanup(FlowProcess<JobConf> flowProcess, SourceCall<Object[], RecordReader> sourceCall) throws IOException {
    super.sourceCleanup(flowProcess, sourceCall);

    sourceCall.setContext(null);
}
 
开发者ID:xushjie1987,项目名称:es-hadoop-v2.2.0,代码行数:7,代码来源:EsHadoopScheme.java

示例13: sourcePrepare

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
/**
 * Creates an {@link Corc} instance and stores it in the context to be reused for all rows.
 */
@Override
public void sourcePrepare(FlowProcess<? extends Configuration> flowProcess, SourceCall<Corc, RecordReader> sourceCall)
    throws IOException {
  sourceCall.setContext((Corc) sourceCall.getInput().createValue());
}
 
开发者ID:HotelsDotCom,项目名称:corc,代码行数:9,代码来源:OrcFile.java

示例14: sourceCleanup

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourceCleanup( FlowProcess<JobConf> flowProcess, SourceCall<Object[], RecordReader> sourceCall )
{
    sourceCall.setContext( null );
}
 
开发者ID:yolodata,项目名称:tbana,代码行数:6,代码来源:ShuttlCsv.java

示例15: sourceCleanup

import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourceCleanup( FlowProcess<JobConf> flowProcess, SourceCall<Object[], RecordReader> sourceCall ) {
    sourceCall.setContext( null );
}
 
开发者ID:ParallelAI,项目名称:SpyGlass,代码行数:5,代码来源:JDBCScheme.java


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