@Override public void run() { jobProgressTracker.logError(logLine); } });
private void validateConfiguration(GiraphConfiguration configuration) { // Perform Giraph's validation code GiraphConfigurationValidator<?, ?, ?, ?, ?> gtv = new GiraphConfigurationValidator(configuration); gtv.validateConfiguration(); // TODO: Do our own validation }
@Override public void run() { jobProgressTracker.logInfo(logLine); } });
/** * Make sure that all registered classes have matching types. This * is a little tricky due to type erasure, cannot simply get them from * the class type arguments. Also, set the vertex index, vertex value, * edge value and message value classes. */ public void validateConfiguration() { checkConfiguration(); verifyOutEdgesGenericTypes(); verifyVertexInputFormatGenericTypes(); verifyEdgeInputFormatGenericTypes(); verifyVertexOutputFormatGenericTypes(); verifyEdgeOutputFormatGenericTypes(); verifyVertexResolverGenericTypes(); verifyVertexValueCombinerGenericTypes(); verifyMessageCombinerGenericTypes(); verifyVertexValueFactoryGenericTypes(); }
protected GiraphJob getJob(GiraphConfiguration conf, String jobName) throws IOException { return new GiraphJob(conf, jobName); }
/** * Create a TaskAttemptContext, supporting many Hadoops. * * @return TaskAttemptContext */ public static TaskAttemptContext makeTaskAttemptContext() { return makeTaskAttemptContext(new Configuration()); }
/** * Create a JobContext, supporting many Hadoops. * * @return JobContext */ public static JobContext makeJobContext() { return makeJobContext(new Configuration()); } }
@Override public void run() { jobProgressTracker.updateProgress(workerProgress); } });
/** * Constructor. * * @param giraphConfiguration User-defined configuration * @param jobName User-defined job name * @throws IOException */ public GiraphJob(GiraphConfiguration giraphConfiguration, String jobName) throws IOException { this.jobName = jobName; this.giraphConfiguration = giraphConfiguration; this.delegatedJob = new DelegatedJob(giraphConfiguration); }
@Override public void run() { jobProgressTracker.mapperStarted(); } });
@Override public void run() { jobProgressTracker.logFailure(reason); } });
@Override public void init(GiraphConfiguration conf, GiraphJobObserver jobObserver) { this.conf = conf; this.jobObserver = jobObserver; if (LOG.isInfoEnabled()) { LOG.info("Waiting for job to start... (this may take a minute)"); } startWriterThread(); }
/** Verify matching generic types in OutEdges. */ private void verifyOutEdgesGenericTypes() { Class<? extends OutEdges<I, E>> outEdgesClass = conf.getOutEdgesClass(); Class<? extends OutEdges<I, E>> inputOutEdgesClass = conf.getInputOutEdgesClass(); verifyOutEdgesGenericTypesClass(outEdgesClass); verifyOutEdgesGenericTypesClass(inputOutEdgesClass); }
/** * Call this to log a line to command line of the job. Use in moderation - * it's a synchronous call to Job client * * @param line Line to print */ public final void logToCommandLine(String line) { serviceWorker.getJobProgressTracker().logInfo(line); }
/** * Create a TaskAttemptContext, supporting many Hadoops. * * @param conf Configuration * @param taskAttemptContext Use TaskAttemptID from this object * @return TaskAttemptContext */ public static TaskAttemptContext makeTaskAttemptContext(Configuration conf, TaskAttemptContext taskAttemptContext) { return makeTaskAttemptContext(conf, taskAttemptContext.getTaskAttemptID()); }
/** * Create a JobContext, supporting many Hadoops. * * @param conf Configuration * @param jobContext Use JobID from this object * @return JobContext */ public static JobContext makeJobContext(Configuration conf, JobContext jobContext) { return makeJobContext(conf, jobContext.getJobID()); }
/** * Update worker progress and send it */ private void updateAndSendProgress() { WorkerProgress.get().updateMemory(); jobProgressTracker.updateProgress(WorkerProgress.get()); }
/** * Call this to log a line to command line of the job. Use in moderation - * it's a synchronous call to Job client * * @param line Line to print */ public void logToCommandLine(String line) { serviceMaster.getJobProgressTracker().logInfo(line); }
/** * Create a TaskAttemptContext, supporting many Hadoops. * * @param conf Configuration * @return TaskAttemptContext */ public static TaskAttemptContext makeTaskAttemptContext(Configuration conf) { return makeTaskAttemptContext(conf, new TaskAttemptID()); }
/** * Create a JobContext, supporting many Hadoops. * * @param conf Configuration * @return JobContext */ public static JobContext makeJobContext(Configuration conf) { return makeJobContext(conf, new JobID()); }