/** * Checks whether this instance is more general that the given one, i.e., it is a valid type of datasets that are * also valid under the given type. * * @param that the other instance * @return whether this instance is a super type of {@code that} instance */ public boolean isSupertypeOf(DataSetType that) { return this.dataUnitType.toBasicDataUnitType().isSupertypeOf(that.dataUnitType.toBasicDataUnitType()); }
public AggregationDescriptor(Class<InputType> inputTypeClass, Class<OutputType> outputTypeClass, LoadProfileEstimator loadProfileEstimator) { this(DataUnitType.createGrouped(inputTypeClass), DataUnitType.createBasic(outputTypeClass), loadProfileEstimator); }
public ReduceDescriptor(SerializableBinaryOperator<Type> javaImplementation, Class<Type> inputType) { this(javaImplementation, DataUnitType.createGroupedUnchecked(inputType), DataUnitType.createBasicUnchecked(inputType) ); }
/** * 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()); }
public FlatMapDescriptor(SerializableFunction<Input, Iterable<Output>> javaImplementation, Class<Input> inputTypeClass, Class<Output> outputTypeClass, ProbabilisticDoubleInterval selectivity, LoadProfileEstimator loadProfileEstimator) { this(javaImplementation, DataUnitType.createBasic(inputTypeClass), DataUnitType.createBasic(outputTypeClass), selectivity, loadProfileEstimator ); }
public static <T> BasicDataUnitType<T> createBasic(Class<T> cls) { return createBasicUnchecked(cls); }
/** * Tells whether this is a normal data unit type. */ public boolean isPlain() { return !this.isGroup(); }
public static <T> DataUnitGroupType<T> createGrouped(Class<T> cls) { return createGroupedUnchecked(cls); }
/** * 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); }
public MapPartitionsDescriptor(SerializableFunction<Iterable<Input>, Iterable<Output>> javaImplementation, Class<Input> inputTypeClass, Class<Output> outputTypeClass, ProbabilisticDoubleInterval selectivity, LoadProfileEstimator loadProfileEstimator) { this(javaImplementation, DataUnitType.createBasic(inputTypeClass), DataUnitType.createBasic(outputTypeClass), selectivity, loadProfileEstimator); }
public static <T> DataUnitGroupType<T> createGroupedUnchecked(Class<?> cls) { return new DataUnitGroupType<>(createBasicUnchecked(cls)); }
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)); }
inputType.getDataUnitType().toBasicDataUnitType(), outputType.getDataUnitType().toBasicDataUnitType()
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); }