giraph-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject [4/6] GIRAPH-447: Clean up GiraphConfiguration related things (nitay).
Date Thu, 13 Dec 2012 20:03:37 GMT
http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/BspServiceMaster.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/BspServiceMaster.java b/giraph/src/main/java/org/apache/giraph/graph/BspServiceMaster.java
index b030273..5638039 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/BspServiceMaster.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/BspServiceMaster.java
@@ -19,8 +19,6 @@
 package org.apache.giraph.graph;
 
 import org.apache.commons.io.FilenameUtils;
-import org.apache.giraph.GiraphConfiguration;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.bsp.ApplicationState;
 import org.apache.giraph.bsp.BspInputFormat;
 import org.apache.giraph.bsp.CentralizedServiceMaster;
@@ -29,6 +27,8 @@ import org.apache.giraph.comm.MasterClient;
 import org.apache.giraph.comm.MasterServer;
 import org.apache.giraph.comm.netty.NettyMasterClient;
 import org.apache.giraph.comm.netty.NettyMasterServer;
+import org.apache.giraph.conf.GiraphConstants;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.counters.GiraphStats;
 import org.apache.giraph.graph.GraphMapper.MapFunctions;
 import org.apache.giraph.graph.partition.MasterGraphPartitioner;
@@ -184,20 +184,20 @@ public class BspServiceMaster<I extends WritableComparable,
 
     ImmutableClassesGiraphConfiguration<I, V, E, M> conf = getConfiguration();
 
-    maxWorkers = conf.getInt(GiraphConfiguration.MAX_WORKERS, -1);
-    minWorkers = conf.getInt(GiraphConfiguration.MIN_WORKERS, -1);
+    maxWorkers = conf.getInt(GiraphConstants.MAX_WORKERS, -1);
+    minWorkers = conf.getInt(GiraphConstants.MIN_WORKERS, -1);
     minPercentResponded = conf.getFloat(
-        GiraphConfiguration.MIN_PERCENT_RESPONDED, 100.0f);
+        GiraphConstants.MIN_PERCENT_RESPONDED, 100.0f);
     eventWaitMsecs = conf.getEventWaitMsecs();
     maxSuperstepWaitMsecs = conf.getMaxMasterSuperstepWaitMsecs();
     partitionLongTailMinPrint = conf.getInt(
-        GiraphConfiguration.PARTITION_LONG_TAIL_MIN_PRINT,
-        GiraphConfiguration.PARTITION_LONG_TAIL_MIN_PRINT_DEFAULT);
+        GiraphConstants.PARTITION_LONG_TAIL_MIN_PRINT,
+        GiraphConstants.PARTITION_LONG_TAIL_MIN_PRINT_DEFAULT);
     masterGraphPartitioner =
         getGraphPartitionerFactory().createMasterGraphPartitioner();
     observers = getConfiguration().createMasterObservers();
 
-    GiraphMetrics.getInstance().addSuperstepResetObserver(this);
+    GiraphMetrics.get().addSuperstepResetObserver(this);
     GiraphStats.init(context);
   }
 
