@Override public LongValue copy() { return new LongValue(this.value); }
@Override public LongValue getAggregate() { return new LongValue(agg); } }
private Value[] createLongValues(int num) { Value[] v = new Value[num]; for (int i = 0; i < num; i++) { v[i] = new LongValue(); } return v; }
@Override public LongValue translate(Long value, LongValue reuse) throws Exception { if (reuse == null) { reuse = new LongValue(); } reuse.setValue(value); return reuse; } }
@Override public LongValue[] getValidTestResults() { return new LongValue[] { new LongValue(0L), new LongValue(1L), new LongValue(576L), new LongValue(-877678L), new LongValue((long) Integer.MAX_VALUE), new LongValue((long) Integer.MIN_VALUE), new LongValue(Long.MAX_VALUE), new LongValue(Long.MIN_VALUE), new LongValue(7656L), new LongValue(1239L) }; }
@Override public LongValue copy(LongValue from) { return copy(from, new LongValue()); }
@Override public LongValue deserialize(DataInputView source) throws IOException { return deserialize(new LongValue(), source); }
@Override protected LongValue[] getTestData() { Random rnd = new Random(874597969123412341L); long rndLong = rnd.nextLong(); return new LongValue[] {new LongValue(0L), new LongValue(1L), new LongValue(-1L), new LongValue(Long.MAX_VALUE), new LongValue(Long.MIN_VALUE), new LongValue(rndLong), new LongValue(-rndLong)}; } }
@Override public LongValue translate(LongValue value, LongValue reuse) throws Exception { if (reuse == null) { reuse = new LongValue(); } reuse.setValue(offset + value.getValue()); return reuse; } }
public CrazyNested(String set, String second, long s) { // additional CTor to set all fields to non-null values this(set); something = new LongValue(s); nestLvl1.a = new StringValue(second); }
public CustomType(int i, long l, String s) { myInt = new IntValue(i); myLong = new LongValue(l); myString = new StringValue(s); }
public FromTupleWithCTor(int special, long tupleField) { this.special = new IntValue(special); this.setField(new LongValue(tupleField), 2); } }
public static DataSet<Tuple3<IntValue, LongValue, StringValue>> getSmall3TupleDataSet(ExecutionEnvironment env) { List<Tuple3<IntValue, LongValue, StringValue>> data = new ArrayList<>(); data.add(new Tuple3<>(new IntValue(1), new LongValue(1L), new StringValue("Hi"))); data.add(new Tuple3<>(new IntValue(2), new LongValue(2L), new StringValue("Hello"))); data.add(new Tuple3<>(new IntValue(3), new LongValue(2L), new StringValue("Hello world"))); Collections.shuffle(data); return env.fromCollection(data); }
@SuppressWarnings("unchecked") private static DataSet<Tuple3<Double, StringValue, LongValue>> getSourceDataSet(ExecutionEnvironment env) { return env.fromElements(new Tuple3<Double, StringValue, LongValue>(3.141592, new StringValue("foobar"), new LongValue(77))) .setParallelism(1); } }
@SuppressWarnings("unchecked") private static DataSet<Tuple3<Double, StringValue, LongValue>> getSourceDataSet(ExecutionEnvironment env, int parallelism) { return env .fromElements(new Tuple3<>(0.0, new StringValue(""), new LongValue(1L))) .setParallelism(parallelism); } }
private static DataSet<Tuple7<LongValue, IntValue, IntValue, LongValue, StringValue, IntValue, StringValue>> getSmallTuplebasedDataSetMatchingPojo(ExecutionEnvironment env) { List<Tuple7<LongValue, IntValue, IntValue, LongValue, StringValue, IntValue, StringValue>> data = new ArrayList<>(); data.add(new Tuple7<>(new LongValue(10000L), new IntValue(10), new IntValue(100), new LongValue(1000L), new StringValue("One"), new IntValue(1), new StringValue("First"))); data.add(new Tuple7<>(new LongValue(20000L), new IntValue(20), new IntValue(200), new LongValue(2000L), new StringValue("Two"), new IntValue(2), new StringValue("Second"))); data.add(new Tuple7<>(new LongValue(30000L), new IntValue(30), new IntValue(300), new LongValue(3000L), new StringValue("Three"), new IntValue(3), new StringValue("Third"))); return env.fromCollection(data); }
@SuppressWarnings("unchecked") private static DataSet<Tuple3<Double, StringValue, LongValue>> getSourceDataSet(ExecutionEnvironment env) { return env.fromElements(new Tuple3<Double, StringValue, LongValue>(3.141592, new StringValue("foobar"), new LongValue(77))) .setParallelism(1); }
private static DataSet<Tuple7<IntValue, StringValue, IntValue, IntValue, LongValue, StringValue, LongValue>> getSmallTuplebasedDataSet(ExecutionEnvironment env) { List<Tuple7<IntValue, StringValue, IntValue, IntValue, LongValue, StringValue, LongValue>> data = new ArrayList<>(); data.add(new Tuple7<>(new IntValue(1), new StringValue("First"), new IntValue(10), new IntValue(100), new LongValue(1000L), new StringValue("One"), new LongValue(10000L))); data.add(new Tuple7<>(new IntValue(2), new StringValue("Second"), new IntValue(20), new IntValue(200), new LongValue(2000L), new StringValue("Two"), new LongValue(20000L))); data.add(new Tuple7<>(new IntValue(3), new StringValue("Third"), new IntValue(30), new IntValue(300), new LongValue(3000L), new StringValue("Three"), new LongValue(30000L))); return env.fromCollection(data); }
public POJO(int i0, String s0, int i1, int i2, long l0, String s1, long l1) { this.number = new IntValue(i0); this.str = new StringValue(s0); this.nestedTupleWithCustom = new Tuple2<>(new IntValue(i1), new CustomType(i2, l0, s1)); this.nestedPojo = new NestedPojo(); this.nestedPojo.longNumber = new LongValue(l1); }