Package eu.stratosphere.types

Examples of eu.stratosphere.types.IntValue


     
     
      if (Integer.parseInt(keyString.toString()) + Integer.parseInt(valueString.toString()) < 10) {

        record.setField(0, valueString);
        record.setField(1, new IntValue(Integer.parseInt(keyString.toString()) + 10));
       
        out.collect(record);
      }
    }
View Full Code Here


      valueString = value1.getField(1, valueString);
      int val1 = Integer.parseInt(valueString.getValue())+2;
      valueString = value2.getField(1, valueString);
      int val2 = Integer.parseInt(valueString.getValue())+1;
     
      value1.setField(1, new IntValue(val1 - val2));
     
      out.collect(value1);
     
      if (LOG.isDebugEnabled())
        LOG.debug("Processed: [" + keyString.toString() + "," + val1 + "] + " +
View Full Code Here

      break;
    case java.sql.Types.BIGINT:
      record.setField(pos, new LongValue(resultSet.getLong(pos + 1)));
      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:
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

      StringTokenizer tokenizer = new StringTokenizer(line);
      while (tokenizer.hasMoreTokens()) {
        String word = tokenizer.nextToken();

        // we emit a (word, 1) pair
        collector.collect(new Record(new StringValue(word), new IntValue(1)));
      }
    }
View Full Code Here

        element = records.next();
        int cnt = element.getField(1, IntValue.class).getValue();
        sum += cnt;
      }

      element.setField(1, new IntValue(sum));
      out.collect(element);
    }
View Full Code Here

      StringTokenizer tokenizer = new StringTokenizer(line);
      while (tokenizer.hasMoreTokens()) {
        String word = tokenizer.nextToken();
       
        // we emit a (word, 1) pair
        collector.collect(new Record(new StringValue(word), new IntValue(1)));
      }
    }
View Full Code Here

        element = records.next();
        int cnt = element.getField(1, IntValue.class).getValue();
        sum += cnt;
      }

      element.setField(1, new IntValue(sum));
      out.collect(element);
    }
View Full Code Here

      v2 = v2        | (0xFF & bytes[startPos+4]);
      v2 = (v2 << 8) | (0xFF & bytes[startPos+5]);
      v2 = (v2 << 8) | (0xFF & bytes[startPos+6]);
      v2 = (v2 << 8) | (0xFF & bytes[startPos+7]);
     
      record.setField(0,new IntValue(v1));
      record.setField(1,new IntValue(v2));
     
      cnt++;
     
      return true;
    }
View Full Code Here

TOP

Related Classes of eu.stratosphere.types.IntValue

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.