Initial import into git.
[galago.git] / java / pig-galago / src / com / yahoo / pig / impl / physicalLayer / PORead.java
blob8f09cf1dc85dcd6df6bc2d416ff1ca515bfdf379
1 /*
2 * Copyright (c) 2007 Yahoo! Inc. All rights reserved.
3 * See accompanying LICENSE file.
4 */
5 package com.yahoo.pig.impl.physicalLayer;
7 import java.io.IOException;
8 import java.util.Iterator;
10 import com.yahoo.pig.data.DataBag;
11 import com.yahoo.pig.data.Tuple;
13 public class PORead extends PhysicalOperator {
14 DataBag bag;
15 Iterator<Tuple> it;
17 public PORead(DataBag bagIn, int outputType) {
18 super(outputType);
19 inputs = new PhysicalOperator[0];
21 bag = bagIn;
23 it = null;
26 public boolean open(boolean continueFromLast) throws IOException {
27 if (continueFromLast){
28 throw new RuntimeException("LOReads should not occur in continuous plans");
30 it = bag.content();
32 return true;
35 public Tuple getNext() throws IOException {
36 if (it.hasNext())
37 return it.next();
38 else
39 return null;