Initial import into git.
[galago.git] / java / pig-galago / src / com / yahoo / pig / impl / logicalLayer / LogicalOperator.java
blob850517b1718aa2fda0d6822163377954b33a5002
1 /*
2 * Copyright (c) 2007 Yahoo! Inc. All rights reserved.
3 * See accompanying LICENSE file.
4 */
5 package com.yahoo.pig.impl.logicalLayer;
7 import java.util.LinkedList;
8 import java.util.List;
10 import com.yahoo.pig.impl.PigContext;
11 import com.yahoo.pig.impl.logicalLayer.schema.SchemaItem;
12 import com.yahoo.pig.impl.logicalLayer.schema.SchemaItemList;
14 abstract public class LogicalOperator {
15 public String alias = null;
17 public static final int FIXED = 1;
18 public static final int MONOTONE = 2;
19 public static final int UPDATABLE = 3; // Reserved for future use
20 public static final int AMENDABLE = 4;
22 public LogicalOperator[] inputs;
23 public int requestedParallelism = -1;
24 public SchemaItemList schema = null;
25 public PigContext pigContext;
27 protected LogicalOperator(PigContext pigContext) {
28 this.pigContext = pigContext;
31 public abstract SchemaItemList outputSchema();
33 public String name() {
34 return "ROOT";
37 public LogicalOperator[] children() {
38 return inputs;
41 public String arguments() {
42 return "";
45 public List<String> getFuncs() {
46 List<String> funcs = new LinkedList<String>();
47 for (int i = 0; i < inputs.length; i++) {
48 funcs.addAll(inputs[i].getFuncs());
50 return funcs;
53 public abstract int getOutputType();