hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tjungb...@apache.org
Subject svn commit: r1449874 - in /hama/trunk: ./ graph/src/main/java/org/apache/hama/graph/
Date Mon, 25 Feb 2013 20:15:59 GMT
Author: tjungblut
Date: Mon Feb 25 20:15:58 2013
New Revision: 1449874

URL: http://svn.apache.org/r1449874
Log:
 HAMA-739: WritableComparable doesn't work with IntWritable (tjungblut)

Modified:
    hama/trunk/CHANGES.txt
    hama/trunk/graph/src/main/java/org/apache/hama/graph/AggregationRunner.java
    hama/trunk/graph/src/main/java/org/apache/hama/graph/DiskVerticesInfo.java
    hama/trunk/graph/src/main/java/org/apache/hama/graph/Edge.java
    hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
    hama/trunk/graph/src/main/java/org/apache/hama/graph/IDSkippingIterator.java
    hama/trunk/graph/src/main/java/org/apache/hama/graph/Vertex.java
    hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInputReader.java
    hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInterface.java
    hama/trunk/graph/src/main/java/org/apache/hama/graph/VerticesInfo.java

Modified: hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hama/trunk/CHANGES.txt?rev=1449874&r1=1449873&r2=1449874&view=diff
==============================================================================
--- hama/trunk/CHANGES.txt (original)
+++ hama/trunk/CHANGES.txt Mon Feb 25 20:15:58 2013
@@ -13,7 +13,8 @@ Release 0.7 (unreleased changes)
    HAMA-658: Add random symmetric sparse matrix generator (edwardyoon)
 
   BUG FIXES
- 
+
+   HAMA-739: WritableComparable doesn't work with IntWritable (tjungblut) 
    HAMA-716: Splits should be assigned based on PartitionID (edwardyoon)
    HAMA-712: PartitioningRunner should works for multiple input files (surajsmenon via edwardyoon)
 

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/AggregationRunner.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/AggregationRunner.java?rev=1449874&r1=1449873&r2=1449874&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/AggregationRunner.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/AggregationRunner.java Mon Feb 25
20:15:58 2013
@@ -36,7 +36,8 @@ import com.google.common.base.Preconditi
  * configured.
  * 
  */
