asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [19/85] [abbrv] [partial] incubator-asterixdb-hyracks git commit: Move Pregelix and Hivesterix codebase to new repositories: 1. Move Pregelix codebase to https://github.com/pregelix/pregelix; 2. Move Hivesterix codebase to https://code.google.com/p/hives
Date Fri, 24 Apr 2015 18:45:46 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/VertexDelegate.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/VertexDelegate.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/VertexDelegate.java
deleted file mode 100644
index 846e6b5..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/VertexDelegate.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.graph;
-
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
-import edu.uci.ics.pregelix.api.io.Pointable;
-import edu.uci.ics.pregelix.api.util.FrameTupleUtils;
-
-@SuppressWarnings("rawtypes")
-class VertexDelegate<I extends WritableComparable, V extends Writable, E extends Writable, M extends Writable> {
-    /** Vertex id */
-    private I vertexId = null;
-    /** Vertex value */
-    private Vertex vertex = null;
-
-    /** message tuple builder */
-    private ArrayTupleBuilder message;
-    private IFrameWriter msgWriter;
-    private FrameTupleAppender appenderMsg;
-
-    /** alive tuple builder */
-    private ArrayTupleBuilder alive;
-    private IFrameWriter aliveWriter;
-    private FrameTupleAppender appenderAlive;
-
-    /** the tuple for insert */
-    private ArrayTupleBuilder insertTb;
-    private IFrameWriter insertWriter;
-    private FrameTupleAppender appenderInsert;
-
-    /** the tuple for insert */
-    private ArrayTupleBuilder deleteTb;
-    private IFrameWriter deleteWriter;
-    private FrameTupleAppender appenderDelete;
-
-    /** message list */
-    private MsgList dummyMessageList = new MsgList();
-    /** whether alive message should be pushed out */
-    private boolean pushAlive;
-
-    private boolean pointableMsg = false;
-
-    public VertexDelegate(Vertex vertex) {
-        this.vertex = vertex;
-    }
-
-    public void finishCompute() throws IOException {
-        // package alive info
-        if (pushAlive && !vertex.isHalted()) {
-            alive.reset();
-            DataOutput outputAlive = alive.getDataOutput();
-            vertexId.write(outputAlive);
-            alive.addFieldEndOffset();
-            dummyMessageList.write(outputAlive);
-            alive.addFieldEndOffset();
-            FrameTupleUtils.flushTuple(appenderAlive, alive, aliveWriter);
-        }
-    }
-
-    public final void sendMsg(I id, M msg) {
-        if (msg == null) {
-            throw new IllegalArgumentException("sendMsg: Cannot send null message to " + id);
-        }
-
-        /**
-         * send out message along message channel
-         */
-        try {
-            if (pointableMsg) {
-                FrameTupleUtils.flushPointableKeyValueTuple(appenderMsg, msgWriter, (Pointable) id, (Pointable) msg);
-            } else {
-                if ((id instanceof Pointable) && (msg instanceof Pointable)) {
-                    FrameTupleUtils
-                            .flushPointableKeyValueTuple(appenderMsg, msgWriter, (Pointable) id, (Pointable) msg);
-                    pointableMsg = true;
-                } else {
-                    message.reset();
-                    DataOutput outputMsg = message.getDataOutput();
-                    id.write(outputMsg);
-                    message.addFieldEndOffset();
-                    msg.write(outputMsg);
-                    message.addFieldEndOffset();
-                    FrameTupleUtils.flushTuple(appenderMsg, message, msgWriter);
-                }
-            }
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    public final void setVertex(Vertex vertex) {
-        this.vertex = vertex;
-    }
-
-    public final void setVertexId(I vertexId) {
-        this.vertexId = vertexId;
-    }
-
-    public final void addVertex(I vertexId, Vertex vertex) {
-        try {
-            insertTb.reset();
-            DataOutput outputInsert = insertTb.getDataOutput();
-            vertexId.write(outputInsert);
-            insertTb.addFieldEndOffset();
-            vertex.write(outputInsert);
-            insertTb.addFieldEndOffset();
-            FrameTupleUtils.flushTuple(appenderInsert, insertTb, insertWriter);
-
-            /**
-             * push alive when necessary
-             */
-            if (pushAlive && !vertex.isHalted()) {
-                alive.reset();
-                DataOutput outputAlive = alive.getDataOutput();
-                vertexId.write(outputAlive);
-                alive.addFieldEndOffset();
-                dummyMessageList.write(outputAlive);
-                alive.addFieldEndOffset();
-                FrameTupleUtils.flushTuple(appenderAlive, alive, aliveWriter);
-            }
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    public final void deleteVertex(I vertexId) {
-        try {
-            deleteTb.reset();
-            DataOutput outputDelete = deleteTb.getDataOutput();
-            vertexId.write(outputDelete);
-            deleteTb.addFieldEndOffset();
-            FrameTupleUtils.flushTuple(appenderDelete, deleteTb, deleteWriter);
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    public final void setOutputWriters(List<IFrameWriter> outputs) {
-        msgWriter = outputs.get(0);
-        insertWriter = outputs.get(1);
-        deleteWriter = outputs.get(2);
-        if (outputs.size() > 3) {
-            aliveWriter = outputs.get(outputs.size() - 1);
-            pushAlive = true;
-        }
-    }
-
-    public final void setOutputAppenders(List<FrameTupleAppender> appenders) {
-        appenderMsg = appenders.get(0);
-        appenderInsert = appenders.get(1);
-        appenderDelete = appenders.get(2);
-        if (appenders.size() > 3) {
-            appenderAlive = appenders.get(appenders.size() - 1);
-        }
-    }
-
-    public final void setOutputTupleBuilders(List<ArrayTupleBuilder> tbs) {
-        message = tbs.get(0);
-        insertTb = tbs.get(1);
-        deleteTb = tbs.get(2);
-        if (tbs.size() > 3) {
-            alive = tbs.get(tbs.size() - 1);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/VertexPartitioner.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/VertexPartitioner.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/VertexPartitioner.java
deleted file mode 100644
index f51ad88..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/VertexPartitioner.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.graph;
-
-import org.apache.hadoop.io.WritableComparable;
-
-/**
- * Users can extend this class to implement the desired vertex partitioning behavior.
- * 
- * @author yingyib
- */
-@SuppressWarnings("rawtypes")
-public abstract class VertexPartitioner<I extends WritableComparable> {
-
-    /**
-     * @param vertexId
-     *            The input vertex id.
-     * @param nPartitions
-     *            The total number of partitions.
-     * @return The partition id.
-     */
-    public abstract int getPartitionId(I vertexId, int nPartitions);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/BasicGenInputSplit.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/BasicGenInputSplit.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/BasicGenInputSplit.java
deleted file mode 100644
index f63b3a5..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/BasicGenInputSplit.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.mapreduce.lib.input.FileSplit;
-
-/**
- * This InputSplit will not give any ordering or location data. It is used
- * internally by BspInputFormat (which determines how many tasks to run the
- * application on). Users should not use this directly.
- */
-public class BasicGenInputSplit extends FileSplit implements Writable,
-		Serializable {
-	private static final long serialVersionUID = 1L;
-	/** Number of splits */
-	private int numSplits = -1;
-	/** Split index */
-	private int splitIndex = -1;
-
-	public BasicGenInputSplit() {
-		super(null, 0, 0, null);
-	}
-
-	public BasicGenInputSplit(int splitIndex, int numSplits) {
-		super(null, 0, 0, null);
-		this.splitIndex = splitIndex;
-		this.numSplits = numSplits;
-	}
-
-	@Override
-	public long getLength() {
-		return 0;
-	}
-
-	@Override
-	public String[] getLocations() throws IOException {
-		return new String[] {};
-	}
-
-	@Override
-	public void readFields(DataInput in) throws IOException {
-		splitIndex = in.readInt();
-		numSplits = in.readInt();
-	}
-
-	@Override
-	public void write(DataOutput out) throws IOException {
-		out.writeInt(splitIndex);
-		out.writeInt(numSplits);
-	}
-
-	public int getSplitIndex() {
-		return splitIndex;
-	}
-
-	public int getNumSplits() {
-		return numSplits;
-	}
-
-	@Override
-	public String toString() {
-		return "'" + getClass().getCanonicalName() + ", index="
-				+ getSplitIndex() + ", num=" + getNumSplits();
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/Pointable.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/Pointable.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/Pointable.java
deleted file mode 100644
index 4217098..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/Pointable.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io;
-
-public interface Pointable {
-
-    public byte[] getByteArray();
-
-    public int getStartOffset();
-
-    public int getLength();
-    
-    public int set(byte[] data, int offset);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/Sizable.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/Sizable.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/Sizable.java
deleted file mode 100644
index 568500b..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/Sizable.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io;
-
-/**
- * @author yingyib
- */
-public interface Sizable {
-
-    public int sizeInBytes();
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexInputFormat.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexInputFormat.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexInputFormat.java
deleted file mode 100644
index 73af190..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexInputFormat.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-
-/**
- * Use this to load data for a BSP application. Note that the InputSplit must
- * also implement Writable. The InputSplits will determine the partitioning of
- * vertices across the mappers, so keep that in consideration when implementing
- * getSplits().
- * 
- * @param <I>
- *            Vertex id
- * @param <V>
- *            Vertex value
- * @param <E>
- *            Edge value
- * @param <M>
- *            Message data
- */
-@SuppressWarnings("rawtypes")
-public abstract class VertexInputFormat<I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable> {
-    /**
-     * Logically split the vertices for a graph processing application.
-     * Each {@link InputSplit} is then assigned to a worker for processing.
-     * <p>
-     * <i>Note</i>: The split is a <i>logical</i> split of the inputs and the input files are not physically split into chunks. For e.g. a split could be <i>&lt;input-file-path, start, offset&gt;</i> tuple. The InputFormat also creates the {@link VertexReader} to read the {@link InputSplit}. Also, the number of workers is a hint given to the developer to try to intelligently determine how many splits to create (if this is adjustable) at runtime.
-     * 
-     * @param context
-     *            Context of the job
-     * @param numWorkers
-     *            Number of workers used for this job
-     * @return an array of {@link InputSplit}s for the job.
-     */
-    public abstract List<InputSplit> getSplits(JobContext context, int numWorkers) throws IOException,
-            InterruptedException;
-
-    /**
-     * Create a vertex reader for a given split. The framework will call {@link VertexReader#initialize(InputSplit, TaskAttemptContext)} before
-     * the split is used.
-     * 
-     * @param split
-     *            the split to be read
-     * @param context
-     *            the information about the task
-     * @return a new record reader
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    public abstract VertexReader<I, V, E, M> createVertexReader(InputSplit split, TaskAttemptContext context)
-            throws IOException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexOutputFormat.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexOutputFormat.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexOutputFormat.java
deleted file mode 100644
index 6fb775a..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexOutputFormat.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.OutputCommitter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-
-/**
- * Implement to output the graph after the computation. It is modeled directly
- * after the Hadoop OutputFormat.
- * 
- * @param <I>
- *            Vertex index value
- * @param <V>
- *            Vertex value
- * @param <E>
- *            Edge value
- */
-@SuppressWarnings("rawtypes")
-public abstract class VertexOutputFormat<I extends WritableComparable, V extends Writable, E extends Writable> {
-    /**
-     * Create a vertex writer for a given split. The framework will call {@link VertexReader#initialize(InputSplit, TaskAttemptContext)} before
-     * the split is used.
-     * 
-     * @param context
-     *            the information about the task
-     * @return a new vertex writer
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    public abstract VertexWriter<I, V, E> createVertexWriter(TaskAttemptContext context) throws IOException,
-            InterruptedException;
-
-    /**
-     * Check for validity of the output-specification for the job. (Copied from
-     * Hadoop OutputFormat)
-     * <p>
-     * This is to validate the output specification for the job when it is a job is submitted. Typically checks that it does not already exist, throwing an exception when it already exists, so that output is not overwritten.
-     * </p>
-     * 
-     * @param context
-     *            information about the job
-     * @throws IOException
-     *             when output should not be attempted
-     */
-    public abstract void checkOutputSpecs(JobContext context) throws IOException, InterruptedException;
-
-    /**
-     * Get the output committer for this output format. This is responsible for
-     * ensuring the output is committed correctly. (Copied from Hadoop
-     * OutputFormat)
-     * 
-     * @param context
-     *            the task context
-     * @return an output committer
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    public abstract OutputCommitter getOutputCommitter(TaskAttemptContext context) throws IOException,
-            InterruptedException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexReader.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexReader.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexReader.java
deleted file mode 100644
index ba8b561..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexReader.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.RecordReader;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-
-import edu.uci.ics.pregelix.api.graph.Vertex;
-
-/**
- * Analogous to {@link RecordReader} for vertices. Will read the vertices from
- * an input split.
- * 
- * @param <I>
- *            Vertex id
- * @param <V>
- *            Vertex data
- * @param <E>
- *            Edge data
- * @param <M>
- *            Message data
- */
-@SuppressWarnings("rawtypes")
-public interface VertexReader<I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable> {
-    /**
-     * Use the input split and context t o setup reading the vertices.
-     * Guaranteed to be called prior to any other function.
-     * 
-     * @param inputSplit
-     *            Input split to be used for reading vertices.
-     * @param context
-     *            Context from the task.
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    void initialize(InputSplit inputSplit, TaskAttemptContext context) throws IOException, InterruptedException;
-
-    /**
-     * @return false iff there are no more vertices
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    boolean nextVertex() throws IOException, InterruptedException;
-
-    /**
-     * Get the current vertex.
-     * 
-     * @return the current vertex which has been read. nextVertex() should be
-     *         called first.
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    Vertex<I, V, E, M> getCurrentVertex() throws IOException, InterruptedException;
-
-    /**
-     * Close this {@link VertexReader} to future operations.
-     * 
-     * @throws IOException
-     */
-    void close() throws IOException;
-
-    /**
-     * How much of the input has the {@link VertexReader} consumed i.e. has been
-     * processed by?
-     * 
-     * @return Progress from <code>0.0</code> to <code>1.0</code>.
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    float getProgress() throws IOException, InterruptedException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexWriter.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexWriter.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexWriter.java
deleted file mode 100644
index 9336170..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/VertexWriter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-
-import edu.uci.ics.pregelix.api.graph.Vertex;
-
-/**
- * Implement to output a vertex range of the graph after the computation
- * 
- * @param <I>
- *            Vertex id
- * @param <V>
- *            Vertex value
- * @param <E>
- *            Edge value
- */
-@SuppressWarnings("rawtypes")
-public interface VertexWriter<I extends WritableComparable, V extends Writable, E extends Writable> {
-    /**
-     * Use the context to setup writing the vertices. Guaranteed to be called
-     * prior to any other function.
-     * 
-     * @param context
-     *            Context used to write the vertices.
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    void initialize(TaskAttemptContext context) throws IOException, InterruptedException;
-
-    /**
-     * Writes the next vertex and associated data
-     * 
-     * @param vertex
-     *            set the properties of this vertex
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    void writeVertex(Vertex<I, V, E, ?> vertex) throws IOException, InterruptedException;
-
-    /**
-     * Close this {@link VertexWriter} to future operations.
-     * 
-     * @param context
-     *            the context of the task
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    void close(TaskAttemptContext context) throws IOException, InterruptedException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/WritableSizable.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/WritableSizable.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/WritableSizable.java
deleted file mode 100644
index ee13f76..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/WritableSizable.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io;
-
-import org.apache.hadoop.io.Writable;
-
-/**
- * @author yingyib
- */
-public interface WritableSizable extends Writable, Sizable {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/generated/GeneratedVertexInputFormat.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/generated/GeneratedVertexInputFormat.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/generated/GeneratedVertexInputFormat.java
deleted file mode 100644
index 1d3c427..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/generated/GeneratedVertexInputFormat.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io.generated;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.JobContext;
-
-import edu.uci.ics.pregelix.api.io.BasicGenInputSplit;
-import edu.uci.ics.pregelix.api.io.VertexInputFormat;
-import edu.uci.ics.pregelix.api.io.WritableSizable;
-
-/**
- * This VertexInputFormat is meant for testing/debugging. It simply generates
- * some vertex data that can be consumed by test applications.
- */
-@SuppressWarnings("rawtypes")
-public abstract class GeneratedVertexInputFormat<I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable>
-        extends VertexInputFormat<I, V, E, M> {
-
-    @Override
-    public List<InputSplit> getSplits(JobContext context, int numWorkers) throws IOException, InterruptedException {
-        // This is meaningless, the VertexReader will generate all the test
-        // data.
-        List<InputSplit> inputSplitList = new ArrayList<InputSplit>();
-        for (int i = 0; i < numWorkers; ++i) {
-            inputSplitList.add(new BasicGenInputSplit(i, numWorkers));
-        }
-        return inputSplitList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/generated/GeneratedVertexReader.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/generated/GeneratedVertexReader.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/generated/GeneratedVertexReader.java
deleted file mode 100644
index 376d45d..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/generated/GeneratedVertexReader.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io.generated;
-
-import java.io.IOException;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-
-import edu.uci.ics.pregelix.api.io.BasicGenInputSplit;
-import edu.uci.ics.pregelix.api.io.VertexReader;
-import edu.uci.ics.pregelix.api.io.WritableSizable;
-
-/**
- * Used by GeneratedVertexInputFormat to read some generated data
- * 
- * @param <I>
- *            Vertex index value
- * @param <V>
- *            Vertex value
- * @param <E>
- *            Edge value
- */
-@SuppressWarnings("rawtypes")
-public abstract class GeneratedVertexReader<I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable>
-        implements VertexReader<I, V, E, M> {
-    /** Records read so far */
-    protected long recordsRead = 0;
-    /** Total records to read (on this split alone) */
-    protected long totalRecords = 0;
-    /** The input split from initialize(). */
-    protected BasicGenInputSplit inputSplit = null;
-    /** Reverse the id order? */
-    protected boolean reverseIdOrder;
-
-    protected Configuration configuration = null;
-
-    public static final String READER_VERTICES = "GeneratedVertexReader.reader_vertices";
-    public static final long DEFAULT_READER_VERTICES = 10;
-    public static final String REVERSE_ID_ORDER = "GeneratedVertexReader.reverseIdOrder";
-    public static final boolean DEAFULT_REVERSE_ID_ORDER = false;
-
-    public GeneratedVertexReader() {
-    }
-
-    @Override
-    final public void initialize(InputSplit inputSplit, TaskAttemptContext context) throws IOException {
-        configuration = context.getConfiguration();
-        totalRecords = configuration.getLong(GeneratedVertexReader.READER_VERTICES,
-                GeneratedVertexReader.DEFAULT_READER_VERTICES);
-        reverseIdOrder = configuration.getBoolean(GeneratedVertexReader.REVERSE_ID_ORDER,
-                GeneratedVertexReader.DEAFULT_REVERSE_ID_ORDER);
-        this.inputSplit = (BasicGenInputSplit) inputSplit;
-    }
-
-    @Override
-    public void close() throws IOException {
-    }
-
-    @Override
-    final public float getProgress() throws IOException {
-        return recordsRead * 100.0f / totalRecords;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/internal/InternalVertexInputFormat.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/internal/InternalVertexInputFormat.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/internal/InternalVertexInputFormat.java
deleted file mode 100644
index 22d3b27..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/internal/InternalVertexInputFormat.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io.internal;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.RecordReader;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat;
-
-import edu.uci.ics.pregelix.api.graph.Vertex;
-import edu.uci.ics.pregelix.api.io.VertexInputFormat;
-import edu.uci.ics.pregelix.api.io.VertexReader;
-import edu.uci.ics.pregelix.api.io.WritableSizable;
-
-/**
- * @author yingyib
- */
-@SuppressWarnings("rawtypes")
-public class InternalVertexInputFormat<I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable>
-        extends VertexInputFormat<I, V, E, M> {
-    /** Uses the SequenceFileInputFormat to do everything */
-    private SequenceFileInputFormat sequenceInputFormat = new SequenceFileInputFormat();
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public List<InputSplit> getSplits(JobContext context, int numWorkers) throws IOException, InterruptedException {
-        return sequenceInputFormat.getSplits(context);
-    }
-
-    @Override
-    public VertexReader<I, V, E, M> createVertexReader(final InputSplit split, final TaskAttemptContext context)
-            throws IOException {
-        return new VertexReader<I, V, E, M>() {
-            RecordReader recordReader = sequenceInputFormat.createRecordReader(split, context);
-
-            @Override
-            public void initialize(InputSplit inputSplit, TaskAttemptContext context) throws IOException,
-                    InterruptedException {
-                recordReader.initialize(inputSplit, context);
-            }
-
-            @Override
-            public boolean nextVertex() throws IOException, InterruptedException {
-                return recordReader.nextKeyValue();
-            }
-
-            @SuppressWarnings("unchecked")
-            @Override
-            public Vertex<I, V, E, M> getCurrentVertex() throws IOException, InterruptedException {
-                return (Vertex<I, V, E, M>) recordReader.getCurrentValue();
-            }
-
-            @Override
-            public void close() throws IOException {
-                recordReader.close();
-            }
-
-            @Override
-            public float getProgress() throws IOException, InterruptedException {
-                return 0;
-            }
-
-        };
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/internal/InternalVertexOutputFormat.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/internal/InternalVertexOutputFormat.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/internal/InternalVertexOutputFormat.java
deleted file mode 100644
index b603037..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/internal/InternalVertexOutputFormat.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io.internal;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.OutputCommitter;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat;
-
-import edu.uci.ics.pregelix.api.graph.Vertex;
-import edu.uci.ics.pregelix.api.io.VertexOutputFormat;
-import edu.uci.ics.pregelix.api.io.VertexWriter;
-
-/**
- * @author yingyib
- */
-@SuppressWarnings("rawtypes")
-public class InternalVertexOutputFormat<I extends WritableComparable, V extends Writable, E extends Writable> extends
-        VertexOutputFormat<I, V, E> {
-    private SequenceFileOutputFormat sequenceOutputFormat = new SequenceFileOutputFormat();
-
-    @Override
-    public VertexWriter<I, V, E> createVertexWriter(final TaskAttemptContext context) throws IOException,
-            InterruptedException {
-        return new VertexWriter<I, V, E>() {
-            private RecordWriter recordWriter = sequenceOutputFormat.getRecordWriter(context);
-            private NullWritable key = NullWritable.get();
-
-            @Override
-            public void initialize(TaskAttemptContext context) throws IOException, InterruptedException {
-
-            }
-
-            @SuppressWarnings("unchecked")
-            @Override
-            public void writeVertex(Vertex<I, V, E, ?> vertex) throws IOException, InterruptedException {
-                recordWriter.write(key, vertex);
-            }
-
-            @Override
-            public void close(TaskAttemptContext context) throws IOException, InterruptedException {
-                recordWriter.close(context);
-            }
-
-        };
-    }
-
-    @Override
-    public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException {
-
-    }
-
-    @Override
-    public OutputCommitter getOutputCommitter(TaskAttemptContext context) throws IOException, InterruptedException {
-        return new OutputCommitter() {
-
-            @Override
-            public void abortTask(TaskAttemptContext arg0) throws IOException {
-                // TODO Auto-generated method stub
-
-            }
-
-            @Override
-            public void cleanupJob(JobContext arg0) throws IOException {
-                // TODO Auto-generated method stub
-
-            }
-
-            @Override
-            public void commitTask(TaskAttemptContext arg0) throws IOException {
-                // TODO Auto-generated method stub
-
-            }
-
-            @Override
-            public boolean needsTaskCommit(TaskAttemptContext arg0) throws IOException {
-                return false;
-            }
-
-            @Override
-            public void setupJob(JobContext arg0) throws IOException {
-
-            }
-
-            @Override
-            public void setupTask(TaskAttemptContext arg0) throws IOException {
-
-            }
-
-        };
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/text/TextVertexInputFormat.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/text/TextVertexInputFormat.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/text/TextVertexInputFormat.java
deleted file mode 100644
index 0faf516..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/text/TextVertexInputFormat.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io.text;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.RecordReader;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
-
-import edu.uci.ics.pregelix.api.io.VertexInputFormat;
-import edu.uci.ics.pregelix.api.io.VertexReader;
-import edu.uci.ics.pregelix.api.io.WritableSizable;
-
-/**
- * Abstract class that users should subclass to use their own text based vertex
- * output format.
- * 
- * @param <I>
- *            Vertex index value
- * @param <V>
- *            Vertex value
- * @param <E>
- *            Edge value
- * @param <M>
- *            Message value
- */
-@SuppressWarnings("rawtypes")
-public abstract class TextVertexInputFormat<I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable>
-        extends VertexInputFormat<I, V, E, M> {
-    /** Uses the TextInputFormat to do everything */
-    protected TextInputFormat textInputFormat = new TextInputFormat();
-
-    /**
-     * Abstract class to be implemented by the user based on their specific
-     * vertex input. Easiest to ignore the key value separator and only use key
-     * instead.
-     * 
-     * @param <I>
-     *            Vertex index value
-     * @param <V>
-     *            Vertex value
-     * @param <E>
-     *            Edge value
-     */
-    public static abstract class TextVertexReader<I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable>
-            implements VertexReader<I, V, E, M> {
-        /** Internal line record reader */
-        private final RecordReader<LongWritable, Text> lineRecordReader;
-        /** Context passed to initialize */
-        private TaskAttemptContext context;
-
-        /**
-         * Initialize with the LineRecordReader.
-         * 
-         * @param lineRecordReader
-         *            Line record reader from TextInputFormat
-         */
-        public TextVertexReader(RecordReader<LongWritable, Text> lineRecordReader) {
-            this.lineRecordReader = lineRecordReader;
-        }
-
-        @Override
-        public void initialize(InputSplit inputSplit, TaskAttemptContext context) throws IOException,
-                InterruptedException {
-            lineRecordReader.initialize(inputSplit, context);
-            this.context = context;
-        }
-
-        @Override
-        public void close() throws IOException {
-            lineRecordReader.close();
-        }
-
-        @Override
-        public float getProgress() throws IOException, InterruptedException {
-            return lineRecordReader.getProgress();
-        }
-
-        /**
-         * Get the line record reader.
-         * 
-         * @return Record reader to be used for reading.
-         */
-        protected RecordReader<LongWritable, Text> getRecordReader() {
-            return lineRecordReader;
-        }
-
-        /**
-         * Get the context.
-         * 
-         * @return Context passed to initialize.
-         */
-        protected TaskAttemptContext getContext() {
-            return context;
-        }
-    }
-
-    @Override
-    public List<InputSplit> getSplits(JobContext context, int numWorkers) throws IOException, InterruptedException {
-        // Ignore the hint of numWorkers here since we are using TextInputFormat
-        // to do this for us
-        return textInputFormat.getSplits(context);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/text/TextVertexOutputFormat.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/text/TextVertexOutputFormat.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/text/TextVertexOutputFormat.java
deleted file mode 100644
index c9d0ffa..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/io/text/TextVertexOutputFormat.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.io.text;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.OutputCommitter;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
-
-import edu.uci.ics.pregelix.api.io.VertexOutputFormat;
-import edu.uci.ics.pregelix.api.io.VertexWriter;
-
-/**
- * Abstract class that users should subclass to use their own text based vertex
- * output format.
- * 
- * @param <I>
- *            Vertex index value
- * @param <V>
- *            Vertex value
- * @param <E>
- *            Edge value
- */
-@SuppressWarnings("rawtypes")
-public abstract class TextVertexOutputFormat<I extends WritableComparable, V extends Writable, E extends Writable>
-        extends VertexOutputFormat<I, V, E> {
-    /** Uses the TextOutputFormat to do everything */
-    protected TextOutputFormat<Text, Text> textOutputFormat = new TextOutputFormat<Text, Text>();
-
-    /**
-     * Abstract class to be implemented by the user based on their specific
-     * vertex output. Easiest to ignore the key value separator and only use key
-     * instead.
-     * 
-     * @param <I>
-     *            Vertex index value
-     * @param <V>
-     *            Vertex value
-     * @param <E>
-     *            Edge value
-     */
-    public static abstract class TextVertexWriter<I extends WritableComparable, V extends Writable, E extends Writable>
-            implements VertexWriter<I, V, E> {
-        /** Context passed to initialize */
-        private TaskAttemptContext context;
-        /** Internal line record writer */
-        private final RecordWriter<Text, Text> lineRecordWriter;
-
-        /**
-         * Initialize with the LineRecordWriter.
-         * 
-         * @param lineRecordWriter
-         *            Line record writer from TextOutputFormat
-         */
-        public TextVertexWriter(RecordWriter<Text, Text> lineRecordWriter) {
-            this.lineRecordWriter = lineRecordWriter;
-        }
-
-        @Override
-        public void initialize(TaskAttemptContext context) throws IOException {
-            this.context = context;
-        }
-
-        @Override
-        public void close(TaskAttemptContext context) throws IOException, InterruptedException {
-            lineRecordWriter.close(context);
-        }
-
-        /**
-         * Get the line record writer.
-         * 
-         * @return Record writer to be used for writing.
-         */
-        public RecordWriter<Text, Text> getRecordWriter() {
-            return lineRecordWriter;
-        }
-
-        /**
-         * Get the context.
-         * 
-         * @return Context passed to initialize.
-         */
-        public TaskAttemptContext getContext() {
-            return context;
-        }
-    }
-
-    @Override
-    public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException {
-        textOutputFormat.checkOutputSpecs(context);
-    }
-
-    @Override
-    public OutputCommitter getOutputCommitter(TaskAttemptContext context) throws IOException, InterruptedException {
-        return textOutputFormat.getOutputCommitter(context);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/ICheckpointHook.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/ICheckpointHook.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/ICheckpointHook.java
deleted file mode 100644
index 9d6eb5a..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/ICheckpointHook.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.job;
-
-/**
- * @author yingyib
- */
-public interface ICheckpointHook {
-
-    public boolean checkpoint(int superstep);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/IIterationCompleteReporterHook.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/IIterationCompleteReporterHook.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/IIterationCompleteReporterHook.java
deleted file mode 100644
index 5254b8c..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/IIterationCompleteReporterHook.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.job;
-
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-
-/**
- * Interface for an object whose {@link completeIteration} method is called at the end
- * of each pregelix job iteration.
- * 
- * This class can be used to extend/replace the simple reporting in pregelix or to
- * implement aggregation across iterations of a job (rather than having the values
- * reset after each iteration).
- * One object is created for each job.
- * 
- * @author jake.biesinger
- */
-public interface IIterationCompleteReporterHook {
-
-    public void completeIteration(int superstep, PregelixJob job) throws HyracksDataException;
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/PregelixJob.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/PregelixJob.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/PregelixJob.java
deleted file mode 100644
index fb04b01..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/job/PregelixJob.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.job;
-
-import java.io.IOException;
-import java.lang.reflect.Modifier;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.Job;
-
-import edu.uci.ics.pregelix.api.graph.MessageCombiner;
-import edu.uci.ics.pregelix.api.graph.NormalizedKeyComputer;
-import edu.uci.ics.pregelix.api.graph.Vertex;
-import edu.uci.ics.pregelix.api.graph.VertexPartitioner;
-import edu.uci.ics.pregelix.api.io.VertexInputFormat;
-import edu.uci.ics.pregelix.api.io.VertexOutputFormat;
-import edu.uci.ics.pregelix.api.util.GlobalEdgeCountAggregator;
-import edu.uci.ics.pregelix.api.util.GlobalVertexCountAggregator;
-import edu.uci.ics.pregelix.api.util.HadoopCountersAggregator;
-import edu.uci.ics.pregelix.api.util.HadoopCountersGlobalAggregateHook;
-
-/**
- * This class represents a Pregelix job.
- */
-public class PregelixJob extends Job {
-    /** Vertex class - required */
-    public static final String VERTEX_CLASS = "pregelix.vertexClass";
-    /** VertexInputFormat class - required */
-    public static final String VERTEX_INPUT_FORMAT_CLASS = "pregelix.vertexInputFormatClass";
-    /** VertexOutputFormat class - optional */
-    public static final String VERTEX_OUTPUT_FORMAT_CLASS = "pregelix.vertexOutputFormatClass";
-    /** Vertex combiner class - optional */
-    public static final String Message_COMBINER_CLASS = "pregelix.combinerClass";
-    /** Global aggregator class - optional */
-    public static final String GLOBAL_AGGREGATOR_CLASS = "pregelix.aggregatorClass";
-    /** Vertex resolver class - optional */
-    public static final String VERTEX_RESOLVER_CLASS = "pregelix.vertexResolverClass";
-    /** Vertex index class */
-    public static final String VERTEX_INDEX_CLASS = "pregelix.vertexIndexClass";
-    /** Vertex value class */
-    public static final String VERTEX_VALUE_CLASS = "pregelix.vertexValueClass";
-    /** Edge value class */
-    public static final String EDGE_VALUE_CLASS = "pregelix.edgeValueClass";
-    /** Message value class */
-    public static final String MESSAGE_VALUE_CLASS = "pregelix.messageValueClass";
-    /** Partial combiner value class */
-    public static final String PARTIAL_COMBINE_VALUE_CLASS = "pregelix.partialCombinedValueClass";
-    /** Partial aggregate value class */
-    public static final String PARTIAL_AGGREGATE_VALUE_CLASS = "pregelix.partialAggregateValueClass";
-    /** Final aggregate value class */
-    public static final String FINAL_AGGREGATE_VALUE_CLASS = "pregelix.finalAggregateValueClass";
-    /** The normalized key computer class */
-    public static final String NMK_COMPUTER_CLASS = "pregelix.nmkComputerClass";
-    /** The partitioner class */
-    public static final String PARTITIONER_CLASS = "pregelix.partitionerClass";
-    /** num of vertices */
-    public static final String NUM_VERTICE = "pregelix.numVertices";
-    /** num of edges */
-    public static final String NUM_EDGES = "pregelix.numEdges";
-    /** increase state length */
-    public static final String INCREASE_STATE_LENGTH = "pregelix.incStateLength";
-    /** job id */
-    public static final String JOB_ID = "pregelix.jobid";
-    /** frame size */
-    public static final String FRAME_SIZE = "pregelix.framesize";
-    /** update intensive */
-    public static final String UPDATE_INTENSIVE = "pregelix.updateIntensive";
-    /** the check point hook */
-    public static final String CKP_CLASS = "pregelix.checkpointHook";
-    /** the check point hook */
-    public static final String RECOVERY_COUNT = "pregelix.recoveryCount";
-    /** the checkpoint interval */
-    public static final String CKP_INTERVAL = "pregelix.ckpinterval";
-    /** the dynamic optimization */
-    public static final String DYNAMIC_OPTIMIZATION = "pregelix.dynamicopt";
-    /** the iteration complete reporter hook */
-    public static final String ITERATION_COMPLETE_CLASS = "pregelix.iterationCompleteReporter";
-    /** comma */
-    public static final String COMMA_STR = ",";
-    /** period */
-    public static final String PERIOD_STR = ".";
-    /** the names of the aggregator classes active for all vertex types */
-    public static final String[] DEFAULT_GLOBAL_AGGREGATOR_CLASSES = { GlobalVertexCountAggregator.class.getName(),
-            GlobalEdgeCountAggregator.class.getName() };
-    /** The name of an optional class that aggregates all Vertexes into mapreduce.Counters */
-    public static final String COUNTERS_AGGREGATOR_CLASS = "pregelix.aggregatedCountersClass";
-    /** the group-by algorithm */
-    public static final String GROUPING_ALGORITHM = "pregelix.groupalg";
-    /** the memory assigned to group-by */
-    public static final String GROUPING_MEM = "pregelix.groupmem";
-    /** the memory assigned for the sort operator */
-    public static final String SORT_MEM = "pregelix.sortmem";
-    /** the number of workers */
-    public static final String NUM_WORKERS = "pregelix.numworkers";
-    /** the application allows to skip combiner key during aggregations */
-    public static final String SKIP_COMBINER_KEY = "pregelix.skipCombinerKey";
-    /** the merge connector */
-    public static final String MERGE_CONNECTOR = "pregelix.merge";
-    /** the maximum allowed iteration */
-    public static final String MAX_ITERATION="pregelix.maxiteration";
-
-    /**
-     * Construct a Pregelix job from an existing configuration
-     * 
-     * @param conf
-     * @throws IOException
-     */
-    public PregelixJob(Configuration conf) throws IOException {
-        super(conf);
-    }
-
-    /**
-     * Constructor that will instantiate the configuration
-     * 
-     * @param jobName
-     *            User-defined job name
-     * @throws IOException
-     */
-    public PregelixJob(String jobName) throws IOException {
-        super(new Configuration(), jobName);
-    }
-
-    /**
-     * Constructor.
-     * 
-     * @param conf
-     *            User-defined configuration
-     * @param jobName
-     *            User-defined job name
-     * @throws IOException
-     */
-    public PregelixJob(Configuration conf, String jobName) throws IOException {
-        super(conf, jobName);
-    }
-
-    /**
-     * Set the vertex class (required)
-     * 
-     * @param vertexClass
-     *            Runs vertex computation
-     */
-    final public void setVertexClass(Class<?> vertexClass) {
-        getConfiguration().setClass(VERTEX_CLASS, vertexClass, Vertex.class);
-    }
-
-    /**
-     * Set the vertex input format class (required)
-     * 
-     * @param vertexInputFormatClass
-     *            Determines how graph is input
-     */
-    final public void setVertexInputFormatClass(Class<?> vertexInputFormatClass) {
-        getConfiguration().setClass(VERTEX_INPUT_FORMAT_CLASS, vertexInputFormatClass, VertexInputFormat.class);
-    }
-
-    /**
-     * Set the vertex output format class (optional)
-     * 
-     * @param vertexOutputFormatClass
-     *            Determines how graph is output
-     */
-    final public void setVertexOutputFormatClass(Class<?> vertexOutputFormatClass) {
-        getConfiguration().setClass(VERTEX_OUTPUT_FORMAT_CLASS, vertexOutputFormatClass, VertexOutputFormat.class);
-    }
-
-    /**
-     * Set the vertex combiner class (optional)
-     * 
-     * @param vertexCombinerClass
-     *            Determines how vertex messages are combined
-     */
-    final public void setMessageCombinerClass(Class<?> vertexCombinerClass) {
-        getConfiguration().setClass(Message_COMBINER_CLASS, vertexCombinerClass, MessageCombiner.class);
-    }
-
-    /**
-     * Set the global aggregator class (optional)
-     * 
-     * @param globalAggregatorClass
-     *            Determines how messages are globally aggregated
-     */
-    final public void addGlobalAggregatorClass(Class<?> globalAggregatorClass) {
-        String aggStr = globalAggregatorClass.getName();
-        String classes = getConfiguration().get(GLOBAL_AGGREGATOR_CLASS);
-        conf.set(GLOBAL_AGGREGATOR_CLASS, classes == null ? aggStr : classes + COMMA_STR + aggStr);
-    }
-
-    /**
-     * Set the job Id
-     */
-    final public void setJobId(String jobId) {
-        getConfiguration().set(JOB_ID, jobId);
-    }
-
-    /**
-     * Set whether the vertex state length can be dynamically increased
-     * 
-     * @param jobId
-     */
-    final public void setDynamicVertexValueSize(boolean incStateLengthDynamically) {
-        getConfiguration().setBoolean(INCREASE_STATE_LENGTH, incStateLengthDynamically);
-    }
-
-    /**
-     * Set whether the vertex state length is fixed
-     * 
-     * @param jobId
-     */
-    final public void setFixedVertexValueSize(boolean fixedSize) {
-        getConfiguration().setBoolean(INCREASE_STATE_LENGTH, !fixedSize);
-    }
-
-    /**
-     * Set the frame size for a job
-     * 
-     * @param frameSize
-     *            the desired frame size
-     */
-    final public void setFrameSize(int frameSize) {
-        getConfiguration().setInt(FRAME_SIZE, frameSize);
-    }
-
-    /**
-     * Set the normalized key computer class
-     * 
-     * @param nkcClass
-     */
-    final public void setNoramlizedKeyComputerClass(Class<?> nkcClass) {
-        getConfiguration().setClass(NMK_COMPUTER_CLASS, nkcClass, NormalizedKeyComputer.class);
-    }
-
-    /**
-     * Set the vertex partitioner class
-     * 
-     * @param partitionerClass
-     */
-    final public void setVertexPartitionerClass(Class<?> partitionerClass) {
-        getConfiguration().setClass(PARTITIONER_CLASS, partitionerClass, VertexPartitioner.class);
-    }
-
-    /**
-     * Indicate if the job needs to do a lot of graph mutations or variable size updates
-     * 
-     * @param updateHeavyFlag
-     */
-    final public void setLSMStorage(boolean variableSizedUpdateHeavyFlag) {
-        getConfiguration().setBoolean(UPDATE_INTENSIVE, variableSizedUpdateHeavyFlag);
-    }
-
-    /**
-     * Users can provide an ICheckpointHook implementation to specify when to do checkpoint
-     * 
-     * @param ckpClass
-     */
-    final public void setCheckpointHook(Class<?> ckpClass) {
-        getConfiguration().setClass(CKP_CLASS, ckpClass, ICheckpointHook.class);
-    }
-
-    /**
-     * Users can provide an ICheckpointHook implementation to specify when to do checkpoint
-     * 
-     * @param ckpClass
-     */
-    final public void setRecoveryCount(int recoveryCount) {
-        getConfiguration().setInt(RECOVERY_COUNT, recoveryCount);
-    }
-
-    /**
-     * Users can set the interval of checkpointing
-     * 
-     * @param ckpInterval
-     */
-    final public void setCheckpointingInterval(int ckpInterval) {
-        getConfiguration().setInt(CKP_INTERVAL, ckpInterval);
-    }
-
-    /**
-     * Users can provide an IIterationCompleteReporterHook implementation to perform actions
-     * at the end of each iteration
-     * 
-     * @param reporterClass
-     */
-    final public void setIterationCompleteReporterHook(Class<? extends IIterationCompleteReporterHook> reporterClass) {
-        getConfiguration().setClass(ITERATION_COMPLETE_CLASS, reporterClass, IIterationCompleteReporterHook.class);
-    }
-
-    /**
-     * Indicate if dynamic optimization is enabled
-     * 
-     * @param dynamicOpt
-     */
-    final public void setEnableDynamicOptimization(boolean dynamicOpt) {
-        getConfiguration().setBoolean(DYNAMIC_OPTIMIZATION, dynamicOpt);
-    }
-
-    /**
-     * Set the counter aggregator class
-     * 
-     * @param aggClass
-     */
-    final public void setCounterAggregatorClass(Class<? extends HadoopCountersAggregator<?, ?, ?, ?, ?>> aggClass) {
-        if (Modifier.isAbstract(aggClass.getModifiers())) {
-            throw new IllegalArgumentException("Aggregate class must be a concrete class, not an abstract one! (was "
-                    + aggClass.getName() + ")");
-        }
-        getConfiguration().setClass(COUNTERS_AGGREGATOR_CLASS, aggClass, HadoopCountersAggregator.class);
-        addGlobalAggregatorClass(aggClass);
-        setIterationCompleteReporterHook(HadoopCountersGlobalAggregateHook.class);
-    }
-
-    /**
-     * Set the group-by algorithm: sort-true or hash-false
-     * 
-     * @param sortOrHash
-     */
-    final public void setGroupByAlgorithm(boolean sortOrHash) {
-        getConfiguration().setBoolean(GROUPING_ALGORITHM, sortOrHash);
-    }
-
-    /**
-     * Set the memory buget for group-by operators (only hash-based)
-     * 
-     * @param numberOfPages
-     */
-    final public void setGroupByMemoryLimit(int numberOfPages) {
-        getConfiguration().setInt(GROUPING_MEM, numberOfPages);
-    }
-
-    /**
-     * Set the memory buget for sort operators (only hash-based)
-     * 
-     * @param numberOfPages
-     */
-    final public void setSortMemoryLimit(int numberOfPages) {
-        getConfiguration().setInt(SORT_MEM, numberOfPages);
-    }
-
-    /**
-     * Set the number of workers
-     * 
-     * @param numWorkers
-     */
-    final public void setNumWorkers(int numWorkers) {
-        getConfiguration().setInt(NUM_WORKERS, numWorkers);
-    }
-
-    /**
-     * Whether an application allows to skip the combiner key during message combination,
-     * this is a performance improvement tip.
-     * By default, the key is not skipped
-     * 
-     * @param skip
-     *            true to skip; otherwise, not.
-     */
-    final public void setSkipCombinerKey(boolean skip) {
-        getConfiguration().setBoolean(SKIP_COMBINER_KEY, skip);
-    }
-    
-    /**
-     * Whether to use merge connector
-     * 
-     * @param merge
-     */
-    final public void setMergeConnector(boolean merge){
-        getConfiguration().setBoolean(MERGE_CONNECTOR, merge);
-    }
-    
-    /***
-     * Set the maximum allowed iteration
-     * 
-     * @param iteration
-     */
-    final public void setMaxIteration(int iteration){
-        getConfiguration().setInt(MAX_ITERATION, iteration);
-    }
-
-    @Override
-    public String toString() {
-        return getJobName();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ArrayListWritable.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ArrayListWritable.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ArrayListWritable.java
deleted file mode 100644
index 1683541..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ArrayListWritable.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright 2009-2013 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.pregelix.api.util;
-
-import java.io.DataInput;
-import java.io.DataInputStream;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.hadoop.conf.Configurable;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.util.ReflectionUtils;
-
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-
-/**
- * A Writable for ListArray containing instances of a class.
- */
-public abstract class ArrayListWritable<M extends Writable> extends ArrayList<M> implements Writable, Configurable {
-    /** Used for instantiation */
-    private Class<M> refClass = null;
-    /** Defining a layout version for a serializable class. */
-    private static final long serialVersionUID = 1L;
-    /** Configuration */
-    private Configuration conf;
-    /** content object pool */
-    private List<M> pool = new ArrayList<M>();
-    /** how many instance in the pool has been used */
-    private int used = 0;
-    /** intermediate buffer for copy data element */
-    private final ArrayBackedValueStorage intermediateBuffer = new ArrayBackedValueStorage();
-    /** intermediate data output */
-    private final DataOutput intermediateOutput = intermediateBuffer.getDataOutput();
-    /** input stream */
-    private final ResetableByteArrayInputStream inputStream = new ResetableByteArrayInputStream();
-    /** data input */
-    private final DataInput dataInput = new DataInputStream(inputStream);
-
-    /**
-     * Using the default constructor requires that the user implement
-     * setClass(), guaranteed to be invoked prior to instantiation in
-     * readFields()
-     */
-    public ArrayListWritable() {
-    }
-
-    /**
-     * clear all the elements
-     */
-    public void clearElements() {
-        this.used = 0;
-        this.clear();
-    }
-
-    /**
-     * Add all elements from another list
-     * 
-     * @param list
-     *            the list of M
-     * @return true if successful, else false
-     */
-    public boolean addAllElements(List<M> list) {
-        for (int i = 0; i < list.size(); i++) {
-            addElement(list.get(i));
-        }
-        return true;
-    }
-
-    /**
-     * Add an element
-     * 
-     * @param element
-     *            M
-     * @return true if successful, else false
-     */
-    public boolean addElement(M element) {
-        try {
-            intermediateBuffer.reset();
-            element.write(intermediateOutput);
-            inputStream.setByteArray(intermediateBuffer.getByteArray(), 0);
-            M value = allocateValue();
-            value.readFields(dataInput);
-            add(value);
-            return true;
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    /**
-     * This constructor allows setting the refClass during construction.
-     * 
-     * @param refClass
-     *            internal type class
-     */
-    public ArrayListWritable(Class<M> refClass) {
-        super();
-        this.refClass = refClass;
-    }
-
-    /**
-     * This is a one-time operation to set the class type
-     * 
-     * @param refClass
-     *            internal type class
-     */
-    public void setClass(Class<M> refClass) {
-        if (this.refClass != null) {
-            throw new RuntimeException("setClass: refClass is already set to " + this.refClass.getName());
-        }
-        this.refClass = refClass;
-    }
-
-    /**
-     * Subclasses must set the class type appropriately and can use
-     * setClass(Class<M> refClass) to do it.
-     */
-    public abstract void setClass();
-
-    public void readFields(DataInput in) throws IOException {
-        if (this.refClass == null) {
-            setClass();
-        }
-        used = 0;
-        this.clear();
-        int numValues = in.readInt(); // read number of values
-        for (int i = 0; i < numValues; i++) {
-            M value = allocateValue();
-            value.readFields(in); // read a value
-            add(value); // store it in values
-        }
-    }
-
-    public void write(DataOutput out) throws IOException {
-        int numValues = size();
-        out.writeInt(numValues); // write number of values
-        for (int i = 0; i < numValues; i++) {
-            get(i).write(out);
-        }
-    }
-
-    public final Configuration getConf() {
-        return conf;
-    }
-
-    public final void setConf(Configuration conf) {
-        this.conf = conf;
-        if (this.refClass == null) {
-            setClass();
-        }
-    }
-
-    private M allocateValue() {
-        if (used >= pool.size()) {
-            M value = ReflectionUtils.newInstance(refClass, conf);
-            pool.add(value);
-            used++;
-            return value;
-        } else {
-            M value = pool.get(used);
-            used++;
-            return value;
-        }
-    }
-
-    public void reset(ArrayIterator<M> iterator) {
-        iterator.reset(this);
-    }
-
-    public static class ArrayIterator<M> implements Iterator<M> {
-
-        private int pos = 0;
-        private List<M> list;
-
-        private void reset(List<M> list) {
-            this.list = list;
-            pos = 0;
-        }
-
-        @Override
-        public boolean hasNext() {
-            return pos < list.size();
-        }
-
-        @Override
-        public M next() {
-            M item = list.get(pos);
-            pos++;
-            return item;
-        }
-
-        @Override
-        public void remove() {
-            throw new IllegalStateException("should not be called");
-        }
-
-    }
-}


Mime
View raw message