Package eu.stratosphere.types

Examples of eu.stratosphere.types.DoubleValue


    for (int i = 0; i < numRecords; i++) {
      Record rec = new Record(4);
      rec.setField(0, new IntValue(i));
      rec.setField(1, new StringValue("AB"+i+"CD"+i));
      rec.setField(3, new DoubleValue(i*3.141d));
      delegate.setInstance(rec);
     
      int[] chans = oe1.selectChannels(delegate, hit.length);
      for(int j=0; j < chans.length; j++) {
        hit[chans[j]]++;
View Full Code Here


    for (int i = 0; i < numRecords; i++) {
      Record rec = new Record(4);
      rec.setField(0, new IntValue(i));
      rec.setField(1, new StringValue("AB"+i+"CD"+i));
      rec.setField(3, new DoubleValue(i*3.141d));
     
      int[] chans = oe1.selectChannels(rec, hit.length);
      for(int j=0; j < chans.length; j++) {
        hit[chans[j]]++;
      }
View Full Code Here

  @Override
  public void open(Configuration parameters) {
    record = new Record();
    vertexID = new LongValue();
    partialRank = new DoubleValue();

    workerIndex = getRuntimeContext().getIndexOfThisSubtask();
    currentIteration = getIterationRuntimeContext().getSuperstepNumber();
    failingIteration = ConfigUtils.asInteger("compensation.failingIteration", parameters);
    failingWorkers = ConfigUtils.asIntSet("compensation.failingWorker", parameters);
View Full Code Here

  private static final Pattern SEPARATOR = Pattern.compile("[, \t]");

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

  private static final long DANGLING_MARKER = 1l;

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

      }
      return bl;
    case DOUBLE:
      DoubleListValue dl = new DoubleListValue();
      for (Object item : avroList) {
        dl.add(new DoubleValue((Double) item));
      }
      return dl;
    case FLOAT:
      FloatListValue fl = new FloatListValue();
      for (Object item : avroList) {
View Full Code Here

      }
      return bm;
    case DOUBLE:
      DoubleMapValue dm = new DoubleMapValue();
      for (Map.Entry<CharSequence, ?> entry : avroMap.entrySet()) {
        dm.put(new StringValue((CharSequence) entry.getKey()), new DoubleValue((Double) entry.getValue()));
      }
      return dm;
    case FLOAT:
      FloatMapValue fm = new FloatMapValue();
      for (Map.Entry<CharSequence, ?> entry : avroMap.entrySet()) {
View Full Code Here

      break;
    case java.sql.Types.INTEGER:
      record.setField(pos, new IntValue(resultSet.getInt(pos + 1)));
      break;
    case java.sql.Types.FLOAT:
      record.setField(pos, new DoubleValue(resultSet.getDouble(pos + 1)));
      break;
    case java.sql.Types.REAL:
      record.setField(pos, new FloatValue(resultSet.getFloat(pos + 1)));
      break;
    case java.sql.Types.DOUBLE:
      record.setField(pos, new DoubleValue(resultSet.getDouble(pos + 1)));
      break;
    case java.sql.Types.DECIMAL:
      record.setField(pos, new DoubleValue(resultSet.getBigDecimal(pos + 1).doubleValue()));
      break;
    case java.sql.Types.NUMERIC:
      record.setField(pos, new DoubleValue(resultSet.getBigDecimal(pos + 1).doubleValue()));
      break;
    case java.sql.Types.DATE:
      record.setField(pos, new StringValue(resultSet.getDate(pos + 1).toString()));
      break;
    case java.sql.Types.TIME:
View Full Code Here

      Assert.assertEquals("Field 2 should be String", StringValue.class, record.getField(2, StringValue.class).getClass());
      Assert.assertEquals("Field 3 should be float", DoubleValue.class, record.getField(3, DoubleValue.class).getClass());
      Assert.assertEquals("Field 4 should be int", IntValue.class, record.getField(4, IntValue.class).getClass());

      int[] pos = {0, 1, 2, 3, 4};
      Value[] values = {new IntValue(), new StringValue(), new StringValue(), new DoubleValue(), new IntValue()};
      Assert.assertTrue(record.equalsFields(pos, dbData[recordCount], values));

      recordCount++;
    }
    Assert.assertEquals(5, recordCount);
View Full Code Here

      Assert.assertEquals("Field 2 should be String", StringValue.class, record.getField(2, StringValue.class).getClass());
      Assert.assertEquals("Field 3 should be float", DoubleValue.class, record.getField(3, DoubleValue.class).getClass());
      Assert.assertEquals("Field 4 should be int", IntValue.class, record.getField(4, IntValue.class).getClass());

      int[] pos = {0, 1, 2, 3, 4};
      Value[] values = {new IntValue(), new StringValue(), new StringValue(), new DoubleValue(), new IntValue()};
      Assert.assertTrue(record.equalsFields(pos, dbData[recordCount], values));

      recordCount++;
    }
    Assert.assertEquals(5, recordCount);
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.