}
return false;
}
private BSPJob setupJob() throws IOException {
BSPJob job = new BSPJob(conf, OnlineCF.class);
String input = conf.get(OnlineCF.Settings.CONF_INPUT_PATH, null);
String output = conf.get(OnlineCF.Settings.CONF_OUTPUT_PATH, null);
Path in = new Path(input);
Path out = new Path(output);
if (conf.getInt(OnlineCF.Settings.CONF_MATRIX_RANK, -1) == -1) {
conf.setInt(OnlineCF.Settings.CONF_MATRIX_RANK, OnlineCF.Settings.DFLT_MATRIX_RANK);
}
if (conf.getInt(OnlineCF.Settings.CONF_ITERATION_COUNT, -1) == -1) {
conf.setInt(OnlineCF.Settings.CONF_ITERATION_COUNT, OnlineCF.Settings.DFLT_ITERATION_COUNT);
}
if (conf.getInt(OnlineCF.Settings.CONF_SKIP_COUNT, -1) == -1) {
conf.setInt(OnlineCF.Settings.CONF_SKIP_COUNT, OnlineCF.Settings.DFLT_SKIP_COUNT);
}
if (conf.getClass(OnlineCF.Settings.CONF_ONLINE_UPDATE_FUNCTION, null) == null) {
conf.setClass(OnlineCF.Settings.CONF_ONLINE_UPDATE_FUNCTION, OnlineCF.Settings.DFLT_UPDATE_FUNCTION,
OnlineUpdate.Function.class);
}
conf.set(OnlineCF.Settings.CONF_MODEL_USER_DELIM, OnlineCF.Settings.DFLT_MODEL_USER_DELIM);
conf.set(OnlineCF.Settings.CONF_MODEL_USER_FEATURE_DELIM, OnlineCF.Settings.DFLT_MODEL_USER_MTX_FEATURES_DELIM);
conf.set(OnlineCF.Settings.CONF_MODEL_ITEM_DELIM, OnlineCF.Settings.DFLT_MODEL_ITEM_DELIM);
conf.set(OnlineCF.Settings.CONF_MODEL_ITEM_FEATURE_DELIM, OnlineCF.Settings.DFLT_MODEL_ITEM_MTX_FEATURES_DELIM);
job.setJobName("Online CF");
job.setBoolean(Constants.ENABLE_RUNTIME_PARTITIONING, true);
job.setPartitioner(HashPartitioner.class);
job.setBspClass(OnlineTrainBSP.class);
job.setInputPath(in);
job.setInputFormat(SequenceFileInputFormat.class);
job.setInputKeyClass(Text.class);
job.setInputValueClass(VectorWritable.class);
job.setOutputPath(out);
job.setOutputFormat(SequenceFileOutputFormat.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(VectorWritable.class);
job.setNumBspTask(conf.getInt(OnlineCF.Settings.CONF_TASK_COUNT, job.getNumBspTask()));
return job;
}