public boolean isCompatibleWith(Slot<?> that) { return this.type.equals(that.type); }
public JavaTsvFileSink(String targetPath, DataSetType<T> type) { super(type); assert type.equals(DataSetType.createDefault(Tuple2.class)) : String.format("Illegal type for %s: %s", this, type); this.targetPath = targetPath; }
public SparkTsvFileSink(String targetPath, DataSetType<T> type) { super(type); assert type.equals(DataSetType.createDefault(Tuple2.class)) : String.format("Illegal type for %s: %s", this, type); this.targetPath = targetPath; }
/** * Compares the outputs of two operators and passes quietly if they are identical. * * @throws IllegalArgumentException if the operators differ in their outputs */ public static void assertEqualOutputs(Operator o1, Operator o2) throws IllegalArgumentException { if (o1.getNumOutputs() != o2.getNumOutputs()) { throw new IllegalArgumentException(String.format("%s and %s have different numbers of outputs.", o1, o2)); } for (int i = 0; i < o1.getNumOutputs(); i++) { final OutputSlot<?> output1 = o1.getOutput(i); final OutputSlot<?> output2 = o2.getOutput(i); if ((output1 == null && output2 != null) || (output1 != null && output2 == null) || (output1 != null && output2 != null && !output1.getType().equals(output2.getType()))) { throw new IllegalArgumentException("Operators differ in output " + i + "."); } } }
/** * Compares the inputs of two operators and passes quietly if they are identical. * * @throws IllegalArgumentException if the operators differ in their inputs */ public static void assertEqualInputs(Operator o1, Operator o2) throws IllegalArgumentException { if (o1.getNumInputs() != o2.getNumInputs()) { throw new IllegalArgumentException(String.format("%s and %s have different numbers of inputs.", o1, o2)); } for (int i = 0; i < o1.getNumInputs(); i++) { final InputSlot<?> input1 = o1.getInput(i); final InputSlot<?> input2 = o2.getInput(i); if ((input1 == null && input2 != null) || (input1 != null && input2 == null) || (input1 != null && input2 != null && !input1.getType().equals(input2.getType()))) { throw new IllegalArgumentException("Operators differ in input " + i + "."); } } }