本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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");
}
}
示例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);
}
示例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);
}
示例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();
}
示例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 );
}
示例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);
}
示例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);
}
示例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());
}
示例14: sourceCleanup
import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourceCleanup( FlowProcess<JobConf> flowProcess, SourceCall<Object[], RecordReader> sourceCall )
{
sourceCall.setContext( null );
}
示例15: sourceCleanup
import cascading.scheme.SourceCall; //导入方法依赖的package包/类
@Override
public void sourceCleanup( FlowProcess<JobConf> flowProcess, SourceCall<Object[], RecordReader> sourceCall ) {
sourceCall.setContext( null );
}