本文整理汇总了Java中org.apache.hadoop.mapreduce.Reducer.Context.getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java Context.getConfiguration方法的具体用法?Java Context.getConfiguration怎么用?Java Context.getConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.mapreduce.Reducer.Context
的用法示例。
在下文中一共展示了Context.getConfiguration方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import org.apache.hadoop.mapreduce.Reducer.Context; //导入方法依赖的package包/类
@Override
public void setup(Context context) throws IOException{
//get job configuration
Configuration conf = context.getConfiguration();
columns = Arrays.stream(conf.getStrings("columns"))
.map( s -> Integer.parseInt(s)).toArray(Integer[]::new);
k = (int) conf.getInt("k", 10);
currentIteration = conf.getInt("currentIteration", 0);
lastIteration = conf.getBoolean("lastIteration", false);
mos = new MultipleOutputs(context);
}
示例2: getDate
import org.apache.hadoop.mapreduce.Reducer.Context; //导入方法依赖的package包/类
/**
* @param context Reducer context
* @return a YYYY-MM-DD datestring based on the configured startdate, enddates
* and the reducer number.
*/
public static String getDate(Context context) {
Configuration conf = context.getConfiguration();
int reducer = ContextTools.getTaskID(context);
long start = conf.getLong(starttimelabel, 0) + reducer * secperday;
return DateTools.FORMAT.Y_M_D.formatEpoch(start);
}
示例3: MemStoreWrapper
import org.apache.hadoop.mapreduce.Reducer.Context; //导入方法依赖的package包/类
public MemStoreWrapper(Context context, FileSystem fs, HTable table, HColumnDescriptor hcd,
MemStore memstore, CacheConfig cacheConfig) throws IOException {
this.memstore = memstore;
this.context = context;
this.fs = fs;
this.table = table;
this.hcd = hcd;
this.conf = context.getConfiguration();
this.cacheConfig = cacheConfig;
flushSize = this.conf.getLong(MobConstants.MOB_COMPACTION_MEMSTORE_FLUSH_SIZE,
HTableDescriptor.DEFAULT_MEMSTORE_FLUSH_SIZE);
mobFamilyDir = MobUtils.getMobFamilyPath(conf, table.getName(), hcd.getNameAsString());
}