@@ -272,10 +272,10 @@ public class BspServiceMaster<I extends WritableComparable,
     }
     float samplePercent =
         getConfiguration().getFloat(
-            GiraphConfiguration.INPUT_SPLIT_SAMPLE_PERCENT,
-            GiraphConfiguration.INPUT_SPLIT_SAMPLE_PERCENT_DEFAULT);
+            GiraphConstants.INPUT_SPLIT_SAMPLE_PERCENT,
+            GiraphConstants.INPUT_SPLIT_SAMPLE_PERCENT_DEFAULT);
     if (samplePercent !=
-        GiraphConfiguration.INPUT_SPLIT_SAMPLE_PERCENT_DEFAULT) {
+        GiraphConstants.INPUT_SPLIT_SAMPLE_PERCENT_DEFAULT) {
       int lastIndex = (int) (samplePercent * splits.size() / 100f);
       List<InputSplit> sampleSplits = splits.subList(0, lastIndex);
       LOG.warn(logPrefix + ": Using sampling - Processing only " +
@@ -1301,8 +1301,8 @@ public class BspServiceMaster<I extends WritableComparable,
   private void cleanUpOldSuperstep(long removeableSuperstep) throws
       InterruptedException {
     if (!(getConfiguration().getBoolean(
-        GiraphConfiguration.KEEP_ZOOKEEPER_DATA,
-        GiraphConfiguration.KEEP_ZOOKEEPER_DATA_DEFAULT)) &&
+        GiraphConstants.KEEP_ZOOKEEPER_DATA,
+        GiraphConstants.KEEP_ZOOKEEPER_DATA_DEFAULT)) &&
         (removeableSuperstep >= 0)) {
       String oldSuperstepPath =
           getSuperstepPath(getApplicationAttempt()) + "/" +
@@ -1595,8 +1595,8 @@ public class BspServiceMaster<I extends WritableComparable,
     try {
       if (getConfiguration().getZookeeperList() != null &&
           !getConfiguration().getBoolean(
-              GiraphConfiguration.KEEP_ZOOKEEPER_DATA,
-              GiraphConfiguration.KEEP_ZOOKEEPER_DATA_DEFAULT)) {
+              GiraphConstants.KEEP_ZOOKEEPER_DATA,
+              GiraphConstants.KEEP_ZOOKEEPER_DATA_DEFAULT)) {
         if (LOG.isInfoEnabled()) {
           LOG.info("cleanupZooKeeper: Removing the following path " +
               "and all children - " + basePath + " from ZooKeeper list " +
@@ -1663,8 +1663,8 @@ public class BspServiceMaster<I extends WritableComparable,
       cleanUpZooKeeper();
       // If desired, cleanup the checkpoint directory
       if (getConfiguration().getBoolean(
-          GiraphConfiguration.CLEANUP_CHECKPOINTS_AFTER_SUCCESS,
-          GiraphConfiguration.CLEANUP_CHECKPOINTS_AFTER_SUCCESS_DEFAULT)) {
+          GiraphConstants.CLEANUP_CHECKPOINTS_AFTER_SUCCESS,
+          GiraphConstants.CLEANUP_CHECKPOINTS_AFTER_SUCCESS_DEFAULT)) {
         boolean success =
             getFs().delete(new Path(checkpointBasePath), true);
         if (LOG.isInfoEnabled()) {

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/BspServiceWorker.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/BspServiceWorker.java b/giraph/src/main/java/org/apache/giraph/graph/BspServiceWorker.java
index 973c257..7bbf0a4 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/BspServiceWorker.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/BspServiceWorker.java
@@ -19,7 +19,6 @@
 package org.apache.giraph.graph;
 
 
-import org.apache.giraph.GiraphConfiguration;
 import org.apache.giraph.bsp.ApplicationState;
 import org.apache.giraph.bsp.CentralizedServiceWorker;
 import org.apache.giraph.comm.ServerData;
@@ -31,6 +30,7 @@ import org.apache.giraph.comm.netty.NettyWorkerAggregatorRequestProcessor;
 import org.apache.giraph.comm.netty.NettyWorkerClient;
 import org.apache.giraph.comm.netty.NettyWorkerClientRequestProcessor;
 import org.apache.giraph.comm.netty.NettyWorkerServer;
+import org.apache.giraph.conf.GiraphConstants;
 import org.apache.giraph.graph.partition.Partition;
 import org.apache.giraph.graph.partition.PartitionExchange;
 import org.apache.giraph.graph.partition.PartitionOwner;
@@ -177,7 +177,7 @@ public class BspServiceWorker<I extends WritableComparable,
     aggregatorHandler =
         new WorkerAggregatorHandler(this, getConfiguration(), context);
 
-    GiraphMetrics.getInstance().addSuperstepResetObserver(this);
+    GiraphMetrics.get().addSuperstepResetObserver(this);
   }
 
   @Override
@@ -855,7 +855,7 @@ else[HADOOP_NON_SECURE]*/
   private void saveVertices() throws IOException, InterruptedException {
     if (getConfiguration().getVertexOutputFormatClass() == null) {
       LOG.warn("saveVertices: " +
-          GiraphConfiguration.VERTEX_OUTPUT_FORMAT_CLASS +
+          GiraphConstants.VERTEX_OUTPUT_FORMAT_CLASS +
           " not specified -- there will be no saved output");
       return;
     }
@@ -924,7 +924,7 @@ else[HADOOP_NON_SECURE]*/
     }
 
     if (getConfiguration().metricsEnabled()) {
-      GiraphMetrics.getInstance().dumpToStdout();
+      GiraphMetrics.get().dumpToStdout();
     }
 
     // Preferably would shut down the service only after

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/BspUtils.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/BspUtils.java b/giraph/src/main/java/org/apache/giraph/graph/BspUtils.java
index 3176bdf..651290d 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/BspUtils.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/BspUtils.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.GiraphConfiguration;
+import org.apache.giraph.conf.GiraphConstants;
 import org.apache.giraph.graph.partition.GraphPartitionerFactory;
 import org.apache.giraph.graph.partition.HashPartitionerFactory;
 import org.apache.giraph.graph.partition.PartitionStats;
@@ -54,7 +54,7 @@ public class BspUtils {
   Class<? extends GraphPartitionerFactory<I, V, E, M>>
   getGraphPartitionerClass(Configuration conf) {
     return (Class<? extends GraphPartitionerFactory<I, V, E, M>>)
-      conf.getClass(GiraphConfiguration.GRAPH_PARTITIONER_FACTORY_CLASS,
+      conf.getClass(GiraphConstants.GRAPH_PARTITIONER_FACTORY_CLASS,
         HashPartitionerFactory.class,
         GraphPartitionerFactory.class);
   }
@@ -117,7 +117,7 @@ public class BspUtils {
   Class<? extends VertexInputFormat<I, V, E, M>>
   getVertexInputFormatClass(Configuration conf) {
     return (Class<? extends VertexInputFormat<I, V, E, M>>)
-      conf.getClass(GiraphConfiguration.VERTEX_INPUT_FORMAT_CLASS,
+      conf.getClass(GiraphConstants.VERTEX_INPUT_FORMAT_CLASS,
         null,
         VertexInputFormat.class);
   }
@@ -161,7 +161,7 @@ public class BspUtils {
   Class<? extends VertexOutputFormat<I, V, E>>
   getVertexOutputFormatClass(Configuration conf) {
     return (Class<? extends VertexOutputFormat<I, V, E>>)
-      conf.getClass(GiraphConfiguration.VERTEX_OUTPUT_FORMAT_CLASS,
+      conf.getClass(GiraphConstants.VERTEX_OUTPUT_FORMAT_CLASS,
         null,
         VertexOutputFormat.class);
   }
@@ -197,7 +197,7 @@ public class BspUtils {
   Class<? extends EdgeInputFormat<I, E>>
   getEdgeInputFormatClass(Configuration conf) {
     return (Class<? extends EdgeInputFormat<I, E>>)
-        conf.getClass(GiraphConfiguration.EDGE_INPUT_FORMAT_CLASS,
+        conf.getClass(GiraphConstants.EDGE_INPUT_FORMAT_CLASS,
             null,
             EdgeInputFormat.class);
   }
@@ -228,9 +228,9 @@ public class BspUtils {
    */
   public static Class<? extends AggregatorWriter>
   getAggregatorWriterClass(Configuration conf) {
-    return conf.getClass(GiraphConfiguration.AGGREGATOR_WRITER_CLASS,
-      TextAggregatorWriter.class,
-      AggregatorWriter.class);
+    return conf.getClass(GiraphConstants.AGGREGATOR_WRITER_CLASS,
+        TextAggregatorWriter.class,
+        AggregatorWriter.class);
   }
 
   /**
@@ -257,7 +257,7 @@ public class BspUtils {
   public static <I extends WritableComparable, M extends Writable>
   Class<? extends Combiner<I, M>> getCombinerClass(Configuration conf) {
     return (Class<? extends Combiner<I, M>>)
-      conf.getClass(GiraphConfiguration.VERTEX_COMBINER_CLASS,
+      conf.getClass(GiraphConstants.VERTEX_COMBINER_CLASS,
         null,
         Combiner.class);
   }
@@ -279,7 +279,7 @@ public class BspUtils {
   Class<? extends VertexResolver<I, V, E, M>>
   getVertexResolverClass(Configuration conf) {
     return (Class<? extends VertexResolver<I, V, E, M>>)
-      conf.getClass(GiraphConfiguration.VERTEX_RESOLVER_CLASS,
+      conf.getClass(GiraphConstants.VERTEX_RESOLVER_CLASS,
         DefaultVertexResolver.class,
         VertexResolver.class);
   }
@@ -293,7 +293,7 @@ public class BspUtils {
   public static Class<? extends WorkerContext>
   getWorkerContextClass(Configuration conf) {
     return (Class<? extends WorkerContext>)
-      conf.getClass(GiraphConfiguration.WORKER_CONTEXT_CLASS,
+      conf.getClass(GiraphConstants.WORKER_CONTEXT_CLASS,
         DefaultWorkerContext.class,
         WorkerContext.class);
   }
@@ -331,7 +331,7 @@ public class BspUtils {
   public static Class<? extends MasterCompute>
   getMasterComputeClass(Configuration conf) {
     return (Class<? extends MasterCompute>)
-      conf.getClass(GiraphConfiguration.MASTER_COMPUTE_CLASS,
+      conf.getClass(GiraphConstants.MASTER_COMPUTE_CLASS,
         DefaultMasterCompute.class,
         MasterCompute.class);
   }
@@ -366,7 +366,7 @@ public class BspUtils {
   E extends Writable, M extends Writable>
   Class<? extends Vertex<I, V, E, M>> getVertexClass(Configuration conf) {
     return (Class<? extends Vertex<I, V, E, M>>)
-      conf.getClass(GiraphConfiguration.VERTEX_CLASS,
+      conf.getClass(GiraphConstants.VERTEX_CLASS,
         null,
         Vertex.class);
   }
@@ -401,7 +401,7 @@ public class BspUtils {
   @SuppressWarnings("unchecked")
   public static <I extends Writable> Class<I>
   getVertexIdClass(Configuration conf) {
-    return (Class<I>) conf.getClass(GiraphConfiguration.VERTEX_ID_CLASS,
+    return (Class<I>) conf.getClass(GiraphConstants.VERTEX_ID_CLASS,
       WritableComparable.class);
   }
 
@@ -437,7 +437,7 @@ public class BspUtils {
   @SuppressWarnings("unchecked")
   public static <V extends Writable> Class<V>
   getVertexValueClass(Configuration conf) {
-    return (Class<V>) conf.getClass(GiraphConfiguration.VERTEX_VALUE_CLASS,
+    return (Class<V>) conf.getClass(GiraphConstants.VERTEX_VALUE_CLASS,
       Writable.class);
   }
 
@@ -477,7 +477,7 @@ public class BspUtils {
   @SuppressWarnings("unchecked")
   public static <E extends Writable> Class<E>
   getEdgeValueClass(Configuration conf) {
-    return (Class<E>) conf.getClass(GiraphConfiguration.EDGE_VALUE_CLASS,
+    return (Class<E>) conf.getClass(GiraphConstants.EDGE_VALUE_CLASS,
       Writable.class);
   }
 
@@ -517,33 +517,7 @@ public class BspUtils {
   @SuppressWarnings("unchecked")
   public static <M extends Writable> Class<M>
   getMessageValueClass(Configuration conf) {
-    return (Class<M>) conf.getClass(GiraphConfiguration.MESSAGE_VALUE_CLASS,
+    return (Class<M>) conf.getClass(GiraphConstants.MESSAGE_VALUE_CLASS,
       Writable.class);
   }
-
-  /**
-   * Create a user vertex message value
-   *
-   * @param <M> Message data
-   * @param conf Configuration to check
-   * @return Instantiated user vertex message value
-   */
-  @SuppressWarnings("unchecked")
-  public static <M extends Writable> M
-  createMessageValue(Configuration conf) {
-    Class<M> messageValueClass = getMessageValueClass(conf);
-    if (messageValueClass == NullWritable.class) {
-      return (M) NullWritable.get();
-    } else {
-      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);
-      }
-    }
-  }
 }

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/ComputeCallable.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/ComputeCallable.java b/giraph/src/main/java/org/apache/giraph/graph/ComputeCallable.java
index c18495b..fa1bda3 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/ComputeCallable.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/ComputeCallable.java
@@ -26,7 +26,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.Callable;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.bsp.CentralizedServiceWorker;
 import org.apache.giraph.comm.WorkerClientRequestProcessor;
 import org.apache.giraph.comm.messages.MessageStoreByPartition;
@@ -114,7 +114,7 @@ public class ComputeCallable<I extends WritableComparable, V extends Writable,
     // Will be replaced later in call() for locality
     this.graphState = graphState;
 
-    GiraphMetrics metrics = GiraphMetrics.getInstance();
+    GiraphMetrics metrics = GiraphMetrics.get();
     // Normally we would use ResetSuperstepMetricsObserver but this class is
     // not long-lived, so just instantiating in the constructor is good enough.
     computeOneTimer = metrics.perSuperstep().getTimer(TIMER_COMPUTE_ONE);

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/DefaultVertexResolver.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/DefaultVertexResolver.java b/giraph/src/main/java/org/apache/giraph/graph/DefaultVertexResolver.java
index 5b8a9b4..5b5bede 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/DefaultVertexResolver.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/DefaultVertexResolver.java
@@ -18,8 +18,8 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.log4j.Logger;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/EdgeInputSplitsCallable.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/EdgeInputSplitsCallable.java b/giraph/src/main/java/org/apache/giraph/graph/EdgeInputSplitsCallable.java
index f8ee1a6..4e0a543 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/EdgeInputSplitsCallable.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/EdgeInputSplitsCallable.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.metrics.GiraphMetrics;
 import org.apache.giraph.metrics.GiraphMetricsRegistry;
 import org.apache.giraph.utils.LoggerUtils;
@@ -89,7 +89,7 @@ public class EdgeInputSplitsCallable<I extends WritableComparable,
     inputSplitMaxEdges = configuration.getInputSplitMaxEdges();
 
     // Initialize Metrics
-    GiraphMetricsRegistry jobMetrics = GiraphMetrics.getInstance().perJob();
+    GiraphMetricsRegistry jobMetrics = GiraphMetrics.get().perJob();
     edgesLoadedCounter = jobMetrics.getCounter(COUNTER_EDGES_LOADED);
   }
 

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/EdgeInputSplitsCallableFactory.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/EdgeInputSplitsCallableFactory.java b/giraph/src/main/java/org/apache/giraph/graph/EdgeInputSplitsCallableFactory.java
index 34a8a39..41292c7 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/EdgeInputSplitsCallableFactory.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/EdgeInputSplitsCallableFactory.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.zk.ZooKeeperExt;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/GiraphJob.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/GiraphJob.java b/giraph/src/main/java/org/apache/giraph/graph/GiraphJob.java
index 8221473..ae7e39c 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/GiraphJob.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/GiraphJob.java
@@ -18,10 +18,11 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.GiraphConfiguration;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.bsp.BspInputFormat;
 import org.apache.giraph.bsp.BspOutputFormat;
+import org.apache.giraph.conf.GiraphConfiguration;
+import org.apache.giraph.conf.GiraphConstants;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.ipc.Client;
 import org.apache.hadoop.mapreduce.Job;
@@ -137,27 +138,27 @@ public class GiraphJob {
   private void checkConfiguration(ImmutableClassesGiraphConfiguration conf) {
     if (conf.getMaxWorkers() < 0) {
       throw new RuntimeException("checkConfiguration: No valid " +
-          GiraphConfiguration.MAX_WORKERS);
+          GiraphConstants.MAX_WORKERS);
     }
     if (conf.getMinPercentResponded() <= 0.0f ||
         conf.getMinPercentResponded() > 100.0f) {
       throw new IllegalArgumentException(
           "checkConfiguration: Invalid " + conf.getMinPercentResponded() +
-              " for " + GiraphConfiguration.MIN_PERCENT_RESPONDED);
+              " for " + GiraphConstants.MIN_PERCENT_RESPONDED);
     }
     if (conf.getMinWorkers() < 0) {
       throw new IllegalArgumentException("checkConfiguration: No valid " +
-          GiraphConfiguration.MIN_WORKERS);
+          GiraphConstants.MIN_WORKERS);
     }
     if (conf.getVertexClass() == null) {
       throw new IllegalArgumentException("checkConfiguration: Null" +
-          GiraphConfiguration.VERTEX_CLASS);
+          GiraphConstants.VERTEX_CLASS);
     }
     if (conf.getVertexInputFormatClass() == null &&
         conf.getEdgeInputFormatClass() == null) {
       throw new IllegalArgumentException("checkConfiguration: One of " +
-          GiraphConfiguration.VERTEX_INPUT_FORMAT_CLASS + " and " +
-          GiraphConfiguration.EDGE_INPUT_FORMAT_CLASS + " must be non-null");
+          GiraphConstants.VERTEX_INPUT_FORMAT_CLASS + " and " +
+          GiraphConstants.EDGE_INPUT_FORMAT_CLASS + " must be non-null");
     }
     if (conf.getEdgeInputFormatClass() != null &&
         !(MutableVertex.class.isAssignableFrom(conf.getVertexClass()))) {
@@ -167,7 +168,7 @@ public class GiraphJob {
     if (conf.getVertexResolverClass() == null) {
       if (LOG.isInfoEnabled()) {
         LOG.info("checkConfiguration: No class found for " +
-            GiraphConfiguration.VERTEX_RESOLVER_CLASS + ", defaulting to " +
+            GiraphConstants.VERTEX_RESOLVER_CLASS + ", defaulting to " +
             DefaultVertexResolver.class.getCanonicalName());
       }
     }
@@ -256,7 +257,7 @@ public class GiraphJob {
       if (LOG.isInfoEnabled()) {
         LOG.info("run: Since checkpointing is disabled (default), " +
             "do not allow any task retries (setting " +
-            GiraphConfiguration.MAX_TASK_ATTEMPTS + " = 0, " +
+            GiraphConstants.MAX_TASK_ATTEMPTS + " = 0, " +
             "old value = " + oldMaxTaskAttempts + ")");
       }
     }

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/GraphMapper.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/GraphMapper.java b/giraph/src/main/java/org/apache/giraph/graph/GraphMapper.java
index 3e3c788..eb35723 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/GraphMapper.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/GraphMapper.java
@@ -18,11 +18,11 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.GiraphConfiguration;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.bsp.CentralizedServiceMaster;
 import org.apache.giraph.bsp.CentralizedServiceWorker;
 import org.apache.giraph.comm.messages.MessageStoreByPartition;
+import org.apache.giraph.conf.GiraphConstants;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.graph.partition.PartitionOwner;
 import org.apache.giraph.graph.partition.PartitionStats;
 import org.apache.giraph.metrics.GiraphMetrics;
@@ -208,16 +208,16 @@ public class GraphMapper<I extends WritableComparable, V extends Writable,
     Type vertexValueType = classList.get(1);
     Type edgeValueType = classList.get(2);
     Type messageValueType = classList.get(3);
-    conf.setClass(GiraphConfiguration.VERTEX_ID_CLASS,
+    conf.setClass(GiraphConstants.VERTEX_ID_CLASS,
         (Class<?>) vertexIndexType,
         WritableComparable.class);
-    conf.setClass(GiraphConfiguration.VERTEX_VALUE_CLASS,
+    conf.setClass(GiraphConstants.VERTEX_VALUE_CLASS,
         (Class<?>) vertexValueType,
         Writable.class);
-    conf.setClass(GiraphConfiguration.EDGE_VALUE_CLASS,
+    conf.setClass(GiraphConstants.EDGE_VALUE_CLASS,
         (Class<?>) edgeValueType,
         Writable.class);
-    conf.setClass(GiraphConfiguration.MESSAGE_VALUE_CLASS,
+    conf.setClass(GiraphConstants.MESSAGE_VALUE_CLASS,
         (Class<?>) messageValueType,
         Writable.class);
   }
@@ -343,7 +343,7 @@ public class GraphMapper<I extends WritableComparable, V extends Writable,
 
     // Set up GiraphMetrics
     GiraphMetrics.init(conf);
-    GiraphMetrics.getInstance().addSuperstepResetObserver(this);
+    GiraphMetrics.get().addSuperstepResetObserver(this);
     initJobMetrics();
     MemoryUtils.initMetrics();
 
@@ -401,8 +401,8 @@ public class GraphMapper<I extends WritableComparable, V extends Writable,
 
     // Sometimes it takes a while to get multiple ZooKeeper servers up
     if (conf.getZooKeeperServerCount() > 1) {
-      Thread.sleep(GiraphConfiguration.DEFAULT_ZOOKEEPER_INIT_LIMIT *
-          GiraphConfiguration.DEFAULT_ZOOKEEPER_TICK_TIME);
+      Thread.sleep(GiraphConstants.DEFAULT_ZOOKEEPER_INIT_LIMIT *
+          GiraphConstants.DEFAULT_ZOOKEEPER_TICK_TIME);
     }
     int sessionMsecTimeout = conf.getZooKeeperSessionTimeout();
     try {
@@ -452,7 +452,7 @@ public class GraphMapper<I extends WritableComparable, V extends Writable,
    * Initialize job-level metrics used by this class.
    */
   private void initJobMetrics() {
-    GiraphMetricsRegistry jobMetrics = GiraphMetrics.getInstance().perJob();
+    GiraphMetricsRegistry jobMetrics = GiraphMetrics.get().perJob();
     wcPreAppTimer = new GiraphTimer(jobMetrics, "worker-context-pre-app",
         TimeUnit.MILLISECONDS);
     wcPostAppTimer = new GiraphTimer(jobMetrics, "worker-context-post-app",
@@ -520,7 +520,7 @@ public class GraphMapper<I extends WritableComparable, V extends Writable,
       return;
     }
 
-    GiraphMetrics.getInstance().
+    GiraphMetrics.get().
         resetSuperstepMetrics(BspService.INPUT_SUPERSTEP);
 
     if ((mapFunctions == MapFunctions.MASTER_ZOOKEEPER_ONLY) ||
@@ -561,7 +561,7 @@ public class GraphMapper<I extends WritableComparable, V extends Writable,
     FinishedSuperstepStats finishedSuperstepStats = null;
     do {
       final long superstep = serviceWorker.getSuperstep();
-      GiraphMetrics.getInstance().resetSuperstepMetrics(superstep);
+      GiraphMetrics.get().resetSuperstepMetrics(superstep);
 
       GiraphTimerContext superstepTimerContext = superstepTimer.time();
 
@@ -663,7 +663,7 @@ public class GraphMapper<I extends WritableComparable, V extends Writable,
 
       superstepTimerContext.stop();
       if (conf.metricsEnabled()) {
-        GiraphMetrics.getInstance().perSuperstep().printSummary();
+        GiraphMetrics.get().perSuperstep().printSummary();
       }
 
     } while (!finishedSuperstepStats.getAllVerticesHalted());

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/GraphStateAware.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/GraphStateAware.java b/giraph/src/main/java/org/apache/giraph/graph/GraphStateAware.java
new file mode 100644
index 0000000..76cef43
--- /dev/null
+++ b/giraph/src/main/java/org/apache/giraph/graph/GraphStateAware.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *     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 org.apache.giraph.graph;
+
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.io.WritableComparable;
+
+/**
+ * Interface specifying that the class can be configured with a GraphState.
+ *
+ * @param <I> Vertex ID object
+ * @param <V> Vertex Value object
+ * @param <E> Edge object
+ * @param <M> Message object
+ */
+public interface GraphStateAware<I extends WritableComparable,
+    V extends Writable, E extends Writable, M extends Writable> {
+  /**
+   * Set the graph state.
+   *
+   * @param graphState Graph state saved.
+   */
+  void setGraphState(GraphState<I, V, E, M> graphState);
+
+  /**
+   * Get the graph state stored.
+   *
+   * @return GraphState stored.
+   */
+  GraphState<I, V, E, M> getGraphState();
+}

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/InputSplitsCallable.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/InputSplitsCallable.java b/giraph/src/main/java/org/apache/giraph/graph/InputSplitsCallable.java
index 4e92b30..722b85e 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/InputSplitsCallable.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/InputSplitsCallable.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.comm.WorkerClientRequestProcessor;
 import org.apache.giraph.comm.netty.NettyWorkerClientRequestProcessor;
 import org.apache.giraph.utils.SystemTime;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/MasterAggregatorHandler.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/MasterAggregatorHandler.java b/giraph/src/main/java/org/apache/giraph/graph/MasterAggregatorHandler.java
index c45417a..ef1e2ff 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/MasterAggregatorHandler.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/MasterAggregatorHandler.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.bsp.SuperstepState;
 import org.apache.giraph.comm.MasterClient;
 import org.apache.giraph.comm.aggregators.AggregatorUtils;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/MasterCompute.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/MasterCompute.java b/giraph/src/main/java/org/apache/giraph/graph/MasterCompute.java
index 9de23ad..4641621 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/MasterCompute.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/MasterCompute.java
@@ -18,8 +18,8 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.mapreduce.Mapper;
 

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/MasterThread.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/MasterThread.java b/giraph/src/main/java/org/apache/giraph/graph/MasterThread.java
index 608dee3..dbded04 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/MasterThread.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/MasterThread.java
@@ -18,10 +18,10 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.GiraphConfiguration;
 import org.apache.giraph.bsp.ApplicationState;
 import org.apache.giraph.bsp.CentralizedServiceMaster;
 import org.apache.giraph.bsp.SuperstepState;
+import org.apache.giraph.conf.GiraphConstants;
 import org.apache.giraph.counters.GiraphTimers;
 import org.apache.giraph.metrics.GiraphMetrics;
 import org.apache.hadoop.io.Writable;
@@ -78,8 +78,8 @@ public class MasterThread<I extends WritableComparable, V extends Writable,
     this.context = context;
     GiraphTimers.init(context);
     superstepCounterOn = context.getConfiguration().getBoolean(
-        GiraphConfiguration.USE_SUPERSTEP_COUNTERS,
-        GiraphConfiguration.USE_SUPERSTEP_COUNTERS_DEFAULT);
+        GiraphConstants.USE_SUPERSTEP_COUNTERS,
+        GiraphConstants.USE_SUPERSTEP_COUNTERS_DEFAULT);
   }
 
   /**
@@ -111,7 +111,7 @@ public class MasterThread<I extends WritableComparable, V extends Writable,
           while (superstepState != SuperstepState.ALL_SUPERSTEPS_DONE) {
             long startSuperstepMillis = System.currentTimeMillis();
             cachedSuperstep = bspServiceMaster.getSuperstep();
-            GiraphMetrics.getInstance().resetSuperstepMetrics(cachedSuperstep);
+            GiraphMetrics.get().resetSuperstepMetrics(cachedSuperstep);
             superstepState = bspServiceMaster.coordinateSuperstep();
             long superstepMillis = System.currentTimeMillis() -
                 startSuperstepMillis;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/Vertex.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/Vertex.java b/giraph/src/main/java/org/apache/giraph/graph/Vertex.java
index 32ca495..0881d28 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/Vertex.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/Vertex.java
@@ -18,8 +18,8 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.graph.partition.PartitionOwner;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/VertexInputSplitsCallable.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/VertexInputSplitsCallable.java b/giraph/src/main/java/org/apache/giraph/graph/VertexInputSplitsCallable.java
index fc45951..e1e6235 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/VertexInputSplitsCallable.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/VertexInputSplitsCallable.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.graph.partition.PartitionOwner;
 import org.apache.giraph.metrics.GiraphMetrics;
 import org.apache.giraph.metrics.GiraphMetricsRegistry;
@@ -97,7 +97,7 @@ public class VertexInputSplitsCallable<I extends WritableComparable,
     this.bspServiceWorker = bspServiceWorker;
 
     // Initialize Metrics
-    GiraphMetricsRegistry jobMetrics = GiraphMetrics.getInstance().perJob();
+    GiraphMetricsRegistry jobMetrics = GiraphMetrics.get().perJob();
     verticesLoadedCounter = jobMetrics.getCounter(COUNTER_VERTICES_LOADED);
     edgesLoadedCounter = jobMetrics.getCounter(COUNTER_EDGES_LOADED);
   }

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/VertexInputSplitsCallableFactory.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/VertexInputSplitsCallableFactory.java b/giraph/src/main/java/org/apache/giraph/graph/VertexInputSplitsCallableFactory.java
index bde81b0..a55c4b0 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/VertexInputSplitsCallableFactory.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/VertexInputSplitsCallableFactory.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.zk.ZooKeeperExt;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/VertexMutations.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/VertexMutations.java b/giraph/src/main/java/org/apache/giraph/graph/VertexMutations.java
index 21c9ab0..4548cea 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/VertexMutations.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/VertexMutations.java
@@ -24,8 +24,8 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 import org.json.JSONException;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/VertexResolver.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/VertexResolver.java b/giraph/src/main/java/org/apache/giraph/graph/VertexResolver.java
index cb2e4f7..1616290 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/VertexResolver.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/VertexResolver.java
@@ -18,7 +18,6 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.GraphStateAware;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/VertexValueReader.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/VertexValueReader.java b/giraph/src/main/java/org/apache/giraph/graph/VertexValueReader.java
index 5edfaaa..569714d 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/VertexValueReader.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/VertexValueReader.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.mapreduce.InputSplit;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/WorkerAggregatorHandler.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/WorkerAggregatorHandler.java b/giraph/src/main/java/org/apache/giraph/graph/WorkerAggregatorHandler.java
index 135bd30..8e35998 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/WorkerAggregatorHandler.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/WorkerAggregatorHandler.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.bsp.CentralizedServiceWorker;
 import org.apache.giraph.comm.aggregators.WorkerAggregatorRequestProcessor;
 import org.apache.giraph.comm.aggregators.AggregatedValueOutputStream;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/BasicPartitionOwner.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/BasicPartitionOwner.java b/giraph/src/main/java/org/apache/giraph/graph/partition/BasicPartitionOwner.java
index c5ac621..e063ac7 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/BasicPartitionOwner.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/BasicPartitionOwner.java
@@ -22,8 +22,8 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.graph.WorkerInfo;
 
 /**

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/ByteArrayPartition.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/ByteArrayPartition.java b/giraph/src/main/java/org/apache/giraph/graph/partition/ByteArrayPartition.java
index 3b24996..5460a55 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/ByteArrayPartition.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/ByteArrayPartition.java
@@ -27,7 +27,7 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.ConcurrentMap;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.graph.Vertex;
 import org.apache.giraph.utils.UnsafeByteArrayInputStream;
 import org.apache.giraph.utils.WritableUtils;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/DiskBackedPartitionStore.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/DiskBackedPartitionStore.java b/giraph/src/main/java/org/apache/giraph/graph/partition/DiskBackedPartitionStore.java
index a8330ba..1e483d3 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/DiskBackedPartitionStore.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/DiskBackedPartitionStore.java
@@ -18,8 +18,8 @@
 
 package org.apache.giraph.graph.partition;
 
-import org.apache.giraph.GiraphConfiguration;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.GiraphConstants;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.graph.Vertex;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
@@ -89,11 +89,11 @@ public class DiskBackedPartitionStore<I extends WritableComparable,
     this.context = context;
     // We must be able to hold at least one partition in memory
     maxInMemoryPartitions = Math.max(1,
-        conf.getInt(GiraphConfiguration.MAX_PARTITIONS_IN_MEMORY,
-            GiraphConfiguration.MAX_PARTITIONS_IN_MEMORY_DEFAULT));
+        conf.getInt(GiraphConstants.MAX_PARTITIONS_IN_MEMORY,
+            GiraphConstants.MAX_PARTITIONS_IN_MEMORY_DEFAULT));
     basePath = conf.get("mapred.job.id", "Unknown Job") +
-        conf.get(GiraphConfiguration.PARTITIONS_DIRECTORY,
-            GiraphConfiguration.PARTITIONS_DIRECTORY_DEFAULT);
+        conf.get(GiraphConstants.PARTITIONS_DIRECTORY,
+            GiraphConstants.PARTITIONS_DIRECTORY_DEFAULT);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/GraphPartitionerFactory.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/GraphPartitionerFactory.java b/giraph/src/main/java/org/apache/giraph/graph/partition/GraphPartitionerFactory.java
index e6ae26d..a7ac84b 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/GraphPartitionerFactory.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/GraphPartitionerFactory.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph.partition;
 
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/HashMasterPartitioner.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/HashMasterPartitioner.java b/giraph/src/main/java/org/apache/giraph/graph/partition/HashMasterPartitioner.java
index 513c192..6724e50 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/HashMasterPartitioner.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/HashMasterPartitioner.java
@@ -23,7 +23,7 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.graph.WorkerInfo;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/HashPartitionerFactory.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/HashPartitionerFactory.java b/giraph/src/main/java/org/apache/giraph/graph/partition/HashPartitionerFactory.java
index d84a50e..69e7a5e 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/HashPartitionerFactory.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/HashPartitionerFactory.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph.partition;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/HashRangePartitionerFactory.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/HashRangePartitionerFactory.java b/giraph/src/main/java/org/apache/giraph/graph/partition/HashRangePartitionerFactory.java
index a577466..df6457b 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/HashRangePartitionerFactory.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/HashRangePartitionerFactory.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph.partition;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/Partition.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/Partition.java b/giraph/src/main/java/org/apache/giraph/graph/partition/Partition.java
index a2404e2..b0f156f 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/Partition.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/Partition.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph.partition;
 
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
 import org.apache.giraph.graph.Vertex;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/RangeSplitHint.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/RangeSplitHint.java b/giraph/src/main/java/org/apache/giraph/graph/partition/RangeSplitHint.java
index 4791fa6..e415b9b 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/RangeSplitHint.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/RangeSplitHint.java
@@ -22,8 +22,8 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/SimplePartition.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/SimplePartition.java b/giraph/src/main/java/org/apache/giraph/graph/partition/SimplePartition.java
index c2e17b5..0706660 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/SimplePartition.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/SimplePartition.java
@@ -18,19 +18,21 @@
 
 package org.apache.giraph.graph.partition;
 
+import org.apache.giraph.conf.GiraphConstants;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.graph.Vertex;
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.io.WritableComparable;
+import org.apache.hadoop.util.Progressable;
+
 import com.google.common.collect.Maps;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.util.Iterator;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ConcurrentSkipListMap;
-import org.apache.giraph.GiraphConfiguration;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
-import org.apache.giraph.graph.Vertex;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.util.Progressable;
 
 /**
  * A simple map-based container that stores vertices.  Vertex ids will map to
@@ -63,8 +65,8 @@ public class SimplePartition<I extends WritableComparable,
   public void initialize(int partitionId, Progressable progressable) {
     setId(partitionId);
     setProgressable(progressable);
-    if (conf.getBoolean(GiraphConfiguration.USE_OUT_OF_CORE_MESSAGES,
-        GiraphConfiguration.USE_OUT_OF_CORE_MESSAGES_DEFAULT)) {
+    if (conf.getBoolean(GiraphConstants.USE_OUT_OF_CORE_MESSAGES,
+        GiraphConstants.USE_OUT_OF_CORE_MESSAGES_DEFAULT)) {
       vertexMap = new ConcurrentSkipListMap<I, Vertex<I, V, E, M>>();
     } else {
       vertexMap = Maps.newConcurrentMap();
@@ -134,8 +136,8 @@ public class SimplePartition<I extends WritableComparable,
 
   @Override
   public void readFields(DataInput input) throws IOException {
-    if (conf.getBoolean(GiraphConfiguration.USE_OUT_OF_CORE_MESSAGES,
-        GiraphConfiguration.USE_OUT_OF_CORE_MESSAGES_DEFAULT)) {
+    if (conf.getBoolean(GiraphConstants.USE_OUT_OF_CORE_MESSAGES,
+        GiraphConstants.USE_OUT_OF_CORE_MESSAGES_DEFAULT)) {
       vertexMap = new ConcurrentSkipListMap<I, Vertex<I, V, E, M>>();
     } else {
       vertexMap = Maps.newConcurrentMap();

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/graph/partition/SimplePartitionStore.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/graph/partition/SimplePartitionStore.java b/giraph/src/main/java/org/apache/giraph/graph/partition/SimplePartitionStore.java
index 109802b..37f9cac 100644
--- a/giraph/src/main/java/org/apache/giraph/graph/partition/SimplePartitionStore.java
+++ b/giraph/src/main/java/org/apache/giraph/graph/partition/SimplePartitionStore.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.graph.partition;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.mapreduce.Mapper;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/integration/SuperstepHashPartitionerFactory.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/integration/SuperstepHashPartitionerFactory.java b/giraph/src/main/java/org/apache/giraph/integration/SuperstepHashPartitionerFactory.java
index 9e7d262..5a6c12d 100644
--- a/giraph/src/main/java/org/apache/giraph/integration/SuperstepHashPartitionerFactory.java
+++ b/giraph/src/main/java/org/apache/giraph/integration/SuperstepHashPartitionerFactory.java
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.graph.WorkerInfo;
 import org.apache.giraph.graph.partition.BasicPartitionOwner;
 import org.apache.giraph.graph.partition.HashMasterPartitioner;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/io/PseudoRandomVertexInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/io/PseudoRandomVertexInputFormat.java b/giraph/src/main/java/org/apache/giraph/io/PseudoRandomVertexInputFormat.java
index d601700..f382271 100644
--- a/giraph/src/main/java/org/apache/giraph/io/PseudoRandomVertexInputFormat.java
+++ b/giraph/src/main/java/org/apache/giraph/io/PseudoRandomVertexInputFormat.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.io;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.bsp.BspInputSplit;
 import org.apache.giraph.graph.Vertex;
 import org.apache.giraph.graph.VertexInputFormat;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/io/TextEdgeInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/io/TextEdgeInputFormat.java b/giraph/src/main/java/org/apache/giraph/io/TextEdgeInputFormat.java
index 30ca16b..e4cbf94 100644
--- a/giraph/src/main/java/org/apache/giraph/io/TextEdgeInputFormat.java
+++ b/giraph/src/main/java/org/apache/giraph/io/TextEdgeInputFormat.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.io;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.graph.Edge;
 import org.apache.giraph.graph.EdgeInputFormat;
 import org.apache.giraph.graph.EdgeReader;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/io/TextVertexInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/io/TextVertexInputFormat.java b/giraph/src/main/java/org/apache/giraph/io/TextVertexInputFormat.java
index 8e19d40..44cac3d 100644
--- a/giraph/src/main/java/org/apache/giraph/io/TextVertexInputFormat.java
+++ b/giraph/src/main/java/org/apache/giraph/io/TextVertexInputFormat.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.io;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.graph.Vertex;
 import org.apache.giraph.graph.VertexInputFormat;
 import org.apache.giraph.graph.VertexReader;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/master/DefaultMasterObserver.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/master/DefaultMasterObserver.java b/giraph/src/main/java/org/apache/giraph/master/DefaultMasterObserver.java
index e30e98d..4b4dee6 100644
--- a/giraph/src/main/java/org/apache/giraph/master/DefaultMasterObserver.java
+++ b/giraph/src/main/java/org/apache/giraph/master/DefaultMasterObserver.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.master;
 
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 
 /**
  * A no-op implementation of MasterObserver to make it easier for users.

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/master/MasterObserver.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/master/MasterObserver.java b/giraph/src/main/java/org/apache/giraph/master/MasterObserver.java
index 1c50904..b8f5a26 100644
--- a/giraph/src/main/java/org/apache/giraph/master/MasterObserver.java
+++ b/giraph/src/main/java/org/apache/giraph/master/MasterObserver.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.master;
 
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
 
 /**
  * Observer for Master.

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/metrics/GiraphMetrics.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/metrics/GiraphMetrics.java b/giraph/src/main/java/org/apache/giraph/metrics/GiraphMetrics.java
index 14e94d7..f30f199 100644
--- a/giraph/src/main/java/org/apache/giraph/metrics/GiraphMetrics.java
+++ b/giraph/src/main/java/org/apache/giraph/metrics/GiraphMetrics.java
@@ -17,7 +17,7 @@
  */
 package org.apache.giraph.metrics;
 
-import org.apache.giraph.GiraphConfiguration;
+import org.apache.giraph.conf.GiraphConfiguration;
 import org.apache.giraph.graph.BspService;
 
 import com.google.common.collect.Lists;
@@ -66,7 +66,7 @@ public class GiraphMetrics {
    *
    * @return GiraphMetrics singleton instance
    */
-  public static GiraphMetrics getInstance() {
+  public static GiraphMetrics get() {
     return INSTANCE;
   }
 

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/metrics/GiraphMetricsRegistry.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/metrics/GiraphMetricsRegistry.java b/giraph/src/main/java/org/apache/giraph/metrics/GiraphMetricsRegistry.java
index d54b793..184c97e 100644
--- a/giraph/src/main/java/org/apache/giraph/metrics/GiraphMetricsRegistry.java
+++ b/giraph/src/main/java/org/apache/giraph/metrics/GiraphMetricsRegistry.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.metrics;
 
-import org.apache.giraph.GiraphConfiguration;
+import org.apache.giraph.conf.GiraphConfiguration;
 
 import com.yammer.metrics.core.Counter;
 import com.yammer.metrics.core.Gauge;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/metrics/SuperstepMetricsRegistry.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/metrics/SuperstepMetricsRegistry.java b/giraph/src/main/java/org/apache/giraph/metrics/SuperstepMetricsRegistry.java
index 8179659..dd9eef7 100644
--- a/giraph/src/main/java/org/apache/giraph/metrics/SuperstepMetricsRegistry.java
+++ b/giraph/src/main/java/org/apache/giraph/metrics/SuperstepMetricsRegistry.java
@@ -18,7 +18,7 @@
 
 package org.apache.giraph.metrics;
 
-import org.apache.giraph.GiraphConfiguration;
+import org.apache.giraph.conf.GiraphConfiguration;
 import org.apache.giraph.graph.BspService;
 
 import java.io.PrintStream;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/metrics/WorkerSuperstepMetrics.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/metrics/WorkerSuperstepMetrics.java b/giraph/src/main/java/org/apache/giraph/metrics/WorkerSuperstepMetrics.java
index 0de2900..9db5107 100644
--- a/giraph/src/main/java/org/apache/giraph/metrics/WorkerSuperstepMetrics.java
+++ b/giraph/src/main/java/org/apache/giraph/metrics/WorkerSuperstepMetrics.java
@@ -69,7 +69,7 @@ public class WorkerSuperstepMetrics implements Writable {
    * @return this object, for chaining
    */
   public WorkerSuperstepMetrics readFromRegistry() {
-    SuperstepMetricsRegistry ssm = GiraphMetrics.getInstance().perSuperstep();
+    SuperstepMetricsRegistry ssm = GiraphMetrics.get().perSuperstep();
     readGiraphTimer(GraphMapper.TIMER_COMMUNICATION_TIME, commTimer);
     readGiraphTimer(GraphMapper.TIMER_COMPUTE_ALL, computeAllTimer);
     readGiraphTimer(GraphMapper.TIMER_TIME_TO_FIRST_MSG, timeToFirstMsg);
@@ -87,7 +87,7 @@ public class WorkerSuperstepMetrics implements Writable {
    * @param data LongAndTimeUnit to read data into.
    */
   private void readGiraphTimer(String name, LongAndTimeUnit data) {
-    Gauge<Long> gauge = GiraphMetrics.getInstance().perSuperstep().
+    Gauge<Long> gauge = GiraphMetrics.get().perSuperstep().
         getExistingGauge(name);
     if (gauge instanceof GiraphTimer) {
       GiraphTimer giraphTimer = (GiraphTimer) gauge;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/utils/ByteArrayIterable.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/utils/ByteArrayIterable.java b/giraph/src/main/java/org/apache/giraph/utils/ByteArrayIterable.java
index f7f0a52..cf2c187 100644
--- a/giraph/src/main/java/org/apache/giraph/utils/ByteArrayIterable.java
+++ b/giraph/src/main/java/org/apache/giraph/utils/ByteArrayIterable.java
@@ -18,7 +18,7 @@
 package org.apache.giraph.utils;
 
 import java.util.Iterator;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 
 /**

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/utils/ByteArrayIterator.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/utils/ByteArrayIterator.java b/giraph/src/main/java/org/apache/giraph/utils/ByteArrayIterator.java
index 0a9940c..76ed789 100644
--- a/giraph/src/main/java/org/apache/giraph/utils/ByteArrayIterator.java
+++ b/giraph/src/main/java/org/apache/giraph/utils/ByteArrayIterator.java
@@ -19,7 +19,7 @@ package org.apache.giraph.utils;
 
 import java.io.IOException;
 import java.util.Iterator;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 
 /**

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/utils/ByteArrayVertexIdMessages.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/utils/ByteArrayVertexIdMessages.java b/giraph/src/main/java/org/apache/giraph/utils/ByteArrayVertexIdMessages.java
index 3db8ea1..dea4229 100644
--- a/giraph/src/main/java/org/apache/giraph/utils/ByteArrayVertexIdMessages.java
+++ b/giraph/src/main/java/org/apache/giraph/utils/ByteArrayVertexIdMessages.java
@@ -20,8 +20,8 @@ package org.apache.giraph.utils;
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/utils/InternalVertexRunner.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/utils/InternalVertexRunner.java b/giraph/src/main/java/org/apache/giraph/utils/InternalVertexRunner.java
index 1433842..bccb827 100644
--- a/giraph/src/main/java/org/apache/giraph/utils/InternalVertexRunner.java
+++ b/giraph/src/main/java/org/apache/giraph/utils/InternalVertexRunner.java
@@ -18,18 +18,13 @@
 
 package org.apache.giraph.utils;
 
-import org.apache.giraph.GiraphConfiguration;
-import org.apache.giraph.graph.Combiner;
-import org.apache.giraph.graph.EdgeInputFormat;
+import org.apache.giraph.conf.GiraphClasses;
+import org.apache.giraph.conf.GiraphConfiguration;
+import org.apache.giraph.conf.GiraphConstants;
 import org.apache.giraph.graph.GiraphJob;
-import org.apache.giraph.graph.MasterCompute;
-import org.apache.giraph.graph.Vertex;
-import org.apache.giraph.graph.VertexInputFormat;
-import org.apache.giraph.graph.VertexOutputFormat;
-import org.apache.giraph.graph.WorkerContext;
 import org.apache.giraph.io.GiraphFileInputFormat;
-import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
 import org.apache.zookeeper.server.ServerConfig;
 import org.apache.zookeeper.server.ZooKeeperServerMain;
@@ -60,137 +55,55 @@ public class InternalVertexRunner {
   /** ZooKeeper port to use for tests */
   public static final int LOCAL_ZOOKEEPER_PORT = 22182;
 
-  /**
-   * Default constructor.
-   */
+  /** Don't construct */
   private InternalVertexRunner() { }
 
   /**
-   * Attempts to run the vertex internally in the current JVM, reading from
-   * and writing to a temporary folder on local disk. Will start
-   * its own ZooKeeper instance.
-   *
-   * @param vertexClass the vertex class to instantiate
-   * @param vertexInputFormatClass the inputformat to use
-   * @param vertexOutputFormatClass the outputformat to use
-   * @param params a map of parameters to add to the hadoop configuration
-   * @param data linewise input data
-   * @return linewise output data
-   * @throws Exception
-   */
-  @SuppressWarnings("rawtypes")
-  public static Iterable<String> run(
-      Class<? extends Vertex> vertexClass,
-      Class<? extends VertexInputFormat> vertexInputFormatClass,
-      Class<? extends VertexOutputFormat> vertexOutputFormatClass,
-      Map<String, String> params,
-      String[] data) throws Exception {
-    return run(vertexClass, null, vertexInputFormatClass,
-        vertexOutputFormatClass, params, data);
-  }
-
-  /**
-   *  Attempts to run the vertex internally in the current JVM, reading from
-   *  and writing to a temporary folder on local disk. Will start its own
-   *  zookeeper instance.
-   *
-   * @param vertexClass the vertex class to instantiate
-   * @param vertexCombinerClass the vertex combiner to use (or null)
-   * @param vertexInputFormatClass the inputformat to use
-   * @param vertexOutputFormatClass the outputformat to use
-   * @param params a map of parameters to add to the hadoop configuration
-   * @param data linewise input data
-   * @return linewise output data
-   * @throws Exception
-   */
-  @SuppressWarnings("rawtypes")
-  public static Iterable<String> run(
-      Class<? extends Vertex> vertexClass,
-      Class<? extends Combiner> vertexCombinerClass,
-      Class<? extends VertexInputFormat> vertexInputFormatClass,
-      Class<? extends VertexOutputFormat> vertexOutputFormatClass,
-      Map<String, String> params,
-      String[] data) throws Exception {
-    return InternalVertexRunner.run(vertexClass, vertexCombinerClass,
-        vertexInputFormatClass, vertexOutputFormatClass, null, null, params,
-        data);
-  }
-
-  /**
    * Attempts to run the vertex internally in the current JVM, reading from and
    * writing to a temporary folder on local disk. Will start its own zookeeper
    * instance.
-   * @param vertexClass the vertex class to instantiate
-   * @param vertexCombinerClass the vertex combiner to use (or null)
-   * @param vertexInputFormatClass the inputformat to use
-   * @param vertexOutputFormatClass the outputformat to use
-   * @param workerContextClass the worker context to use
-   * @param masterComputeClass the master compute class to use
+   *
+   * @param classes GiraphClasses specifying which types to use
    * @param params a map of parameters to add to the hadoop configuration
-   * @param data linewise input data
+   * @param vertexInputData linewise vertex input data
    * @return linewise output data
-   * @throws Exception
+   * @throws Exception if anything goes wrong
    */
-  @SuppressWarnings("rawtypes")
   public static Iterable<String> run(
-      Class<? extends Vertex> vertexClass,
-      Class<? extends Combiner> vertexCombinerClass,
-      Class<? extends VertexInputFormat> vertexInputFormatClass,
-      Class<? extends VertexOutputFormat> vertexOutputFormatClass,
-      Class<? extends WorkerContext> workerContextClass,
-      Class<? extends MasterCompute> masterComputeClass,
+      GiraphClasses classes,
       Map<String, String> params,
-      String[] data) throws Exception {
-    return run(vertexClass, vertexCombinerClass, vertexInputFormatClass, null,
-        vertexOutputFormatClass, workerContextClass, masterComputeClass,
-        params, data, null);
+      String[] vertexInputData) throws Exception {
+    return run(classes, params, vertexInputData, null);
   }
 
-  // CHECKSTYLE: stop ParameterNumberCheck
   /**
    * Attempts to run the vertex internally in the current JVM, reading from and
    * writing to a temporary folder on local disk. Will start its own zookeeper
    * instance.
-   * @param vertexClass the vertex class to instantiate
-   * @param vertexCombinerClass the vertex combiner to use (or null)
-   * @param vertexInputFormatClass the vertex inputformat to use
-   * @param edgeInputFormatClass the edge inputformat to use
-   * @param vertexOutputFormatClass the outputformat to use
-   * @param workerContextClass the worker context to use
-   * @param masterComputeClass the master compute class to use
+   *
+   * @param classes GiraphClasses specifying which types to use
    * @param params a map of parameters to add to the hadoop configuration
    * @param vertexInputData linewise vertex input data
    * @param edgeInputData linewise edge input data
    * @return linewise output data
-   * @throws Exception
+   * @throws Exception if anything goes wrong
    */
-  @SuppressWarnings("rawtypes")
-  public static Iterable<String> run(Class<? extends Vertex> vertexClass,
-      Class<? extends Combiner> vertexCombinerClass,
-      Class<? extends VertexInputFormat> vertexInputFormatClass,
-      Class<? extends EdgeInputFormat> edgeInputFormatClass,
-      Class<? extends VertexOutputFormat> vertexOutputFormatClass,
-      Class<? extends WorkerContext> workerContextClass,
-      Class<? extends MasterCompute> masterComputeClass,
+  public static Iterable<String> run(
+      GiraphClasses classes,
       Map<String, String> params,
       String[] vertexInputData,
       String[] edgeInputData) throws Exception {
-
-    boolean useVertexInputFormat = vertexInputFormatClass != null;
-    boolean useEdgeInputFormat = edgeInputFormatClass != null;
-    boolean outputData = vertexOutputFormatClass != null;
-
     File tmpDir = null;
     try {
       // Prepare input file, output folder and temporary folders
-      tmpDir = FileUtils.createTestDir(vertexClass);
+      tmpDir = FileUtils.createTestDir(classes.getVertexClass());
 
       File vertexInputFile = null;
       File edgeInputFile = null;
-      if (useVertexInputFormat) {
+      if (classes.hasVertexInputFormat()) {
         vertexInputFile = FileUtils.createTempFile(tmpDir, "vertices.txt");
       }
-      if (useEdgeInputFormat) {
+      if (classes.hasEdgeInputFormat()) {
         edgeInputFile = FileUtils.createTempFile(tmpDir, "edges.txt");
       }
 
@@ -200,61 +113,58 @@ public class InternalVertexRunner {
       File checkpointsDir = FileUtils.createTempDir(tmpDir, "_checkpoints");
 
       // Write input data to disk
-      if (useVertexInputFormat) {
+      if (classes.hasVertexInputFormat()) {
         FileUtils.writeLines(vertexInputFile, vertexInputData);
       }
-      if (useEdgeInputFormat) {
+      if (classes.hasEdgeInputFormat()) {
         FileUtils.writeLines(edgeInputFile, edgeInputData);
       }
 
       // Create and configure the job to run the vertex
-      GiraphJob job = new GiraphJob(vertexClass.getName());
-      job.getConfiguration().setVertexClass(vertexClass);
-      if (useVertexInputFormat) {
-        job.getConfiguration().setVertexInputFormatClass(
-            vertexInputFormatClass);
+      GiraphJob job = new GiraphJob(classes.getVertexClass().getName());
+      GiraphConfiguration conf = job.getConfiguration();
+      conf.setVertexClass(classes.getVertexClass());
+      if (classes.hasVertexInputFormat()) {
+        conf.setVertexInputFormatClass(classes.getVertexInputFormatClass());
       }
-      if (useEdgeInputFormat) {
-        job.getConfiguration().setEdgeInputFormatClass(edgeInputFormatClass);
+      if (classes.hasEdgeInputFormat()) {
+        conf.setEdgeInputFormatClass(classes.getEdgeInputFormatClass());
       }
-      if (outputData) {
-        job.getConfiguration().setVertexOutputFormatClass(
-            vertexOutputFormatClass);
+      if (classes.hasVertexOutputFormat()) {
+        conf.setVertexOutputFormatClass(classes.getVertexOutputFormatClass());
       }
-      if (workerContextClass != null) {
-        job.getConfiguration().setWorkerContextClass(workerContextClass);
+      if (classes.hasWorkerContextClass()) {
+        conf.setWorkerContextClass(classes.getWorkerContextClass());
       }
-      if (vertexCombinerClass != null) {
-        job.getConfiguration().setVertexCombinerClass(vertexCombinerClass);
+      if (classes.hasCombinerClass()) {
+        conf.setVertexCombinerClass(classes.getCombinerClass());
       }
-      if (masterComputeClass != null) {
-        job.getConfiguration().setMasterComputeClass(masterComputeClass);
+      if (classes.hasMasterComputeClass()) {
+        conf.setMasterComputeClass(classes.getMasterComputeClass());
       }
 
-      job.getConfiguration().setWorkerConfiguration(1, 1, 100.0f);
-      Configuration conf = job.getConfiguration();
-      conf.setBoolean(GiraphConfiguration.SPLIT_MASTER_WORKER, false);
-      conf.setBoolean(GiraphConfiguration.LOCAL_TEST_MODE, true);
-      conf.set(GiraphConfiguration.ZOOKEEPER_LIST, "localhost:" +
+      conf.setWorkerConfiguration(1, 1, 100.0f);
+      conf.setBoolean(GiraphConstants.SPLIT_MASTER_WORKER, false);
+      conf.setBoolean(GiraphConstants.LOCAL_TEST_MODE, true);
+      conf.set(GiraphConstants.ZOOKEEPER_LIST, "localhost:" +
           String.valueOf(LOCAL_ZOOKEEPER_PORT));
 
-      conf.set(GiraphConfiguration.ZOOKEEPER_DIR, zkDir.toString());
-      conf.set(GiraphConfiguration.ZOOKEEPER_MANAGER_DIRECTORY,
+      conf.set(GiraphConstants.ZOOKEEPER_DIR, zkDir.toString());
+      conf.set(GiraphConstants.ZOOKEEPER_MANAGER_DIRECTORY,
           zkMgrDir.toString());
-      conf.set(
-          GiraphConfiguration.CHECKPOINT_DIRECTORY,
-          checkpointsDir.toString());
+      conf.set(GiraphConstants.CHECKPOINT_DIRECTORY, checkpointsDir.toString());
 
       for (Map.Entry<String, String> param : params.entrySet()) {
         conf.set(param.getKey(), param.getValue());
       }
 
-      if (useVertexInputFormat) {
-        GiraphFileInputFormat.addVertexInputPath(job.getInternalJob(),
+      Job internalJob = job.getInternalJob();
+      if (classes.hasVertexInputFormat()) {
+        GiraphFileInputFormat.addVertexInputPath(internalJob,
             new Path(vertexInputFile.toString()));
       }
-      if (useEdgeInputFormat) {
-        GiraphFileInputFormat.addEdgeInputPath(job.getInternalJob(),
+      if (classes.hasEdgeInputFormat()) {
+        GiraphFileInputFormat.addEdgeInputPath(internalJob,
             new Path(edgeInputFile.toString()));
       }
       FileOutputFormat.setOutputPath(job.getInternalJob(),
@@ -289,7 +199,7 @@ public class InternalVertexRunner {
         zookeeper.end();
       }
 
-      if (outputData) {
+      if (classes.hasVertexOutputFormat()) {
         return Files.readLines(new File(outputDir, "part-m-00000"),
             Charsets.UTF_8);
       } else {
@@ -299,7 +209,6 @@ public class InternalVertexRunner {
       FileUtils.delete(tmpDir);
     }
   }
-  // CHECKSTYLE: resume ParameterNumberCheck
 
   /**
    * Configuration options for running local ZK.

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/utils/MemoryUtils.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/utils/MemoryUtils.java b/giraph/src/main/java/org/apache/giraph/utils/MemoryUtils.java
index 03f8929..eec8388 100644
--- a/giraph/src/main/java/org/apache/giraph/utils/MemoryUtils.java
+++ b/giraph/src/main/java/org/apache/giraph/utils/MemoryUtils.java
@@ -66,7 +66,7 @@ public class MemoryUtils {
    * Initialize metrics tracked by this helper.
    */
   public static void initMetrics() {
-    GiraphMetricsRegistry metrics = GiraphMetrics.getInstance().perJob();
+    GiraphMetricsRegistry metrics = GiraphMetrics.get().perJob();
     metrics.getGauge("memory-free-pct", new PercentGauge() {
         @Override
         protected double getNumerator() {

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/utils/ReflectionUtils.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/utils/ReflectionUtils.java b/giraph/src/main/java/org/apache/giraph/utils/ReflectionUtils.java
index 2f12d1f..d0a4a15 100644
--- a/giraph/src/main/java/org/apache/giraph/utils/ReflectionUtils.java
+++ b/giraph/src/main/java/org/apache/giraph/utils/ReflectionUtils.java
@@ -18,8 +18,8 @@
 
 package org.apache.giraph.utils;
 
-import org.apache.giraph.ImmutableClassesGiraphConfigurable;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 
 import java.lang.reflect.Array;
 import java.lang.reflect.Field;

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/utils/RepresentativeByteArrayIterable.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/utils/RepresentativeByteArrayIterable.java b/giraph/src/main/java/org/apache/giraph/utils/RepresentativeByteArrayIterable.java
index 375c765..e3992ed 100644
--- a/giraph/src/main/java/org/apache/giraph/utils/RepresentativeByteArrayIterable.java
+++ b/giraph/src/main/java/org/apache/giraph/utils/RepresentativeByteArrayIterable.java
@@ -18,7 +18,7 @@
 package org.apache.giraph.utils;
 
 import java.util.Iterator;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 
 /**

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/utils/RepresentativeByteArrayIterator.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/utils/RepresentativeByteArrayIterator.java b/giraph/src/main/java/org/apache/giraph/utils/RepresentativeByteArrayIterator.java
index 53047de..b6151c5 100644
--- a/giraph/src/main/java/org/apache/giraph/utils/RepresentativeByteArrayIterator.java
+++ b/giraph/src/main/java/org/apache/giraph/utils/RepresentativeByteArrayIterator.java
@@ -18,7 +18,7 @@
 package org.apache.giraph.utils;
 
 import java.io.IOException;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.io.Writable;
 
 /**

http://git-wip-us.apache.org/repos/asf/giraph/blob/599f70e3/giraph/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
----------------------------------------------------------------------
diff --git a/giraph/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java b/giraph/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
index c69b302..611a4bb 100644
--- a/giraph/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
+++ b/giraph/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
@@ -18,13 +18,9 @@
 
 package org.apache.giraph.zk;
 
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.io.Closeables;
-import java.util.LinkedList;
 import org.apache.commons.io.FileUtils;
-import org.apache.giraph.GiraphConfiguration;
-import org.apache.giraph.ImmutableClassesGiraphConfiguration;
+import org.apache.giraph.conf.GiraphConstants;
+import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -34,6 +30,10 @@ import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.server.quorum.QuorumPeerMain;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.io.Closeables;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileWriter;
@@ -48,10 +48,11 @@ import java.net.Socket;
 import java.net.SocketTimeoutException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
-import static org.apache.giraph.GiraphConfiguration.BASE_ZNODE_KEY;
+import static org.apache.giraph.conf.GiraphConstants.BASE_ZNODE_KEY;
 
 
 /**
@@ -141,7 +142,7 @@ public class ZooKeeperManager {
     taskPartition = conf.getTaskPartition();
     jobId = conf.get("mapred.job.id", "Unknown Job");
     baseDirectory =
-        new Path(conf.get(GiraphConfiguration.ZOOKEEPER_MANAGER_DIRECTORY,
+        new Path(conf.get(GiraphConstants.ZOOKEEPER_MANAGER_DIRECTORY,
             getFinalZooKeeperPath()));
     taskDirectory = new Path(baseDirectory,
         "_task");
@@ -151,24 +152,24 @@ public class ZooKeeperManager {
         Integer.toString(taskPartition) +
         COMPUTATION_DONE_SUFFIX);
     pollMsecs = conf.getInt(
-        GiraphConfiguration.ZOOKEEPER_SERVERLIST_POLL_MSECS,
-        GiraphConfiguration.ZOOKEEPER_SERVERLIST_POLL_MSECS_DEFAULT);
+        GiraphConstants.ZOOKEEPER_SERVERLIST_POLL_MSECS,
+        GiraphConstants.ZOOKEEPER_SERVERLIST_POLL_MSECS_DEFAULT);
     serverCount = conf.getInt(
-        GiraphConfiguration.ZOOKEEPER_SERVER_COUNT,
-        GiraphConfiguration.ZOOKEEPER_SERVER_COUNT_DEFAULT);
+        GiraphConstants.ZOOKEEPER_SERVER_COUNT,
+        GiraphConstants.ZOOKEEPER_SERVER_COUNT_DEFAULT);
     String jobLocalDir = conf.get("job.local.dir");
     if (jobLocalDir != null) { // for non-local jobs
       zkDirDefault = jobLocalDir +
           "/_bspZooKeeper";
     } else {
       zkDirDefault = System.getProperty("user.dir") + "/" +
-              GiraphConfiguration.ZOOKEEPER_MANAGER_DIR_DEFAULT;
+              GiraphConstants.ZOOKEEPER_MANAGER_DIR_DEFAULT;
     }
-    zkDir = conf.get(GiraphConfiguration.ZOOKEEPER_DIR, zkDirDefault);
+    zkDir = conf.get(GiraphConstants.ZOOKEEPER_DIR, zkDirDefault);
     configFilePath = zkDir + "/zoo.cfg";
     zkBasePort = conf.getInt(
-        GiraphConfiguration.ZOOKEEPER_SERVER_PORT,
-        GiraphConfiguration.ZOOKEEPER_SERVER_PORT_DEFAULT);
+        GiraphConstants.ZOOKEEPER_SERVER_PORT,
+        GiraphConstants.ZOOKEEPER_SERVER_PORT_DEFAULT);
 
 
     myHostname = InetAddress.getLocalHost().getCanonicalHostName();
@@ -181,7 +182,7 @@ public class ZooKeeperManager {
    * @return directory path with job id
    */
   private String getFinalZooKeeperPath() {
-    return GiraphConfiguration.ZOOKEEPER_MANAGER_DIR_DEFAULT + "/" + jobId;
+    return GiraphConstants.ZOOKEEPER_MANAGER_DIR_DEFAULT + "/" + jobId;
   }
 
   /**
@@ -306,7 +307,7 @@ public class ZooKeeperManager {
               "for base directory " + baseDirectory + ".  If there is an " +
               "issue with this directory, please set an accesible " +
               "base directory with the Hadoop configuration option " +
-              GiraphConfiguration.ZOOKEEPER_MANAGER_DIRECTORY);
+              GiraphConstants.ZOOKEEPER_MANAGER_DIRECTORY);
     }
 
     Path myCandidacyPath = new Path(
@@ -556,22 +557,22 @@ public class ZooKeeperManager {
       try {
         writer = new FileWriter(configFilePath);
         writer.write("tickTime=" +
-            GiraphConfiguration.DEFAULT_ZOOKEEPER_TICK_TIME + "\n");
+            GiraphConstants.DEFAULT_ZOOKEEPER_TICK_TIME + "\n");
         writer.write("dataDir=" + this.zkDir + "\n");
         writer.write("clientPort=" + zkBasePort + "\n");
         writer.write("maxClientCnxns=" +
-            GiraphConfiguration.DEFAULT_ZOOKEEPER_MAX_CLIENT_CNXNS +
+            GiraphConstants.DEFAULT_ZOOKEEPER_MAX_CLIENT_CNXNS +
             "\n");
         writer.write("minSessionTimeout=" +
             conf.getZooKeeperMinSessionTimeout() + "\n");
         writer.write("maxSessionTimeout=" +
             conf.getZooKeeperMaxSessionTimeout() + "\n");
         writer.write("initLimit=" +
-            GiraphConfiguration.DEFAULT_ZOOKEEPER_INIT_LIMIT + "\n");
+            GiraphConstants.DEFAULT_ZOOKEEPER_INIT_LIMIT + "\n");
         writer.write("syncLimit=" +
-            GiraphConfiguration.DEFAULT_ZOOKEEPER_SYNC_LIMIT + "\n");
+            GiraphConstants.DEFAULT_ZOOKEEPER_SYNC_LIMIT + "\n");
         writer.write("snapCount=" +
-            GiraphConfiguration.DEFAULT_ZOOKEEPER_SNAP_COUNT + "\n");
+            GiraphConstants.DEFAULT_ZOOKEEPER_SNAP_COUNT + "\n");
         writer.write("forceSync=" + conf.getZooKeeperForceSync() + "\n");
         writer.write("skipACL=" + conf.getZooKeeperSkipAcl() + "\n");
         if (serverList.size() != 1) {
@@ -629,14 +630,14 @@ public class ZooKeeperManager {
       }
       commandList.add(javaHome + "/bin/java");
       String zkJavaOptsString =
-          conf.get(GiraphConfiguration.ZOOKEEPER_JAVA_OPTS,
-              GiraphConfiguration.ZOOKEEPER_JAVA_OPTS_DEFAULT);
+          conf.get(GiraphConstants.ZOOKEEPER_JAVA_OPTS,
+              GiraphConstants.ZOOKEEPER_JAVA_OPTS_DEFAULT);
       String[] zkJavaOptsArray = zkJavaOptsString.split(" ");
       if (zkJavaOptsArray != null) {
         commandList.addAll(Arrays.asList(zkJavaOptsArray));
       }
       commandList.add("-cp");
-      Path fullJarPath = new Path(conf.get(GiraphConfiguration.ZOOKEEPER_JAR));
+      Path fullJarPath = new Path(conf.get(GiraphConstants.ZOOKEEPER_JAR));
       commandList.add(fullJarPath.toString());
       commandList.add(QuorumPeerMain.class.getName());
       commandList.add(configFilePath);


Mime
View raw message