Package eu.stratosphere.types

Examples of eu.stratosphere.types.Value


    int readPos;

    for (int i = 0; i < this.numFields; i++) {
      readPos = this.recordPositions[i];
      if (readPos < numRecFields) {
        Value v = record.getField(this.recordPositions[i], this.classes[i]);
        if (v != null) {
          if (i != 0) {
            this.wrt.write(this.fieldDelimiter);
          }
          this.wrt.write(v.toString());
        } else {
          if (this.lenient) {
            if (i != 0) {
              this.wrt.write(this.fieldDelimiter);
            }
View Full Code Here


    if (aggregates == null) {
      // we have read the binary data, but not yet turned into the objects
      final int num = aggNames.length;
      aggregates = new Value[num];
      for (int i = 0; i < num; i++) {
        Value v;
        try {
          Class<? extends Value> valClass = Class.forName(classNames[i], true, classResolver).asSubclass(Value.class);
          v = InstantiationUtil.instantiate(valClass, Value.class);
        }
        catch (ClassNotFoundException e) {
          throw new RuntimeException("Could not load user-defined class '" + classNames[i] + "'.", e);
        }
        catch (ClassCastException e) {
          throw new RuntimeException("User-defined aggregator class is not a value sublass.");
        }
       
        DataInputStream in = new DataInputStream(new ByteArrayInputStream(serializedData[i]));
        try {
          v.read(in);
          in.close();
        } catch (IOException e) {
          throw new RuntimeException("Error while deserializing the user-defined aggregate class.", e);
        }
       
View Full Code Here

      Aggregator<Value> aggregator = (Aggregator<Value>) aggregators.get(convergenceAggregatorName);
      if (aggregator == null) {
        throw new RuntimeException("Error: Aggregator for convergence criterion was null.");
      }
     
      Value aggregate = aggregator.getAggregate();

      if (convergenceCriterion.isConverged(currentIteration, aggregate)) {
        if (log.isInfoEnabled()) {
          log.info(formatLogString("convergence reached after [" + currentIteration
            + "] iterations, terminating..."));
View Full Code Here

      throw new IllegalArgumentException("Empty PactRecord given");
    }
    reuseAvroRecord = dataFileReader.next(reuseAvroRecord);
    final List<Field> fields = reuseAvroRecord.getSchema().getFields();
    for (Field field : fields) {
      final Value value = convertAvroToPactValue(field, reuseAvroRecord.get(field.pos()));
      record.setField(field.pos(), value);
      record.updateBinaryRepresenation();
    }

    return record;
View Full Code Here

 
  @Override
  public void writeRecord(Record record) throws IOException {
    try {
      for (int x = 0; x < record.getNumFields(); x++) {
        Value temp = record.getField(x, fieldClasses[x]);
        addValue(x + 1, temp);
      }
      upload.addBatch();
      batchCount++;
      if(batchCount >= batchInterval) {
View Full Code Here

  public VarLengthStringParser parser = new VarLengthStringParser();
 
  @Test
  public void testGetValue() {
    Value v = parser.createValue();
    assertTrue(v instanceof StringValue);
  }
View Full Code Here

TOP

Related Classes of eu.stratosphere.types.Value

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.