/*
 * Copyright 2009-2010 by The Regents of the University of California
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * you may obtain a copy of the License from
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package edu.uci.ics.hyracks.api.dataset;

import java.io.Serializable;

import edu.uci.ics.hyracks.api.comm.NetworkAddress;

public class DatasetDirectoryRecord implements Serializable {
    private static final long serialVersionUID = 1L;

    private NetworkAddress address;

    private boolean eos;

    public DatasetDirectoryRecord() {
        this.address = null;
        this.eos = false;
    }

    public void setNetworkAddress(NetworkAddress address) {
        this.address = address;
    }

    public NetworkAddress getNetworkAddress() {
        return address;
    }

    public void setEOS(boolean eos) {
        this.eos = eos;
    }

    public boolean getEOS() {
        return eos;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof DatasetDirectoryRecord)) {
            return false;
        }
        return address.equals(((DatasetDirectoryRecord) o).address);
    }
}
@@ -816,16 +816,111 @@
 zable %7B%0A
+    public enum Status %7B%0A        IDLE,%0A        RUNNING,%0A        SUCCESS,%0A        FAILED%0A    %7D%0A%0A
     priv
@@ -1022,18 +1022,50 @@
 boolean 
-eo
+readEOS;%0A%0A    private Status statu
 s;%0A%0A    
@@ -1140,19 +1140,23 @@
    this.
-eos
+readEOS
  = false
@@ -1153,24 +1153,59 @@
 OS = false;%0A
+        this.status = Status.IDLE;%0A
     %7D%0A%0A    p
@@ -1397,86 +1397,354 @@
 oid 
-setEOS(boolean eos) %7B%0A        this.eos = eos;%0A    %7D%0A%0A    public boolean getEOS
+readEOS() %7B%0A        this.readEOS = true;%0A    %7D%0A%0A    public boolean hasReachedReadEOS() %7B%0A        return readEOS;%0A    %7D%0A%0A    public void start() %7B%0A        status = Status.RUNNING;%0A    %7D%0A%0A    public void writeEOS() %7B%0A        status = Status.SUCCESS;%0A    %7D%0A%0A    public void fail() %7B%0A        status = Status.FAILED;%0A    %7D%0A%0A    public Status getStatus
 () %7B
@@ -1759,18 +1759,21 @@
  return 
-eo
+statu
 s;%0A    %7D
@@ -2052,8 +2052,9 @@
 %0A    %7D%0A%7D
+%0A

Add support for storing result status for a job in the dataset directory record.