@Test public void testIncorrectSerializer4() { try { ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(PARLLELISM); env.getConfig().disableSysoutLogging(); env .generateSequence(1, 10 * PARLLELISM) .map(new MapFunction<Long, ConsumesTooLittleSpanning>() { @Override public ConsumesTooLittleSpanning map(Long value) throws Exception { return new ConsumesTooLittleSpanning(); } }) .rebalance() .output(new DiscardingOutputFormat<ConsumesTooLittleSpanning>()); env.execute(); } catch (ProgramInvocationException e) { Throwable rootCause = e.getCause().getCause(); assertTrue(rootCause instanceof IOException); assertTrue(rootCause.getMessage().contains("broken serialization")); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
@Test public void testIncorrectSerializer3() { try { ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(PARLLELISM); env.getConfig().disableSysoutLogging(); env .generateSequence(1, 10 * PARLLELISM) .map(new MapFunction<Long, ConsumesTooLittle>() { @Override public ConsumesTooLittle map(Long value) throws Exception { return new ConsumesTooLittle(); } }) .rebalance() .output(new DiscardingOutputFormat<ConsumesTooLittle>()); env.execute(); } catch (JobExecutionException e) { Throwable rootCause = e.getCause(); assertTrue(rootCause instanceof IOException); assertTrue(rootCause.getMessage().contains("broken serialization")); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
@Test public void testIncorrectSerializer1() { try { ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(PARLLELISM); env.getConfig().disableSysoutLogging(); env .generateSequence(1, 10 * PARLLELISM) .map(new MapFunction<Long, ConsumesTooMuch>() { @Override public ConsumesTooMuch map(Long value) throws Exception { return new ConsumesTooMuch(); } }) .rebalance() .output(new DiscardingOutputFormat<ConsumesTooMuch>()); env.execute(); } catch (JobExecutionException e) { Throwable rootCause = e.getCause(); assertTrue(rootCause instanceof IOException); assertTrue(rootCause.getMessage().contains("broken serialization")); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
@Test public void testIncorrectSerializer2() { try { ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(PARLLELISM); env.getConfig().disableSysoutLogging(); env .generateSequence(1, 10 * PARLLELISM) .map(new MapFunction<Long, ConsumesTooMuchSpanning>() { @Override public ConsumesTooMuchSpanning map(Long value) throws Exception { return new ConsumesTooMuchSpanning(); } }) .rebalance() .output(new DiscardingOutputFormat<ConsumesTooMuchSpanning>()); env.execute(); } catch (JobExecutionException e) { Throwable rootCause = e.getCause(); assertTrue(rootCause instanceof IOException); assertTrue(rootCause.getMessage().contains("broken serialization")); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
DataSet<Tuple2<Long, Long>> union123 = union12.union(src3); union123.rebalance().output(new DiscardingOutputFormat<Tuple2<Long, Long>>()).name("out");
DataSet<Tuple2<Long, Long>> union123 = union12.union(src3); union123.partitionByHash(1).output(new DiscardingOutputFormat<Tuple2<Long, Long>>()).name("out");
DataSet<Tuple2<Long, Long>> union123 = union12.union(src3); union123.partitionByRange(1).output(new DiscardingOutputFormat<Tuple2<Long, Long>>()).name("out");
@Override public Object doOperation(final AddElementsFromFile op, final Context context, final Store store) throws OperationException { final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); if (null != op.getParallelism()) { env.setParallelism(op.getParallelism()); } final FlatMapOperator<String, Element> builder = env.readTextFile(op.getFilename()) .flatMap(new GafferMapFunction(String.class, op.getElementGenerator())); if (Boolean.parseBoolean(op.getOption(FlinkConstants.SKIP_REBALANCING))) { builder.output(new GafferOutput(op, store)); } else { builder.rebalance().output(new GafferOutput(op, store)); } try { env.execute(op.getClass().getSimpleName() + "-" + op.getFilename()); } catch (final Exception e) { throw new OperationException("Failed to add elements from file: " + op.getFilename(), e); } return null; } }