Package eu.stratosphere.types

Examples of eu.stratosphere.types.DoubleValue


   
    private final DoubleValue newRank = new DoubleValue();
   
    @Override
    public void join(Record vertexWithDelta, Record vertexWithOldRank, Collector<Record> out) throws Exception {     
      DoubleValue deltaVal = vertexWithDelta.getField(1, DoubleValue.class);
      DoubleValue currentVal = vertexWithOldRank.getField(1, DoubleValue.class);
     
      newRank.setValue(deltaVal.getValue() + currentVal.getValue());
      vertexWithOldRank.setField(1, newRank);
     
      out.collect(vertexWithOldRank);
    }
View Full Code Here


    }
    if(hadoopType instanceof org.apache.hadoop.io.FloatWritable) {
      return new FloatValue(((FloatWritable)hadoopType).get());
    }
    if(hadoopType instanceof org.apache.hadoop.io.DoubleWritable) {
      return new DoubleValue(((DoubleWritable)hadoopType).get());
    }
    if(hadoopType instanceof org.apache.hadoop.io.BooleanWritable) {
      return new BooleanValue(((BooleanWritable)hadoopType).get());
    }
    if(hadoopType instanceof org.apache.hadoop.io.ByteWritable) {
View Full Code Here

  private static final long DANGLING_MARKER = 1l;

  @Override
  public void configure(Configuration parameters) {
    long numVertices = ConfigUtils.asLong(NUM_VERTICES_PARAMETER, parameters);
    initialRank = new DoubleValue(1 / (double) numVertices);
    super.configure(parameters);
  }
View Full Code Here

    }
  }
 
  @Override
  public DoubleValue createValue() {
    return new DoubleValue();
  }
View Full Code Here

    Assert.assertEquals(3, dd.getNumberOfFields());
   
    // check inconsistent key types
    try {
      new SimpleDistribution(
          new Key[][] {{new IntValue(1), new StringValue("A"), new DoubleValue(1.3d)},
                {new IntValue(2), new StringValue("B"), new IntValue(1)}});
      Assert.fail("Data distribution accepts incorrect key types");
    } catch(IllegalArgumentException iae) {
      // do nothing
    }
View Full Code Here

    return false;
  }
 
  @Override
  public DoubleValue createInstance() {
    return new DoubleValue();
  }
View Full Code Here

  }

  @Override
  public DoubleValue[] getBucketBoundary(int bucketNum, int totalNumBuckets) {
    double bucketSize = (max - min) / totalNumBuckets;
    return new DoubleValue[] {new DoubleValue(min + (bucketNum+1) * bucketSize) };
  }
View Full Code Here

  }
 
  @Override
  public DoubleValue[] getValidTestResults() {
    return new DoubleValue[] {
      new DoubleValue(0d), new DoubleValue(0.0d), new DoubleValue(123.4d), new DoubleValue(0.124d),
      new DoubleValue(.623d), new DoubleValue(1234d), new DoubleValue(-12.34d),
      new DoubleValue(Double.MAX_VALUE), new DoubleValue(Double.MIN_VALUE),
      new DoubleValue(Double.NEGATIVE_INFINITY), new DoubleValue(Double.POSITIVE_INFINITY),
      new DoubleValue(Double.NaN),
      new DoubleValue(1.234E2), new DoubleValue(1.234e3), new DoubleValue(1.234E-2)
    };
  }
View Full Code Here

TOP

Related Classes of eu.stratosphere.types.DoubleValue

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.