2 * Copyright (c) 2007 Yahoo! Inc. All rights reserved.
3 * See accompanying LICENSE file.
5 package com
.yahoo
.pig
.impl
.physicalLayer
;
7 import java
.io
.IOException
;
8 import java
.io
.Serializable
;
10 import com
.yahoo
.pig
.data
.Tuple
;
11 import com
.yahoo
.pig
.impl
.logicalLayer
.LogicalOperator
;
13 abstract public class PhysicalOperator
implements Serializable
{
15 public PhysicalOperator
[] inputs
= null;
20 * This constructor should go away when we eventually implement CQ even for the mapreduce exec type
22 public PhysicalOperator(){
23 outputType
= LogicalOperator
.FIXED
;
27 public PhysicalOperator(int outputType
){
28 this.outputType
= outputType
;
31 public boolean open(boolean continueFromLast
) throws IOException
{
32 // call open() on all inputs
34 for (int i
= 0; i
< inputs
.length
; i
++) {
35 if (!inputs
[i
].open(continueFromLast
))
42 abstract public Tuple
getNext() throws IOException
;
44 public void close() throws IOException
{
45 // call close() on all inputs
47 for (int i
= 0; i
< inputs
.length
; i
++)
51 public int getOutputType(){