Initial import into git.
[galago.git] / java / pig-galago / src / com / yahoo / pig / EvalFunc.java
blob549254d8113cca1cc8f582ae19b74282e25b12f5
1 /*
2 * Copyright (c) 2007 Yahoo! Inc. All rights reserved.
3 * See accompanying LICENSE file.
4 */
5 package com.yahoo.pig;
7 import java.io.IOException;
9 import com.yahoo.pig.impl.logicalLayer.schema.SchemaItem;
10 import com.yahoo.pig.impl.mapreduceExec.PigMapReduce;
12 /**
13 * The class is used to implement functions to be applied to
14 * a dataset. The function is applied to each Tuple in the set.
15 * The programmer should not make assumptions about state maintained
16 * between invocations of the invoke() method since the Pig runtime
17 * will schedule and localize invocations based on information provided
18 * at runtime.
20 * @author database-systems@yahoo.research
23 public abstract class EvalFunc extends InstantiatedFunc {
25 // report that progress is being made (otherwise hadoop times out after 600 seconds working on one outer tuple)
26 protected void progress() {
27 if (PigMapReduce.reporter != null) {
28 PigMapReduce.reporter.progress();
32 /**
33 * Returns the String representation of the function.
35 public String toString() {
36 return getName();
39 public SchemaItem outputSchema() {
40 return null;