/** * Checks whether the given instance is the same as this instance or more specific. * * @param that the other instance * @return whether this instance is a super type of {@code that} instance */ public boolean isSupertypeOf(BasicDataUnitType<?> that) { return this.getTypeClass().isAssignableFrom(that.getTypeClass()); }
/** * Creates a new instance. * * @param type type of the dataunit elements */ public FilterOperator(DataSetType<Type> type, PredicateDescriptor.SerializablePredicate<Type> predicateDescriptor) { this(new PredicateDescriptor<>(predicateDescriptor, type.getDataUnitType().getTypeClass()), type); }
private T lineParse(String line) { // TODO rewrite in less verbose way. Class typeClass = this.getType().getDataUnitType().getTypeClass(); int tabPos = line.indexOf('\t'); if (tabPos == -1) { if (typeClass == Integer.class) { return (T) Integer.valueOf(line); } else if (typeClass == Float.class) { return (T) Float.valueOf(line); } else if (typeClass == String.class) { return (T) String.valueOf(line); } else throw new RheemException(String.format("Cannot parse TSV file line %s", line)); } else if (typeClass == Record.class) { // TODO: Fix Record parsing. return (T) new Record(); } else if (typeClass == Tuple2.class) { // TODO: Fix Tuple2 parsing return (T) new Tuple2( Integer.valueOf(line.substring(0, tabPos)), Float.valueOf(line.substring(tabPos + 1))); } else throw new RheemException(String.format("Cannot parse TSV file line %s", line)); }
nextNodeId++, inputChannel.getClass().getCanonicalName(), inputChannel.getDataSetType().getDataUnitType().getTypeClass().getName() ); channelNodeMap.put(inputChannel, channelNode); nextNodeId++, outputChannel.getClass().getCanonicalName(), outputChannel.getDataSetType().getDataUnitType().getTypeClass().getName() ); channelNodeMap.put(outputChannel, channelNode);
private SubplanPattern createSubplanPattern() { final OperatorPattern operatorPattern = new OperatorPattern<>( "sink", new TextFileSink<>(null, DataSetType.none().getDataUnitType().getTypeClass()), false ); return SubplanPattern.createSingleton(operatorPattern); }
private SubplanPattern createSubplanPattern() { final OperatorPattern operatorPattern = new OperatorPattern<>( "sink", new TextFileSink<>("", DataSetType.none().getDataUnitType().getTypeClass()), false ); return SubplanPattern.createSingleton(operatorPattern); }