Package cgl.imr.types

Examples of cgl.imr.types.BytesValue


        System.err.println("Reduce Input Error!");
        throw new TwisterException("Reduce input error no values.");
      }

      for (Value value : values) {
        BytesValue val = (BytesValue) value;
        Node node = new Node(val.getBytes());
       
        ID = node.getID();

        // save only the minimum distance for each edge
        for (int v : node.getEdges().keySet()) {
          if (node.getEdgeWeight(v) < edgeWeights.get(v))
            edgeWeights.put(v, node.getEdgeWeight(v));
        }
      }

      // create the new node with non-redundant edges and edge with minimum
      // distance and emit it
      Node n = new Node(ID);
      for (int i = 1; i <= 1000; i++) {
        if (edgeWeights.get(i) != Integer.MAX_VALUE)
          n.setEdgeWeight(i, edgeWeights.get(i));
      }

      collector.collect(new StringKey("" + n.getID()), new BytesValue(n
          .getBytes()));
    } catch (SerializationException e) {
      e.printStackTrace();
      throw new TwisterException(e);
    }
View Full Code Here


                  + thisNode.getEdgeWeight(v1);
              adjacentNode.setEdgeWeight(v1, sumOfEdgeWeights);
            }
          }
          collector.collect(new StringKey("" + adjacentNode.getID()),
              new BytesValue(adjacentNode.getBytes()));
          setNodeToNullForGarbageCollection(adjacentNode);
        }
        collector.collect(new StringKey("" + thisNode.getID()),
            new BytesValue(thisNode.getBytes()));
      }
    } catch (SerializationException e) {
      throw new TwisterException(e);
    }
  }
View Full Code Here

      for (int y : x.getNodes().keySet())
        System.out.print(y + "| ");
      count++;
    }
    StringKey key = null;
    BytesValue value = null;

    int keyNo = 0;
    for (Graph g : subgraphs) {
      key = new StringKey("" + keyNo);
      try {
        value = new BytesValue(g.getBytes());
      } catch (SerializationException e) {
        e.printStackTrace();
      }
      keyValues.add(new KeyValuePair(key, value));
      keyNo++;
View Full Code Here

TOP

Related Classes of cgl.imr.types.BytesValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.