asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [18/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:45 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/util/BspUtils.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/BspUtils.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/BspUtils.java
deleted file mode 100644
index 92a6320..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/BspUtils.java
+++ /dev/null
@@ -1,955 +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.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FSDataInputStream;
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.io.IntWritable;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.Counters;
-
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.pregelix.api.graph.GlobalAggregator;
-import edu.uci.ics.pregelix.api.graph.MessageCombiner;
-import edu.uci.ics.pregelix.api.graph.MsgList;
-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.io.WritableSizable;
-import edu.uci.ics.pregelix.api.job.ICheckpointHook;
-import edu.uci.ics.pregelix.api.job.IIterationCompleteReporterHook;
-import edu.uci.ics.pregelix.api.job.PregelixJob;
-
-/**
- * Help to use the configuration to get the appropriate classes or instantiate
- * them.
- */
-public class BspUtils {
-
-    public static final String TMP_DIR = "/tmp/";
-    private static final String COUNTERS_VALUE_ON_ITERATION = ".counters.valueOnIter.";
-    private static final String COUNTERS_LAST_ITERATION_COMPLETED = ".counters.lastIterCompleted";
-
-    /**
-     * Get the user's subclassed {@link VertexInputFormat}.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's vertex input format class
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public static <I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable> Class<? extends VertexInputFormat<I, V, E, M>> getVertexInputFormatClass(
-            Configuration conf) {
-        return (Class<? extends VertexInputFormat<I, V, E, M>>) conf.getClass(PregelixJob.VERTEX_INPUT_FORMAT_CLASS,
-                null, VertexInputFormat.class);
-    }
-
-    /**
-     * Create a user vertex input format class
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user vertex input format class
-     */
-    @SuppressWarnings("rawtypes")
-    public static <I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable> VertexInputFormat<I, V, E, M> createVertexInputFormat(
-            Configuration conf) {
-        Class<? extends VertexInputFormat<I, V, E, M>> vertexInputFormatClass = getVertexInputFormatClass(conf);
-        try {
-            VertexInputFormat<I, V, E, M> inputFormat = vertexInputFormatClass.newInstance();
-            return inputFormat;
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    /**
-     * Get the user's subclassed {@link VertexOutputFormat}.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's vertex output format class
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public static <I extends WritableComparable, V extends Writable, E extends Writable> Class<? extends VertexOutputFormat<I, V, E>> getVertexOutputFormatClass(
-            Configuration conf) {
-        return (Class<? extends VertexOutputFormat<I, V, E>>) conf.getClass(PregelixJob.VERTEX_OUTPUT_FORMAT_CLASS,
-                null, VertexOutputFormat.class);
-    }
-
-    /**
-     * Create a user vertex output format class
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user vertex output format class
-     */
-    @SuppressWarnings("rawtypes")
-    public static <I extends WritableComparable, V extends Writable, E extends Writable> VertexOutputFormat<I, V, E> createVertexOutputFormat(
-            Configuration conf) {
-        Class<? extends VertexOutputFormat<I, V, E>> vertexOutputFormatClass = getVertexOutputFormatClass(conf);
-        try {
-            return vertexOutputFormatClass.newInstance();
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    /**
-     * Get the user's subclassed {@link MessageCombiner}.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's vertex combiner class
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public static <I extends WritableComparable, M extends WritableSizable, P extends Writable> Class<? extends MessageCombiner<I, M, P>> getMessageCombinerClass(
-            Configuration conf) {
-        return (Class<? extends MessageCombiner<I, M, P>>) conf.getClass(PregelixJob.Message_COMBINER_CLASS,
-                DefaultMessageCombiner.class, MessageCombiner.class);
-    }
-
-    /**
-     * Get the user's subclassed {@link GlobalAggregator}.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's vertex combiner class
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public static <I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable, P extends Writable, F extends Writable> List<Class<? extends GlobalAggregator<I, V, E, M, P, F>>> getGlobalAggregatorClasses(
-            Configuration conf) {
-        String aggStrs = conf.get(PregelixJob.GLOBAL_AGGREGATOR_CLASS);
-        String[] classnames;
-        if (aggStrs == null) {
-            classnames = new String[0];
-        } else {
-            classnames = aggStrs.split(PregelixJob.COMMA_STR);
-        }
-        try {
-            List<Class<? extends GlobalAggregator<I, V, E, M, P, F>>> classes = new ArrayList<Class<? extends GlobalAggregator<I, V, E, M, P, F>>>();
-            for (String defaultClass : PregelixJob.DEFAULT_GLOBAL_AGGREGATOR_CLASSES) {
-                classes.add((Class<? extends GlobalAggregator<I, V, E, M, P, F>>) conf.getClassByName(defaultClass));
-            }
-            for (int i = 0; i < classnames.length; i++) {
-                classes.add((Class<? extends GlobalAggregator<I, V, E, M, P, F>>) conf.getClassByName(classnames[i]));
-            }
-            return classes;
-        } catch (ClassNotFoundException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public static String getJobId(Configuration conf) {
-        return conf.get(PregelixJob.JOB_ID);
-    }
-
-    /**
-     * Create a user vertex combiner class
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user vertex combiner class
-     */
-    @SuppressWarnings("rawtypes")
-    public static <I extends WritableComparable, M extends WritableSizable, P extends Writable> MessageCombiner<I, M, P> createMessageCombiner(
-            Configuration conf) {
-        Class<? extends MessageCombiner<I, M, P>> vertexCombinerClass = getMessageCombinerClass(conf);
-        try {
-            return vertexCombinerClass.newInstance();
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    /**
-     * Create a user-defined normalized key computer class
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user-defined normalized key computer
-     */
-    public static NormalizedKeyComputer createNormalizedKeyComputer(Configuration conf) {
-        Class<? extends NormalizedKeyComputer> nmkClass = getNormalizedKeyComputerClass(conf);
-        try {
-            return nmkClass.newInstance();
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    /**
-     * Create a global aggregator object
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user vertex combiner class
-     */
-    @SuppressWarnings("rawtypes")
-    public static <I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable, P extends Writable, F extends Writable> List<GlobalAggregator> createGlobalAggregators(
-            Configuration conf) {
-        List<Class<? extends GlobalAggregator<I, V, E, M, P, F>>> globalAggregatorClasses = getGlobalAggregatorClasses(conf);
-        List<GlobalAggregator> aggs = new ArrayList<GlobalAggregator>();
-        try {
-            for (Class<? extends GlobalAggregator<I, V, E, M, P, F>> globalAggClass : globalAggregatorClasses) {
-                aggs.add(globalAggClass.newInstance());
-            }
-            return aggs;
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    /**
-     * Get global aggregator class names
-     *
-     * @param conf
-     *            Configuration to check
-     * @return An array of Global aggregator names
-     */
-    @SuppressWarnings("rawtypes")
-    public static <I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable, P extends Writable, F extends Writable> String[] getGlobalAggregatorClassNames(
-            Configuration conf) {
-        List<Class<? extends GlobalAggregator<I, V, E, M, P, F>>> globalAggregatorClasses = getGlobalAggregatorClasses(conf);
-        String[] aggClassNames = new String[globalAggregatorClasses.size()];
-        int i = 0;
-        for (Class<? extends GlobalAggregator<I, V, E, M, P, F>> globalAggClass : globalAggregatorClasses) {
-            aggClassNames[i++] = globalAggClass.getName();
-        }
-        return aggClassNames;
-    }
-
-    /**
-     * Get global aggregator class names
-     *
-     * @param conf
-     *            Configuration to check
-     * @return An array of Global aggregator names
-     */
-    @SuppressWarnings("rawtypes")
-    public static <I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable, P extends Writable, F extends Writable> String[] getPartialAggregateValueClassNames(
-            Configuration conf) {
-        String[] gloablAggClassNames = getGlobalAggregatorClassNames(conf);
-        String[] partialAggValueClassNames = new String[gloablAggClassNames.length];
-        int i = 0;
-        for (String globalAggClassName : gloablAggClassNames) {
-            partialAggValueClassNames[i++] = getPartialAggregateValueClass(conf, globalAggClassName).getName();
-        }
-        return partialAggValueClassNames;
-    }
-
-    /**
-     * Get the user's subclassed Vertex.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's vertex class
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public static <I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable> Class<? extends Vertex<I, V, E, M>> getVertexClass(
-            Configuration conf) {
-        return (Class<? extends Vertex<I, V, E, M>>) conf.getClass(PregelixJob.VERTEX_CLASS, null, Vertex.class);
-    }
-
-    /**
-     * Create a user vertex
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user vertex
-     */
-    @SuppressWarnings("rawtypes")
-    public static <I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable> Vertex<I, V, E, M> createVertex(
-            Configuration conf) {
-        Class<? extends Vertex<I, V, E, M>> vertexClass = getVertexClass(conf);
-        try {
-            Vertex<I, V, E, M> vertex = vertexClass.newInstance();
-            return vertex;
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-
-    }
-
-    /**
-     * Get the user's subclassed vertex index class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's vertex index class
-     */
-    @SuppressWarnings("unchecked")
-    public static <I extends Writable> Class<I> getVertexIndexClass(Configuration conf) {
-        return (Class<I>) conf.getClass(PregelixJob.VERTEX_INDEX_CLASS, WritableComparable.class);
-    }
-
-    /**
-     * Create a user vertex index
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user vertex index
-     */
-    @SuppressWarnings("rawtypes")
-    public static <I extends WritableComparable> I createVertexIndex(Configuration conf) {
-        Class<I> vertexClass = getVertexIndexClass(conf);
-        try {
-            return vertexClass.newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException("createVertexIndex: Failed to instantiate", e);
-        } catch (IllegalAccessException e) {
-            throw new IllegalArgumentException("createVertexIndex: Illegally accessed", e);
-        }
-    }
-
-    /**
-     * Get the user's subclassed vertex value class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's vertex value class
-     */
-    @SuppressWarnings("unchecked")
-    public static <V extends Writable> Class<V> getVertexValueClass(Configuration conf) {
-        return (Class<V>) conf.getClass(PregelixJob.VERTEX_VALUE_CLASS, Writable.class);
-    }
-
-    /**
-     * Create a user vertex value
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user vertex value
-     */
-    public static <V extends Writable> V createVertexValue(Configuration conf) {
-        Class<V> vertexValueClass = getVertexValueClass(conf);
-        try {
-            return vertexValueClass.newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException("createVertexValue: Failed to instantiate", e);
-        } catch (IllegalAccessException e) {
-            throw new IllegalArgumentException("createVertexValue: Illegally accessed", e);
-        }
-    }
-
-    /**
-     * Get the user's subclassed edge value class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's vertex edge value class
-     */
-    @SuppressWarnings("unchecked")
-    public static <E extends Writable> Class<E> getEdgeValueClass(Configuration conf) {
-        return (Class<E>) conf.getClass(PregelixJob.EDGE_VALUE_CLASS, Writable.class);
-    }
-
-    /**
-     * Create a user edge value
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user edge value
-     */
-    public static <E extends Writable> E createEdgeValue(Configuration conf) {
-        Class<E> edgeValueClass = getEdgeValueClass(conf);
-        try {
-            return edgeValueClass.newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException("createEdgeValue: Failed to instantiate", e);
-        } catch (IllegalAccessException e) {
-            throw new IllegalArgumentException("createEdgeValue: Illegally accessed", e);
-        }
-    }
-
-    /**
-     * Get the user's subclassed vertex message value class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's vertex message value class
-     */
-    @SuppressWarnings("unchecked")
-    public static <M extends WritableSizable> Class<M> getMessageValueClass(Configuration conf) {
-        return (Class<M>) conf.getClass(PregelixJob.MESSAGE_VALUE_CLASS, Writable.class);
-    }
-
-    /**
-     * Get the user's subclassed global aggregator's partial aggregate value class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's global aggregate value class
-     */
-    @SuppressWarnings("unchecked")
-    public static <M extends Writable> Class<M> getPartialAggregateValueClass(Configuration conf, String aggClassName) {
-        return (Class<M>) conf.getClass(PregelixJob.PARTIAL_AGGREGATE_VALUE_CLASS + "$" + aggClassName, Writable.class);
-    }
-
-    /**
-     * Get the user's subclassed combiner's partial combine value class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's global aggregate value class
-     */
-    @SuppressWarnings("unchecked")
-    public static <M extends Writable> Class<M> getPartialCombineValueClass(Configuration conf) {
-        return (Class<M>) conf.getClass(PregelixJob.PARTIAL_COMBINE_VALUE_CLASS, Writable.class);
-    }
-
-    /**
-     * Get the user's subclassed normalized key computer class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's normalized key computer class
-     */
-    @SuppressWarnings("unchecked")
-    public static Class<? extends NormalizedKeyComputer> getNormalizedKeyComputerClass(Configuration conf) {
-        return (Class<? extends NormalizedKeyComputer>) conf.getClass(PregelixJob.NMK_COMPUTER_CLASS,
-                NormalizedKeyComputer.class);
-    }
-
-    /**
-     * Get the user's subclassed normalized key computer class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return User's global aggregate value class
-     */
-    @SuppressWarnings("unchecked")
-    public static <M extends Writable> Class<M> getFinalAggregateValueClass(Configuration conf, String aggClassName) {
-        return (Class<M>) conf.getClass(PregelixJob.FINAL_AGGREGATE_VALUE_CLASS + "$" + aggClassName, Writable.class);
-    }
-
-    /**
-     * Create a user vertex message value
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user vertex message value
-     */
-    public static <M extends WritableSizable> M createMessageValue(Configuration conf) {
-        Class<M> messageValueClass = getMessageValueClass(conf);
-        try {
-            return messageValueClass.newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException("createMessageValue: Failed to instantiate", e);
-        } catch (IllegalAccessException e) {
-            throw new IllegalArgumentException("createMessageValue: Illegally accessed", e);
-        }
-    }
-
-    /**
-     * Create a user partial aggregate value
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user aggregate value
-     */
-    public static <M extends Writable> M createPartialAggregateValue(Configuration conf, String aggClassName) {
-        Class<M> aggregateValueClass = getPartialAggregateValueClass(conf, aggClassName);
-        try {
-            return aggregateValueClass.newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException("createPartialAggregateValue: Failed to instantiate", e);
-        } catch (IllegalAccessException e) {
-            throw new IllegalArgumentException("createPartialAggregateValue: Illegally accessed", e);
-        }
-    }
-
-    /**
-     * Create the list of user partial aggregate values
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user partial aggregate values
-     */
-    public static <M extends Writable> List<M> createPartialAggregateValues(Configuration conf) {
-        String[] aggClassNames = BspUtils.getGlobalAggregatorClassNames(conf);
-        List<M> aggValueList = new ArrayList<M>();
-        for (String aggClassName : aggClassNames) {
-            Class<M> aggregateValueClass = getPartialAggregateValueClass(conf, aggClassName);
-            try {
-                aggValueList.add(aggregateValueClass.newInstance());
-            } catch (InstantiationException e) {
-                throw new IllegalArgumentException("createAggregateValue: Failed to instantiate", e);
-            } catch (IllegalAccessException e) {
-                throw new IllegalArgumentException("createAggregateValue: Illegally accessed", e);
-            }
-        }
-        return aggValueList;
-    }
-
-    /**
-     * Create a user partial combine value
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user aggregate value
-     */
-    @SuppressWarnings("rawtypes")
-    public static <M extends Writable> M createPartialCombineValue(Configuration conf) {
-        Class<M> aggregateValueClass = getPartialCombineValueClass(conf);
-        try {
-            M instance = aggregateValueClass.newInstance();
-            if (instance instanceof MsgList) {
-                // set conf for msg list, if the value type is msglist
-                ((MsgList) instance).setConf(conf);
-            }
-            return instance;
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException("createPartialCombineValue: Failed to instantiate", e);
-        } catch (IllegalAccessException e) {
-            throw new IllegalArgumentException("createPartialCombineValue: Illegally accessed", e);
-        }
-    }
-
-    /**
-     * Create a user aggregate value
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user aggregate value
-     */
-    public static <M extends Writable> M createFinalAggregateValue(Configuration conf, String aggClassName) {
-        Class<M> aggregateValueClass = getFinalAggregateValueClass(conf, aggClassName);
-        try {
-            return aggregateValueClass.newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException("createAggregateValue: Failed to instantiate", e);
-        } catch (IllegalAccessException e) {
-            throw new IllegalArgumentException("createAggregateValue: Illegally accessed", e);
-        }
-    }
-
-    /**
-     * Create the list of user aggregate values
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user aggregate value
-     */
-    public static <M extends Writable> List<M> createFinalAggregateValues(Configuration conf) {
-        String[] aggClassNames = BspUtils.getGlobalAggregatorClassNames(conf);
-        List<M> aggValueList = new ArrayList<M>();
-        for (String aggClassName : aggClassNames) {
-            Class<M> aggregateValueClass = getFinalAggregateValueClass(conf, aggClassName);
-            try {
-                aggValueList.add(aggregateValueClass.newInstance());
-            } catch (InstantiationException e) {
-                throw new IllegalArgumentException("createAggregateValue: Failed to instantiate", e);
-            } catch (IllegalAccessException e) {
-                throw new IllegalArgumentException("createAggregateValue: Illegally accessed", e);
-            }
-        }
-        return aggValueList;
-    }
-
-    /**
-     * Create a user aggregate value
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user aggregate value
-     */
-    @SuppressWarnings("rawtypes")
-    public static VertexPartitioner createVertexPartitioner(Configuration conf) {
-        Class<? extends VertexPartitioner> vertexPartitionerClass = getVertexPartitionerClass(conf);
-        try {
-            return vertexPartitionerClass.newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException("createVertexPartitioner: Failed to instantiate", e);
-        } catch (IllegalAccessException e) {
-            throw new IllegalArgumentException("createVertexPartitioner: Illegally accessed", e);
-        }
-    }
-
-    /**
-     * Create a checkpoint hook
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user aggregate value
-     */
-    public static ICheckpointHook createCheckpointHook(Configuration conf) {
-        Class<? extends ICheckpointHook> ckpClass = getCheckpointHookClass(conf);
-        try {
-            return ckpClass.newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException("createVertexPartitioner: Failed to instantiate", e);
-        } catch (IllegalAccessException e) {
-            throw new IllegalArgumentException("createVertexPartitioner: Illegally accessed", e);
-        }
-    }
-
-    /**
-     * Create a hook that indicates an iteration is complete
-     *
-     * @param conf
-     *            Configuration to check
-     * @return Instantiated user aggregate value
-     */
-    public static IIterationCompleteReporterHook createIterationCompleteHook(Configuration conf) {
-        Class<? extends IIterationCompleteReporterHook> itCompleteClass = getIterationCompleteReporterHookClass(conf);
-        try {
-            return itCompleteClass.newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException("createVertexPartitioner: Failed to instantiate", e);
-        } catch (IllegalAccessException e) {
-            throw new IllegalArgumentException("createVertexPartitioner: Illegally accessed", e);
-        }
-    }
-
-    /**
-     * Get the user's subclassed vertex partitioner class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return The user defined vertex partitioner class
-     */
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    public static <V extends VertexPartitioner> Class<V> getVertexPartitionerClass(Configuration conf) {
-        return (Class<V>) conf.getClass(PregelixJob.PARTITIONER_CLASS, null, VertexPartitioner.class);
-    }
-
-    /**
-     * Get the user's subclassed checkpoint hook class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return The user defined vertex checkpoint hook class
-     */
-    @SuppressWarnings("unchecked")
-    public static <V extends ICheckpointHook> Class<V> getCheckpointHookClass(Configuration conf) {
-        return (Class<V>) conf.getClass(PregelixJob.CKP_CLASS, DefaultCheckpointHook.class, ICheckpointHook.class);
-    }
-
-    /**
-     * Get the user's subclassed iteration complete reporter hook class.
-     *
-     * @param conf
-     *            Configuration to check
-     * @return The user defined vertex iteration complete reporter class
-     */
-    @SuppressWarnings("unchecked")
-    public static <V extends IIterationCompleteReporterHook> Class<V> getIterationCompleteReporterHookClass(
-            Configuration conf) {
-        return (Class<V>) conf.getClass(PregelixJob.ITERATION_COMPLETE_CLASS,
-                DefaultIterationCompleteReporterHook.class, IIterationCompleteReporterHook.class);
-    }
-
-    /**
-     * Get the job configuration parameter whether the vertex states will increase dynamically
-     *
-     * @param conf
-     *            the job configuration
-     * @return the boolean setting of the parameter, by default it is false
-     */
-    public static boolean getDynamicVertexValueSize(Configuration conf) {
-        return conf.getBoolean(PregelixJob.INCREASE_STATE_LENGTH, true);
-    }
-
-    /**
-     * Get the specified frame size
-     *
-     * @param conf
-     *            the job configuration
-     * @return the specified frame size; -1 if it is not set by users
-     */
-    public static int getFrameSize(Configuration conf) {
-        return conf.getInt(PregelixJob.FRAME_SIZE, -1);
-    }
-
-    /**
-     * Should the job use LSM or B-tree to store vertices
-     *
-     * @param conf
-     * @return
-     */
-    public static boolean useLSM(Configuration conf) {
-        return conf.getBoolean(PregelixJob.UPDATE_INTENSIVE, false);
-    }
-
-    /***
-     * Get the spilling dir name for global aggregates
-     *
-     * @param conf
-     * @param superStep
-     * @return the spilling dir name
-     */
-    public static String getGlobalAggregateSpillingDirName(Configuration conf, long superStep) {
-        return TMP_DIR + conf.get(PregelixJob.JOB_ID) + "/agg/" + superStep;
-    }
-
-    /**
-     * Get the path for vertex checkpointing
-     *
-     * @param conf
-     * @param lastSuperStep
-     * @return the path for vertex checkpointing
-     */
-    public static String getVertexCheckpointPath(Configuration conf, long lastSuperStep) {
-        return TMP_DIR + BspUtils.getJobId(conf) + "/ckpoint/vertex/" + lastSuperStep;
-    }
-
-    /**
-     * Get the path for message checkpointing
-     *
-     * @param conf
-     * @param lastSuperStep
-     * @return the path for message checkpointing
-     */
-    public static String getMessageCheckpointPath(Configuration conf, long lastSuperStep) {
-        String path = TMP_DIR + BspUtils.getJobId(conf) + "/ckpoint/message/" + lastSuperStep;
-        return path;
-    }
-
-    /**
-     * Get the path for message checkpointing
-     *
-     * @param conf
-     * @param lastSuperStep
-     * @return the path for message checkpointing
-     */
-    public static String getSecondaryIndexCheckpointPath(Configuration conf, long lastSuperStep) {
-        return TMP_DIR + BspUtils.getJobId(conf) + "/ckpoint/secondaryindex/" + lastSuperStep;
-    }
-
-    /***
-     * Get the recovery count
-     *
-     * @return recovery count
-     */
-    public static int getRecoveryCount(Configuration conf) {
-        return conf.getInt(PregelixJob.RECOVERY_COUNT, 0);
-    }
-
-    /***
-     * Get enable dynamic optimization
-     *
-     * @param conf
-     *            Configuration
-     * @return true if enabled; otherwise false
-     */
-    public static boolean getEnableDynamicOptimization(Configuration conf) {
-        return conf.getBoolean(PregelixJob.DYNAMIC_OPTIMIZATION, false);
-    }
-
-    /***
-     * Get the user-set checkpoint interval
-     *
-     * @param conf
-     * @return the checkpoint interval
-     */
-    public static int getCheckpointingInterval(Configuration conf) {
-        return conf.getInt(PregelixJob.CKP_INTERVAL, -1);
-    }
-
-    /**
-     * Get the grouping algorithm
-     *
-     * @param conf
-     * @return true-sort; false-hash
-     */
-    public static boolean getGroupingAlgorithm(Configuration conf) {
-        return conf.getBoolean(PregelixJob.GROUPING_ALGORITHM, true);
-    }
-
-    /**
-     * Get the memory limit for the grouping algorithm (hash only)
-     *
-     * @param conf
-     * @return the memory limit for hash-based grouping
-     */
-    public static int getGroupingMemoryLimit(Configuration conf) {
-        return conf.getInt(PregelixJob.GROUPING_MEM, 1000);
-    }
-
-    /**
-     * Get the memory limit for the sort algorithm
-     *
-     * @param conf
-     * @return the memory limit for sorting
-     */
-    public static int getSortMemoryLimit(Configuration conf) {
-        return conf.getInt(PregelixJob.GROUPING_MEM, 1000);
-    }
-
-    /**
-     * Get the desired number of workers
-     *
-     * @param conf
-     * @return the number of workers
-     */
-    public static int getNumberWorkers(Configuration conf) {
-        return conf.getInt(PregelixJob.NUM_WORKERS, -1);
-    }
-
-    /**
-     * Get whether the combiner key can be skipped when calling a user-defined combine function
-     *
-     * @param conf
-     * @return true to skip; false otherwise
-     */
-    public static boolean getSkipCombinerKey(Configuration conf) {
-        return conf.getBoolean(PregelixJob.SKIP_COMBINER_KEY, false);
-    }
-
-    /**
-     * Get whether a merge connector is used
-     *
-     * @param conf
-     * @return true -merge; false-no merge
-     */
-    public static boolean getMergingConnector(Configuration conf) {
-        return conf.getBoolean(PregelixJob.MERGE_CONNECTOR, true);
-    }
-
-    /**
-     * return the maximum iteration number
-     *
-     * @param conf
-     * @return the maximum iteration number
-     */
-    public static int getMaxIteration(Configuration conf) {
-        return conf.getInt(PregelixJob.MAX_ITERATION, Integer.MAX_VALUE);
-    }
-
-    public static Writable readGlobalAggregateValue(Configuration conf, String jobId, String aggClassName)
-            throws HyracksDataException {
-        try {
-            FileSystem dfs = FileSystem.get(conf);
-            String pathStr = TMP_DIR + jobId + File.separator + "global-agg";
-            Path path = new Path(pathStr);
-            FSDataInputStream input = dfs.open(path);
-            int numOfAggs = createFinalAggregateValues(conf).size();
-            for (int i = 0; i < numOfAggs; i++) {
-                String aggName = input.readUTF();
-                Writable agg = createFinalAggregateValue(conf, aggName);
-                if (aggName.equals(aggClassName)) {
-                    agg.readFields(input);
-                    input.close();
-                    return agg;
-                } else {
-                    agg.readFields(input);
-                }
-            }
-            throw new IllegalStateException("Cannot find the aggregate value for " + aggClassName);
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-
-    public static HashMap<String, Writable> readAllGlobalAggregateValues(Configuration conf, String jobId)
-            throws HyracksDataException {
-        String pathStr = TMP_DIR + jobId + File.separator + "global-agg";
-        Path path = new Path(pathStr);
-        List<Writable> aggValues = createFinalAggregateValues(conf);
-        HashMap<String, Writable> finalAggs = new HashMap<>();
-        try {
-            FileSystem dfs = FileSystem.get(conf);
-            FSDataInputStream input = dfs.open(path);
-            for (int i = 0; i < aggValues.size(); i++) {
-                String aggName = input.readUTF();
-                aggValues.get(i).readFields(input);
-                finalAggs.put(aggName, aggValues.get(i));
-            }
-            input.close();
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-        return finalAggs;
-    }
-
-    public static Counters getCounters(PregelixJob job) throws HyracksDataException {
-        Configuration conf = job.getConfiguration();
-        String jobId = getJobId(conf);
-        int lastIter = BspUtils.readCountersLastIteration(conf, jobId);
-        return BspUtils.readCounters(lastIter, conf, jobId);
-    }
-
-    static Counters readCounters(int superstep, Configuration conf, String jobId) throws HyracksDataException {
-        String pathStr = TMP_DIR + jobId + File.separator + BspUtils.COUNTERS_VALUE_ON_ITERATION + superstep;
-        Path path = new Path(pathStr);
-        Counters savedCounters = new Counters();
-        try {
-            FileSystem dfs = FileSystem.get(conf);
-            FSDataInputStream input = dfs.open(path);
-            savedCounters.readFields(input);
-            input.close();
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-        return savedCounters;
-    }
-
-    static void writeCounters(Counters toWrite, int superstep, Configuration conf, String jobId)
-            throws HyracksDataException {
-        String pathStr = TMP_DIR + jobId + File.separator + BspUtils.COUNTERS_VALUE_ON_ITERATION + superstep;
-        Path path = new Path(pathStr);
-        try {
-            FileSystem dfs = FileSystem.get(conf);
-            FSDataOutputStream output = dfs.create(path, true);
-            toWrite.write(output);
-            output.close();
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-
-    static int readCountersLastIteration(Configuration conf, String jobId) throws HyracksDataException {
-        String pathStr = TMP_DIR + jobId + File.separator + BspUtils.COUNTERS_LAST_ITERATION_COMPLETED;
-        Path path = new Path(pathStr);
-        IntWritable lastIter = new IntWritable();
-        try {
-            FileSystem dfs = FileSystem.get(conf);
-            FSDataInputStream input = dfs.open(path);
-            lastIter.readFields(input);
-            input.close();
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-        return lastIter.get();
-    }
-
-    static void writeCountersLastIteration(int superstep, Configuration conf, String jobId) throws HyracksDataException {
-        String pathStr = TMP_DIR + jobId + File.separator + BspUtils.COUNTERS_LAST_ITERATION_COMPLETED;
-        Path path = new Path(pathStr);
-        try {
-            FileSystem dfs = FileSystem.get(conf);
-            FSDataOutputStream output = dfs.create(path, true);
-            new IntWritable(superstep).write(output);
-            output.close();
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-
-}

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/ConservativeCheckpointHook.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ConservativeCheckpointHook.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ConservativeCheckpointHook.java
deleted file mode 100644
index 9721589..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ConservativeCheckpointHook.java
+++ /dev/null
@@ -1,35 +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 edu.uci.ics.pregelix.api.job.ICheckpointHook;
-
-/**
- * A conservative checkpoint hook which does checkpoint every 2 supersteps
- * 
- * @author yingyib
- */
-public class ConservativeCheckpointHook implements ICheckpointHook {
-
-    @Override
-    public boolean checkpoint(int superstep) {
-        if (superstep % 2 == 0) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-}

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/DefaultCheckpointHook.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultCheckpointHook.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultCheckpointHook.java
deleted file mode 100644
index c37c4ab..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultCheckpointHook.java
+++ /dev/null
@@ -1,31 +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 edu.uci.ics.pregelix.api.job.ICheckpointHook;
-
-/**
- * The default checkpoint hook which never does checkpointing.
- * 
- * @author yingyib
- */
-public class DefaultCheckpointHook implements ICheckpointHook {
-
-    @Override
-    public boolean checkpoint(int superstep) {
-        return false;
-    }
-
-}

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/DefaultIterationCompleteReporterHook.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultIterationCompleteReporterHook.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultIterationCompleteReporterHook.java
deleted file mode 100644
index 7b004d8..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultIterationCompleteReporterHook.java
+++ /dev/null
@@ -1,37 +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 org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import edu.uci.ics.pregelix.api.job.IIterationCompleteReporterHook;
-import edu.uci.ics.pregelix.api.job.PregelixJob;
-
-/**
- * The default iteration complete reporter hook does nothing
- * 
- * @author wbiesing
- */
-public class DefaultIterationCompleteReporterHook implements IIterationCompleteReporterHook {
-
-    private static final Log LOG = LogFactory.getLog(DefaultIterationCompleteReporterHook.class);
-
-    @Override
-    public void completeIteration(int superstep, PregelixJob job) {
-        LOG.debug("iteration complete reporter for " + superstep + " job " + job.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/DefaultMessageCombiner.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultMessageCombiner.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultMessageCombiner.java
deleted file mode 100644
index a05666e..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultMessageCombiner.java
+++ /dev/null
@@ -1,119 +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 org.apache.hadoop.io.WritableComparable;
-
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.pregelix.api.graph.MessageCombiner;
-import edu.uci.ics.pregelix.api.graph.MsgList;
-import edu.uci.ics.pregelix.api.io.WritableSizable;
-
-@SuppressWarnings({ "rawtypes", "unchecked" })
-public class DefaultMessageCombiner<I extends WritableComparable, M extends WritableSizable> extends
-        MessageCombiner<I, M, MsgList> {
-    private MsgList<M> msgList;
-    private int metaSlot = 8;
-    private int accumulatedSize = metaSlot;
-
-    @Override
-    public void init(MsgList providedMsgList) {
-        realInit(providedMsgList);
-        this.msgList.setSegmentStart(false);
-    }
-
-    private void realInit(MsgList providedMsgList) {
-        this.msgList = providedMsgList;
-        this.msgList.clearElements();
-        this.accumulatedSize = metaSlot;
-    }
-
-    @Override
-    public void stepPartial(I vertexIndex, M msg) throws HyracksDataException {
-        msgList.addElement(msg);
-        accumulatedSize += msg.sizeInBytes();
-    }
-
-    @Override
-    public void stepFinal(I vertexIndex, MsgList partialAggregate) throws HyracksDataException {
-        msgList.addAllElements(partialAggregate);
-        for (int i = 0; i < partialAggregate.size(); i++) {
-            accumulatedSize += ((M) partialAggregate.get(i)).sizeInBytes();
-        }
-    }
-
-    @Override
-    public MsgList finishPartial() {
-        msgList.setSegmentEnd(false);
-        return msgList;
-    }
-
-    @Override
-    public MsgList<M> finishFinal() {
-        msgList.setSegmentEnd(false);
-        return msgList;
-    }
-
-    @Override
-    public void initAll(MsgList providedMsgList) {
-        realInit(providedMsgList);
-        msgList.setSegmentStart(true);
-    }
-
-    @Override
-    public MsgList<M> finishFinalAll() {
-        msgList.setSegmentEnd(true);
-        return msgList;
-    }
-
-    @Override
-    public int estimateAccumulatedStateByteSizePartial(I vertexIndex, M msg) throws HyracksDataException {
-        return accumulatedSize + msg.sizeInBytes();
-    }
-
-    @Override
-    public int estimateAccumulatedStateByteSizeFinal(I vertexIndex, MsgList partialAggregate)
-            throws HyracksDataException {
-        int size = accumulatedSize;
-        for (int i = 0; i < partialAggregate.size(); i++) {
-            size += ((M) partialAggregate.get(i)).sizeInBytes();
-        }
-        return size;
-    }
-
-    @Override
-    public int estimateAccumulatedStateByteSizePartial2(I vertexIndex, MsgList partialAggregate)
-            throws HyracksDataException {
-        int size = accumulatedSize;
-        for (int i = 0; i < partialAggregate.size(); i++) {
-            size += ((M) partialAggregate.get(i)).sizeInBytes();
-        }
-        return size;
-    }
-
-    @Override
-    public void stepPartial2(I vertexIndex, MsgList partialAggregate) throws HyracksDataException {
-        msgList.addAllElements(partialAggregate);
-        for (int i = 0; i < partialAggregate.size(); i++) {
-            accumulatedSize += ((M) partialAggregate.get(i)).sizeInBytes();
-        }
-    }
-
-    @Override
-    public MsgList finishPartial2() {
-        msgList.setSegmentEnd(false);
-        return msgList;
-    }
-}

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/DefaultVertexPartitioner.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultVertexPartitioner.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultVertexPartitioner.java
deleted file mode 100644
index 263ec65..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/DefaultVertexPartitioner.java
+++ /dev/null
@@ -1,35 +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 org.apache.hadoop.io.WritableComparable;
-
-import edu.uci.ics.pregelix.api.graph.VertexPartitioner;
-
-/**
- * The deafult vertex partitioner which use the hashcode of the vertex id to determine the partition
- * of the vertex.
- * 
- * @author yingyib
- */
-@SuppressWarnings("rawtypes")
-public class DefaultVertexPartitioner<I extends WritableComparable> extends VertexPartitioner<I> {
-
-    @Override
-    public int getPartitionId(I vertexId, int nPartitions) {
-        return vertexId.hashCode() % 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/util/FrameTupleUtils.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/FrameTupleUtils.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/FrameTupleUtils.java
deleted file mode 100644
index 943a130..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/FrameTupleUtils.java
+++ /dev/null
@@ -1,92 +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.IOException;
-import java.util.UUID;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
-import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-import edu.uci.ics.pregelix.api.io.Pointable;
-
-public class FrameTupleUtils {
-
-    public static void flushTuple(FrameTupleAppender appender, ArrayTupleBuilder tb, IFrameWriter writer)
-            throws HyracksDataException {
-        if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
-            FrameUtils.flushFrame(appender.getBuffer(), writer);
-            appender.reset(appender.getBuffer(), true);
-            if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
-                throw new IllegalStateException();
-            }
-        }
-    }
-
-    public static void flushPointableKeyValueTuple(FrameTupleAppender appender, IFrameWriter writer, Pointable key,
-            Pointable value) throws HyracksDataException {
-        if (!flushPointableKeyValueTupleInternal(appender, key, value)) {
-            FrameUtils.flushFrame(appender.getBuffer(), writer);
-            appender.reset(appender.getBuffer(), true);
-            if (!flushPointableKeyValueTupleInternal(appender, key, value)) {
-                throw new IllegalStateException();
-            }
-        }
-    }
-
-    private static boolean flushPointableKeyValueTupleInternal(FrameTupleAppender appender, Pointable key,
-            Pointable value) {
-        if (!appender.appendField(key.getByteArray(), key.getStartOffset(), key.getLength())) {
-            return false;
-        }
-        if (!appender.appendField(value.getByteArray(), value.getStartOffset(), value.getLength())) {
-            return false;
-        }
-        return true;
-    }
-
-    public static void flushTuplesFinal(FrameTupleAppender appender, IFrameWriter writer) throws HyracksDataException {
-        if (appender.getTupleCount() > 0) {
-            FrameUtils.flushFrame(appender.getBuffer(), writer);
-            appender.reset(appender.getBuffer(), true);
-        }
-    }
-
-    public static void flushTupleToHDFS(ArrayTupleBuilder atb, Configuration conf, long superStep)
-            throws HyracksDataException {
-        try {
-            if (atb.getSize() > 0) {
-                FileSystem dfs = FileSystem.get(conf);
-                String fileName = BspUtils.getGlobalAggregateSpillingDirName(conf, superStep) + "/" + UUID.randomUUID();
-                Path path = new Path(fileName);
-                FSDataOutputStream dos = dfs.create(path, true);
-                // write the partial aggregate value
-                dos.write(atb.getByteArray(), 0, atb.getSize());
-                dos.flush();
-                dos.close();
-            }
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-}

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/GlobalEdgeCountAggregator.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/GlobalEdgeCountAggregator.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/GlobalEdgeCountAggregator.java
deleted file mode 100644
index f2610e7..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/GlobalEdgeCountAggregator.java
+++ /dev/null
@@ -1,57 +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 org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.pregelix.api.graph.GlobalAggregator;
-import edu.uci.ics.pregelix.api.graph.Vertex;
-import edu.uci.ics.pregelix.api.io.WritableSizable;
-
-@SuppressWarnings("rawtypes")
-public class GlobalEdgeCountAggregator<I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable>
-        extends GlobalAggregator<I, V, E, M, LongWritable, LongWritable> {
-
-    private LongWritable state = new LongWritable(0);
-
-    @Override
-    public void init() {
-        state.set(0);
-    }
-
-    @Override
-    public void step(Vertex<I, V, E, M> v) throws HyracksDataException {
-        state.set(state.get() + v.getEdges().size());
-    }
-
-    @Override
-    public void step(LongWritable partialResult) {
-        state.set(state.get() + partialResult.get());
-    }
-
-    @Override
-    public LongWritable finishPartial() {
-        return state;
-    }
-
-    @Override
-    public LongWritable finishFinal() {
-        return state;
-    }
-
-}

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/GlobalVertexCountAggregator.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/GlobalVertexCountAggregator.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/GlobalVertexCountAggregator.java
deleted file mode 100644
index 71e572f..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/GlobalVertexCountAggregator.java
+++ /dev/null
@@ -1,57 +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 org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.pregelix.api.graph.GlobalAggregator;
-import edu.uci.ics.pregelix.api.graph.Vertex;
-import edu.uci.ics.pregelix.api.io.WritableSizable;
-
-@SuppressWarnings("rawtypes")
-public class GlobalVertexCountAggregator<I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable>
-        extends GlobalAggregator<I, V, E, M, LongWritable, LongWritable> {
-
-    private LongWritable state = new LongWritable(0);
-
-    @Override
-    public void init() {
-        state.set(0);
-    }
-
-    @Override
-    public void step(Vertex<I, V, E, M> v) throws HyracksDataException {
-        state.set(state.get() + 1);
-    }
-
-    @Override
-    public void step(LongWritable partialResult) {
-        state.set(state.get() + partialResult.get());
-    }
-
-    @Override
-    public LongWritable finishPartial() {
-        return state;
-    }
-
-    @Override
-    public LongWritable finishFinal() {
-        return state;
-    }
-
-}

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/HadoopCountersAggregator.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/HadoopCountersAggregator.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/HadoopCountersAggregator.java
deleted file mode 100644
index 45965c2..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/HadoopCountersAggregator.java
+++ /dev/null
@@ -1,85 +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.DataInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.Counters;
-
-import edu.uci.ics.pregelix.api.graph.GlobalAggregator;
-import edu.uci.ics.pregelix.api.io.WritableSizable;
-
-/**
- * A global aggregator that produces a Hadoop mapreduce.Counters object
- */
-@SuppressWarnings("rawtypes")
-public abstract class HadoopCountersAggregator<I extends WritableComparable, V extends Writable, E extends Writable, M extends WritableSizable, P extends Writable>
-        extends GlobalAggregator<I, V, E, M, Counters, Counters> {
-    private ResettableCounters counters = new ResettableCounters();
-
-    public Counters getCounters() {
-        return counters;
-    }
-
-    @Override
-    public void init() {
-        counters.reset();
-    }
-
-    @Override
-    public void step(Counters partialResult) {
-        counters.incrAllCounters(partialResult);
-    }
-
-    @Override
-    public Counters finishPartial() {
-        return counters;
-    }
-
-    @Override
-    public Counters finishFinal() {
-        return counters;
-    }
-
-    /**
-     * mapreduce.Counters object that is resettable via .reset()
-     */
-    public static class ResettableCounters extends Counters {
-        private static final DataInputStream zeroStream = new DataInputStream(new InputStream() {
-            @Override
-            public int read() throws IOException {
-                return 0;
-            }
-        });
-
-        /**
-         * Reset this Counters object
-         * 
-         * The reset is done by simulating a readFields() from a stream of 0's,
-         * indicating a serialized length of 0 groups. The Counters' cache is not changed. 
-         */
-        public void reset() {
-            try {
-                this.readFields(zeroStream);
-            } catch (IOException e) {
-                throw new RuntimeException("Unexpected failure when trying to reset Counters object!", e);
-            }
-        }
-    }
-}

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/HadoopCountersGlobalAggregateHook.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/HadoopCountersGlobalAggregateHook.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/HadoopCountersGlobalAggregateHook.java
deleted file mode 100644
index 35ff22c..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/HadoopCountersGlobalAggregateHook.java
+++ /dev/null
@@ -1,54 +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 org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.Counters;
-
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.pregelix.api.job.IIterationCompleteReporterHook;
-import edu.uci.ics.pregelix.api.job.PregelixJob;
-
-/**
- * Hook that aggregates a mapreduce.Counters object across all
- * iterations of a job, saving to HDFS
- * 
- * @author wbiesing
- */
-public class HadoopCountersGlobalAggregateHook implements IIterationCompleteReporterHook {
-
-    @Override
-    public void completeIteration(int superstep, PregelixJob job) throws HyracksDataException {
-        Configuration conf = job.getConfiguration();
-        String jobId = BspUtils.getJobId(conf);
-        Class<?> aggClass = conf.getClass(PregelixJob.COUNTERS_AGGREGATOR_CLASS, null);
-        if (aggClass == null)
-            throw new HyracksDataException(
-                    "A subclass of HadoopCountersAggregator must active for GlobalAggregateCountersHook to operate!");
-        Counters curIterCounters;
-        try {
-            curIterCounters = (Counters) BspUtils.readGlobalAggregateValue(conf, jobId, aggClass.getName());
-        } catch (IllegalStateException e) {
-            throw new HyracksDataException(
-                    "A subclass of HadoopCountersAggregator must active for GlobalAggregateCountersHook to operate!", e);
-        }
-        if (superstep > 1) {
-            Counters prevCounters = BspUtils.readCounters(superstep - 1, conf, jobId); // the counters from the previous iterations, all aggregated together
-            curIterCounters.incrAllCounters(prevCounters); // add my counters to previous ones
-        }
-        BspUtils.writeCounters(curIterCounters, superstep, conf, jobId);
-        BspUtils.writeCountersLastIteration(superstep, conf, jobId);
-    }
-}

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/JobStateUtils.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/JobStateUtils.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/JobStateUtils.java
deleted file mode 100644
index cdcf040..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/JobStateUtils.java
+++ /dev/null
@@ -1,65 +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.File;
-import java.io.IOException;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-
-/**
- * @author yingyib
- */
-public class JobStateUtils {
-
-    public static final String TMP_DIR = "/tmp/";
-
-    public static void writeForceTerminationState(Configuration conf, String jobId) throws HyracksDataException {
-        try {
-            FileSystem dfs = FileSystem.get(conf);
-            String pathStr = TMP_DIR + jobId + File.separator + "fterm";
-            Path path = new Path(pathStr);
-            if (!dfs.exists(path)) {
-                FSDataOutputStream output = dfs.create(path, true);
-                output.writeBoolean(true);
-                output.flush();
-                output.close();
-            }
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-
-    public static boolean readForceTerminationState(Configuration conf, String jobId) throws HyracksDataException {
-        try {
-            FileSystem dfs = FileSystem.get(conf);
-            String pathStr = TMP_DIR + jobId + File.separator + "fterm";
-            Path path = new Path(pathStr);
-            if (dfs.exists(path)) {
-                return true;
-            } else {
-                return false;
-            }
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-
-}

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/ReflectionUtils.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ReflectionUtils.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ReflectionUtils.java
deleted file mode 100644
index 3a85650..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ReflectionUtils.java
+++ /dev/null
@@ -1,163 +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.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Helper methods to get type arguments to generic classes. Courtesy of Ian
- * Robertson (overstock.com). Make sure to use with abstract generic classes,
- * not interfaces.
- */
-public class ReflectionUtils {
-    /**
-     * Do not instantiate.
-     */
-    private ReflectionUtils() {
-    }
-
-    /**
-     * Get the underlying class for a type, or null if the type is a variable
-     * type.
-     * 
-     * @param type
-     *            the type
-     * @return the underlying class
-     */
-    public static Class<?> getClass(Type type) {
-        if (type instanceof Class) {
-            return (Class<?>) type;
-        } else if (type instanceof ParameterizedType) {
-            return getClass(((ParameterizedType) type).getRawType());
-        } else if (type instanceof GenericArrayType) {
-            Type componentType = ((GenericArrayType) type).getGenericComponentType();
-            Class<?> componentClass = getClass(componentType);
-            if (componentClass != null) {
-                return Array.newInstance(componentClass, 0).getClass();
-            } else {
-                return null;
-            }
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Get the actual type arguments a child class has used to extend a generic
-     * base class.
-     * 
-     * @param <T>
-     *            Type to evaluate.
-     * @param baseClass
-     *            the base class
-     * @param childClass
-     *            the child class
-     * @return a list of the raw classes for the actual type arguments.
-     */
-    public static <T> List<Class<?>> getTypeArguments(Class<T> baseClass, Class<? extends T> childClass) {
-        Map<Type, Type> resolvedTypes = new HashMap<Type, Type>();
-        Type type = childClass;
-        // start walking up the inheritance hierarchy until we hit baseClass
-        while (!getClass(type).equals(baseClass)) {
-            if (type instanceof Class) {
-                // there is no useful information for us in raw types,
-                // so just keep going.
-                type = ((Class<?>) type).getGenericSuperclass();
-            } else {
-                ParameterizedType parameterizedType = (ParameterizedType) type;
-                Class<?> rawType = (Class<?>) parameterizedType.getRawType();
-
-                Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
-                TypeVariable<?>[] typeParameters = rawType.getTypeParameters();
-                for (int i = 0; i < actualTypeArguments.length; i++) {
-                    resolvedTypes.put(typeParameters[i], actualTypeArguments[i]);
-                }
-
-                if (!rawType.equals(baseClass)) {
-                    type = rawType.getGenericSuperclass();
-                }
-            }
-        }
-
-        // finally, for each actual type argument provided to baseClass,
-        // determine (if possible)
-        // the raw class for that type argument.
-        Type[] actualTypeArguments;
-        if (type instanceof Class) {
-            actualTypeArguments = ((Class<?>) type).getTypeParameters();
-        } else {
-            actualTypeArguments = ((ParameterizedType) type).getActualTypeArguments();
-        }
-        List<Class<?>> typeArgumentsAsClasses = new ArrayList<Class<?>>();
-        // resolve types by chasing down type variables.
-        for (Type baseType : actualTypeArguments) {
-            while (resolvedTypes.containsKey(baseType)) {
-                baseType = resolvedTypes.get(baseType);
-            }
-            typeArgumentsAsClasses.add(getClass(baseType));
-        }
-        return typeArgumentsAsClasses;
-    }
-
-    /**
-     * Try to directly set a (possibly private) field on an Object.
-     * 
-     * @param target
-     *            Target to set the field on.
-     * @param fieldname
-     *            Name of field.
-     * @param value
-     *            Value to set on target.
-     */
-    public static void setField(Object target, String fieldname, Object value) throws NoSuchFieldException,
-            IllegalAccessException {
-        Field field = findDeclaredField(target.getClass(), fieldname);
-        field.setAccessible(true);
-        field.set(target, value);
-    }
-
-    /**
-     * Find a declared field in a class or one of its super classes
-     * 
-     * @param inClass
-     *            Class to search for declared field.
-     * @param fieldname
-     *            Field name to search for
-     * @return Field or will throw.
-     * @throws NoSuchFieldException
-     *             When field not found.
-     */
-    private static Field findDeclaredField(Class<?> inClass, String fieldname) throws NoSuchFieldException {
-        while (!Object.class.equals(inClass)) {
-            for (Field field : inClass.getDeclaredFields()) {
-                if (field.getName().equalsIgnoreCase(fieldname)) {
-                    return field;
-                }
-            }
-            inClass = inClass.getSuperclass();
-        }
-        throw new NoSuchFieldException();
-    }
-}

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/ResetableByteArrayInputStream.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ResetableByteArrayInputStream.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ResetableByteArrayInputStream.java
deleted file mode 100755
index c7febc1..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ResetableByteArrayInputStream.java
+++ /dev/null
@@ -1,55 +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.InputStream;
-
-public class ResetableByteArrayInputStream extends InputStream {
-
-    private byte[] data;
-    private int position;
-
-    public ResetableByteArrayInputStream() {
-    }
-
-    public void setByteArray(byte[] data, int position) {
-        this.data = data;
-        this.position = position;
-    }
-
-    @Override
-    public int read() {
-        int remaining = data.length - position;
-        int value = remaining > 0 ? (data[position++] & 0xff) : -1;
-        return value;
-    }
-
-    @Override
-    public int read(byte[] bytes, int offset, int length) {
-        int remaining = data.length - position;
-        if (remaining == 0) {
-            return -1;
-        }
-        int l = Math.min(length, remaining);
-        System.arraycopy(data, position, bytes, offset, l);
-        position += l;
-        return l;
-    }
-
-    @Override
-    public int available() {
-        return data.length - position;
-    }
-}

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/ResetableByteArrayOutputStream.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ResetableByteArrayOutputStream.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ResetableByteArrayOutputStream.java
deleted file mode 100755
index abd9f00..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/ResetableByteArrayOutputStream.java
+++ /dev/null
@@ -1,47 +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.OutputStream;
-
-public class ResetableByteArrayOutputStream extends OutputStream {
-
-    private byte[] data;
-    private int position;
-
-    public ResetableByteArrayOutputStream() {
-    }
-
-    public void setByteArray(byte[] data, int position) {
-        this.data = data;
-        this.position = position;
-    }
-
-    @Override
-    public void write(int b) {
-        if (position + 1 > data.length - 1)
-            throw new IndexOutOfBoundsException();
-        data[position] = (byte) b;
-        position++;
-    }
-
-    @Override
-    public void write(byte[] bytes, int offset, int length) {
-        if (position + length > data.length - 1)
-            throw new IndexOutOfBoundsException();
-        System.arraycopy(bytes, offset, data, position, length);
-        position += length;
-    }
-}
\ No newline at end of file

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/SerDeUtils.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/SerDeUtils.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/SerDeUtils.java
deleted file mode 100644
index a4336a3..0000000
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/util/SerDeUtils.java
+++ /dev/null
@@ -1,43 +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.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInput;
-import java.io.DataInputStream;
-import java.io.DataOutput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.hadoop.io.Writable;
-
-public class SerDeUtils {
-
-    public static byte[] serialize(Writable object) throws IOException {
-        ByteArrayOutputStream bbos = new ByteArrayOutputStream();
-        DataOutput output = new DataOutputStream(bbos);
-        object.write(output);
-        return bbos.toByteArray();
-    }
-
-    public static void deserialize(Writable object, byte[] buffer) throws IOException {
-        ByteArrayInputStream bbis = new ByteArrayInputStream(buffer);
-        DataInput input = new DataInputStream(bbis);
-        object.readFields(input);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-benchmark/pom.xml
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-benchmark/pom.xml b/pregelix/pregelix-benchmark/pom.xml
deleted file mode 100644
index 909441b..0000000
--- a/pregelix/pregelix-benchmark/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<artifactId>pregelix</artifactId>
-		<groupId>edu.uci.ics.hyracks</groupId>
-		<version>0.2.14-SNAPSHOT</version>
-	</parent>
-
-	<artifactId>pregelix-benchmark</artifactId>
-	<name>pregelix-benchmark</name>
-	<url>http://maven.apache.org</url>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<version>2.0.2</version>
-				<configuration>
-					<source>1.7</source>
-					<target>1.7</target>
-					<fork>true</fork>
-				</configuration>
-			</plugin>
-
-			<plugin>
-				<artifactId>maven-assembly-plugin</artifactId>
-				<version>2.2-beta-5</version>
-				<configuration>
-					<descriptorRefs>
-						<descriptorRef>jar-with-dependencies</descriptorRef>
-					</descriptorRefs>
-				</configuration>
-				<executions>
-					<execution>
-						<id>make-my-jar-with-dependencies</id>
-						<phase>package</phase>
-						<goals>
-							<goal>single</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-
-
-	<dependencies>
-		<dependency>
-			<groupId>org.apache.giraph</groupId>
-			<artifactId>giraph-core</artifactId>
-			<version>1.0.0</version>
-			<scope>compile</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.giraph</groupId>
-			<artifactId>giraph-examples</artifactId>
-			<version>1.0.0</version>
-			<scope>compile</scope>
-		</dependency>
-		<dependency>
-			<groupId>edu.uci.ics.hyracks</groupId>
-			<artifactId>hyracks-hdfs-core</artifactId>
-			<version>0.2.14-SNAPSHOT</version>
-			<type>jar</type>
-			<scope>compile</scope>
-		</dependency>
-	</dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/pregelix/pregelix-benchmark/src/main/java/edu/uci/ics/pregelix/benchmark/io/TextCCInputFormat.java
----------------------------------------------------------------------
diff --git a/pregelix/pregelix-benchmark/src/main/java/edu/uci/ics/pregelix/benchmark/io/TextCCInputFormat.java b/pregelix/pregelix-benchmark/src/main/java/edu/uci/ics/pregelix/benchmark/io/TextCCInputFormat.java
deleted file mode 100644
index 90cea28..0000000
--- a/pregelix/pregelix-benchmark/src/main/java/edu/uci/ics/pregelix/benchmark/io/TextCCInputFormat.java
+++ /dev/null
@@ -1,72 +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.benchmark.io;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Map.Entry;
-
-import org.apache.giraph.edge.Edge;
-import org.apache.giraph.edge.MapMutableEdge;
-import org.apache.giraph.io.formats.TextVertexInputFormat;
-import org.apache.hadoop.io.VLongWritable;
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-
-public class TextCCInputFormat extends TextVertexInputFormat<VLongWritable, VLongWritable, NullWritable> {
-
-    @Override
-    public TextVertexReader createVertexReader(InputSplit split, TaskAttemptContext context) throws IOException {
-        return new TextVertexReaderFromEachLine() {
-            StringTokenizer items;
-
-            @Override
-            protected VLongWritable getId(Text line) throws IOException {
-                items = new StringTokenizer(line.toString());
-                return new VLongWritable(Long.parseLong(items.nextToken()));
-            }
-
-            @Override
-            protected VLongWritable getValue(Text line) throws IOException {
-                return null;
-            }
-
-            @Override
-            protected Iterable<Edge<VLongWritable, NullWritable>> getEdges(Text line) throws IOException {
-                List<Edge<VLongWritable, NullWritable>> edges = new ArrayList<Edge<VLongWritable, NullWritable>>();
-                Map<VLongWritable, NullWritable> edgeMap = new HashMap<VLongWritable, NullWritable>();
-                while (items.hasMoreTokens()) {
-                    edgeMap.put(new VLongWritable(Long.parseLong(items.nextToken())), null);
-                }
-                for (Entry<VLongWritable, NullWritable> entry : edgeMap.entrySet()) {
-                    MapMutableEdge<VLongWritable, NullWritable> edge = new MapMutableEdge<VLongWritable, NullWritable>();
-                    edge.setEntry(entry);
-                    edge.setValue(null);
-                    edges.add(edge);
-                }
-                return edges;
-            }
-
-        };
-    }
-
-}


Mime
View raw message