-public final class AggregationRunner<V extends WritableComparable<? super V>, E
extends Writable, M extends Writable> {
+@SuppressWarnings("rawtypes")
+public final class AggregationRunner<V extends WritableComparable, E extends Writable,
M extends Writable> {
 
   // multiple aggregator arrays
   private Aggregator<M, Vertex<V, E, M>>[] aggregators;

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/DiskVerticesInfo.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/DiskVerticesInfo.java?rev=1449874&r1=1449873&r2=1449874&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/DiskVerticesInfo.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/DiskVerticesInfo.java Mon Feb 25
20:15:58 2013
@@ -35,7 +35,8 @@ import org.apache.hadoop.io.WritableComp
 import org.apache.hama.bsp.TaskAttemptID;
 import org.apache.hama.graph.IDSkippingIterator.Strategy;
 
-public final class DiskVerticesInfo<V extends WritableComparable<? super V>, E extends
Writable, M extends Writable>
+@SuppressWarnings("rawtypes")
+public final class DiskVerticesInfo<V extends WritableComparable, E extends Writable,
M extends Writable>
     implements VerticesInfo<V, E, M> {
 
   public static final String DISK_VERTICES_PATH_KEY = "hama.disk.vertices.path";

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/Edge.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/Edge.java?rev=1449874&r1=1449873&r2=1449874&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/Edge.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/Edge.java Mon Feb 25 20:15:58 2013
@@ -24,7 +24,8 @@ import org.apache.hadoop.io.WritableComp
 /**
  * The edge class
  */
-public final class Edge<VERTEX_ID extends WritableComparable<? super VERTEX_ID>,
EDGE_VALUE_TYPE extends Writable> {
+@SuppressWarnings("rawtypes")
+public final class Edge<VERTEX_ID extends WritableComparable, EDGE_VALUE_TYPE extends
Writable> {
 
   private VERTEX_ID destinationVertexID;
   private EDGE_VALUE_TYPE cost;

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java?rev=1449874&r1=1449873&r2=1449874&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java Mon Feb 25 20:15:58
2013
@@ -46,7 +46,8 @@ import org.apache.hama.util.ReflectionUt
  * @param <E> the value type of an edge.
  * @param <M> the value type of a vertex.
  */
-public final class GraphJobRunner<V extends WritableComparable<? super V>, E extends
Writable, M extends Writable>
+@SuppressWarnings("rawtypes")
+public final class GraphJobRunner<V extends WritableComparable, E extends Writable, M
extends Writable>
     extends BSP<Writable, Writable, Writable, Writable, GraphJobMessage> {
 
   public static enum GraphJobCounter {
@@ -69,7 +70,7 @@ public final class GraphJobRunner<V exte
   private Partitioner<V, M> partitioner;
 
   public static Class<?> VERTEX_CLASS;
-  public static Class<? extends WritableComparable<?>> VERTEX_ID_CLASS;
+  public static Class<? extends WritableComparable> VERTEX_ID_CLASS;
   public static Class<? extends Writable> VERTEX_VALUE_CLASS;
   public static Class<? extends Writable> EDGE_VALUE_CLASS;
   public static Class<Vertex<?, ?, ?>> vertexClass;
@@ -272,6 +273,7 @@ public final class GraphJobRunner<V exte
   private VertexMessageIterable<V, M> iterate(GraphJobMessage currentMessage,
       V firstMessageId, Vertex<V, E, M> vertex,
       BSPPeer<Writable, Writable, Writable, Writable, GraphJobMessage> peer) {
+    @SuppressWarnings("unchecked")
     int comparision = firstMessageId.compareTo(vertex.getVertexID());
     if (comparision < 0) {
       throw new IllegalArgumentException(
@@ -540,7 +542,7 @@ public final class GraphJobRunner<V exte
    * @return a new vertex instance
    */
   @SuppressWarnings({ "unchecked" })
-  public static <V extends WritableComparable<? super V>, E extends Writable, M
extends Writable> Vertex<V, E, M> newVertexInstance(
+  public static <V extends WritableComparable, E extends Writable, M extends Writable>
Vertex<V, E, M> newVertexInstance(
       Class<?> vertexClass) {
     return (Vertex<V, E, M>) ReflectionUtils.newInstance(vertexClass);
   }

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/IDSkippingIterator.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/IDSkippingIterator.java?rev=1449874&r1=1449873&r2=1449874&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/IDSkippingIterator.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/IDSkippingIterator.java Mon Feb 25
20:15:58 2013
@@ -23,13 +23,14 @@ import org.apache.hadoop.io.WritableComp
 /**
  * Iterator that allows skipping of items on disk based on some given stategy.
  */
-public abstract class IDSkippingIterator<V extends WritableComparable<? super V>,
E extends Writable, M extends Writable> {
+@SuppressWarnings("rawtypes")
+public abstract class IDSkippingIterator<V extends WritableComparable, E extends Writable,
M extends Writable> {
 
   enum Strategy {
     ALL, ACTIVE, ACTIVE_AND_MESSAGES, INACTIVE;
 
     // WritableComparable is really sucking in this type constellation
-    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @SuppressWarnings("unchecked")
     public boolean accept(Vertex v, WritableComparable msgId) {
       switch (this) {
         case ACTIVE_AND_MESSAGES:

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/Vertex.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/Vertex.java?rev=1449874&r1=1449873&r2=1449874&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/Vertex.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/Vertex.java Mon Feb 25 20:15:58 2013
@@ -46,7 +46,8 @@ import org.apache.hama.bsp.Partitioner;
  * @param <E> Edge cost object type
  * @param <M> Vertex value object type
  */
-public abstract class Vertex<V extends WritableComparable<? super V>, E extends
Writable, M extends Writable>
+@SuppressWarnings("rawtypes")
+public abstract class Vertex<V extends WritableComparable, E extends Writable, M extends
Writable>
     implements VertexInterface<V, E, M> {
 
   GraphJobRunner<?, ?, ?> runner;
@@ -315,6 +316,7 @@ public abstract class Vertex<V extends W
   }
 
   // compare across the vertex ID
+  @SuppressWarnings("unchecked")
   @Override
   public final int compareTo(VertexInterface<V, E, M> o) {
     return getVertexID().compareTo(o.getVertexID());

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInputReader.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInputReader.java?rev=1449874&r1=1449873&r2=1449874&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInputReader.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInputReader.java Mon Feb 25
20:15:58 2013
@@ -41,11 +41,13 @@ import org.apache.hama.util.KeyValuePair
  * @param <E> the Edge cost object type.
  * @param <M> the Vertex value/message object type.
  */
-public abstract class VertexInputReader<KEYIN extends Writable, VALUEIN extends Writable,
V extends WritableComparable<? super V>, E extends Writable, M extends Writable>
+@SuppressWarnings("rawtypes")
+public abstract class VertexInputReader<KEYIN extends Writable, VALUEIN extends Writable,
V extends WritableComparable, E extends Writable, M extends Writable>
     implements RecordConverter {
 
   private static final Log LOG = LogFactory.getLog(VertexInputReader.class);
 
+  @SuppressWarnings("unchecked")
   @Override
   public void setup(Configuration conf) {
     // initialize the usual vertex structures for read/write methods
@@ -89,9 +91,7 @@ public abstract class VertexInputReader<
   @SuppressWarnings("unchecked")
   @Override
   public int getPartitionId(KeyValuePair<Writable, Writable> inputRecord,
-      @SuppressWarnings("rawtypes") Partitioner partitioner,
-      Configuration conf, @SuppressWarnings("rawtypes") BSPPeer peer,
-      int numTasks) {
+      Partitioner partitioner, Configuration conf, BSPPeer peer, int numTasks) {
     Vertex<V, E, M> vertex = (Vertex<V, E, M>) outputRecord.getKey();
     return Math.abs(partitioner.getPartition(vertex.getVertexID(),
         vertex.getValue(), numTasks));

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInterface.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInterface.java?rev=1449874&r1=1449873&r2=1449874&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInterface.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/VertexInterface.java Mon Feb 25 20:15:58
2013
@@ -33,7 +33,8 @@ import org.apache.hadoop.io.WritableComp
  *          edge.
  * @param <M> the type used for messaging, usually the value of a vertex.
  */
-public interface VertexInterface<V extends WritableComparable<? super V>, E extends
Writable, M extends Writable>
+@SuppressWarnings("rawtypes")
+public interface VertexInterface<V extends WritableComparable, E extends Writable, M extends
Writable>
     extends WritableComparable<VertexInterface<V, E, M>> {
 
   /**

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/VerticesInfo.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/VerticesInfo.java?rev=1449874&r1=1449873&r2=1449874&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/VerticesInfo.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/VerticesInfo.java Mon Feb 25 20:15:58
2013
@@ -31,7 +31,8 @@ import org.apache.hama.bsp.TaskAttemptID
  * @param <E> Edge cost object type
  * @param <M> Vertex value object type
  */
-public interface VerticesInfo<V extends WritableComparable<? super V>, E extends
Writable, M extends Writable> {
+@SuppressWarnings("rawtypes")
+public interface VerticesInfo<V extends WritableComparable, E extends Writable, M extends
Writable> {
 
   /**
    * Initialization of internal structures.



Mime
View raw message