ResultTypeQueryable
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.flink.api.java.typeutils.ResultTypeQueryable(Showing top 15 results out of 315)

origin: apache/flink

@SuppressWarnings("unchecked")
@PublicEvolving
public static <IN> TypeInformation<IN> getInputFormatTypes(InputFormat<IN, ?> inputFormatInterface) {
  if (inputFormatInterface instanceof ResultTypeQueryable) {
    return ((ResultTypeQueryable<IN>) inputFormatInterface).getProducedType();
  }
  return new TypeExtractor().privateCreateTypeInfo(InputFormat.class, inputFormatInterface.getClass(), 0, null, null);
}
origin: apache/flink

/**
 * Apply a function to the attribute of each vertex in the graph.
 *
 * @param mapper the map function to apply.
 * @return a new graph
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public <NV> Graph<K, NV, EV> mapVertices(final MapFunction<Vertex<K, VV>, NV> mapper) {
  TypeInformation<K> keyType = ((TupleTypeInfo<?>) vertices.getType()).getTypeAt(0);
  TypeInformation<NV> valueType;
  if (mapper instanceof ResultTypeQueryable) {
    valueType = ((ResultTypeQueryable) mapper).getProducedType();
  } else {
    valueType = TypeExtractor.createTypeInfo(MapFunction.class, mapper.getClass(), 1, vertices.getType(), null);
  }
  TypeInformation<Vertex<K, NV>> returnType = (TypeInformation<Vertex<K, NV>>) new TupleTypeInfo(
      Vertex.class, keyType, valueType);
  return mapVertices(mapper, returnType);
}
origin: apache/flink

/**
 * Creates a {@link TypeInformation} from the given parameters.
 *
 * If the given {@code instance} implements {@link ResultTypeQueryable}, its information
 * is used to determine the type information. Otherwise, the type information is derived
 * based on the given class information.
 *
 * @param instance            instance to determine type information for
 * @param baseClass            base class of {@code instance}
 * @param clazz                class of {@code instance}
 * @param returnParamPos    index of the return type in the type arguments of {@code clazz}
 * @param <OUT>                output type
 * @return type information
 */
@SuppressWarnings("unchecked")
@PublicEvolving
public static <OUT> TypeInformation<OUT> createTypeInfo(Object instance, Class<?> baseClass, Class<?> clazz, int returnParamPos) {
  if (instance instanceof ResultTypeQueryable) {
    return ((ResultTypeQueryable<OUT>) instance).getProducedType();
  } else {
    return createTypeInfo(baseClass, clazz, returnParamPos, null, null);
  }
}
origin: apache/flink

  typeInfo = ((ResultTypeQueryable<OUT>) function).getProducedType();
} else {
  try {
origin: apache/flink

 funcOrInputFormat: AnyRef,
 typeInfo: TypeInformation[T]): TypeInformation[T] = funcOrInputFormat match {
case rtq: ResultTypeQueryable[_] => rtq.asInstanceOf[ResultTypeQueryable[T]].getProducedType
case _ => typeInfo
origin: apache/flink

  return ((ResultTypeQueryable<OUT>) function).getProducedType();
validateInputType(baseClass, function.getClass(), inputTypeArgumentIndex, inType);
if(function instanceof ResultTypeQueryable) {
  return ((ResultTypeQueryable<OUT>) function).getProducedType();
origin: apache/flink

validateInputType(input2, in2Type);
if(function instanceof ResultTypeQueryable) {
  return ((ResultTypeQueryable<OUT>) function).getProducedType();
validateInputType(baseClass, function.getClass(), input2TypeArgumentIndex, in2Type);
if(function instanceof ResultTypeQueryable) {
  return ((ResultTypeQueryable<OUT>) function).getProducedType();
origin: apache/flink

/**
 * Apply a function to the attribute of each edge in the graph.
 *
 * @param mapper the map function to apply.
 * @return a new graph
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public <NV> Graph<K, VV, NV> mapEdges(final MapFunction<Edge<K, EV>, NV> mapper) {
  TypeInformation<K> keyType = ((TupleTypeInfo<?>) edges.getType()).getTypeAt(0);
  TypeInformation<NV> valueType;
  if (mapper instanceof ResultTypeQueryable) {
    valueType = ((ResultTypeQueryable) mapper).getProducedType();
  } else {
    valueType = TypeExtractor.createTypeInfo(MapFunction.class, mapper.getClass(), 1, edges.getType(), null);
  }
  TypeInformation<Edge<K, NV>> returnType = (TypeInformation<Edge<K, NV>>) new TupleTypeInfo(
      Edge.class, keyType, keyType, valueType);
  return mapEdges(mapper, returnType);
}
origin: org.apache.flink/flink-core

@SuppressWarnings("unchecked")
@PublicEvolving
public static <IN> TypeInformation<IN> getInputFormatTypes(InputFormat<IN, ?> inputFormatInterface) {
  if (inputFormatInterface instanceof ResultTypeQueryable) {
    return ((ResultTypeQueryable<IN>) inputFormatInterface).getProducedType();
  }
  return new TypeExtractor().privateCreateTypeInfo(InputFormat.class, inputFormatInterface.getClass(), 0, null, null);
}
origin: org.apache.flink/flink-core

@SuppressWarnings("unchecked")
@PublicEvolving
public static <IN> TypeInformation<IN> getInputFormatTypes(InputFormat<IN, ?> inputFormatInterface) {
  if (inputFormatInterface instanceof ResultTypeQueryable) {
    return ((ResultTypeQueryable<IN>) inputFormatInterface).getProducedType();
  }
  return new TypeExtractor().privateCreateTypeInfo(InputFormat.class, inputFormatInterface.getClass(), 0, null, null);
}
origin: org.apache.flink/flink-gelly_2.11

/**
 * Apply a function to the attribute of each edge in the graph.
 *
 * @param mapper the map function to apply.
 * @return a new graph
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public <NV> Graph<K, VV, NV> mapEdges(final MapFunction<Edge<K, EV>, NV> mapper) {
  TypeInformation<K> keyType = ((TupleTypeInfo<?>) edges.getType()).getTypeAt(0);
  TypeInformation<NV> valueType;
  if (mapper instanceof ResultTypeQueryable) {
    valueType = ((ResultTypeQueryable) mapper).getProducedType();
  } else {
    valueType = TypeExtractor.createTypeInfo(MapFunction.class, mapper.getClass(), 1, edges.getType(), null);
  }
  TypeInformation<Edge<K, NV>> returnType = (TypeInformation<Edge<K, NV>>) new TupleTypeInfo(
      Edge.class, keyType, keyType, valueType);
  return mapEdges(mapper, returnType);
}
origin: org.apache.flink/flink-gelly_2.10

/**
 * Apply a function to the attribute of each vertex in the graph.
 * 
 * @param mapper the map function to apply.
 * @return a new graph
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public <NV> Graph<K, NV, EV> mapVertices(final MapFunction<Vertex<K, VV>, NV> mapper) {
  TypeInformation<K> keyType = ((TupleTypeInfo<?>) vertices.getType()).getTypeAt(0);
  TypeInformation<NV> valueType;
  if (mapper instanceof ResultTypeQueryable) {
    valueType = ((ResultTypeQueryable) mapper).getProducedType();
  } else {
    valueType = TypeExtractor.createTypeInfo(MapFunction.class, mapper.getClass(), 1, vertices.getType(), null);
  }
  TypeInformation<Vertex<K, NV>> returnType = (TypeInformation<Vertex<K, NV>>) new TupleTypeInfo(
      Vertex.class, keyType, valueType);
  return mapVertices(mapper, returnType);
}
origin: org.apache.flink/flink-gelly_2.10

/**
 * Apply a function to the attribute of each edge in the graph.
 * 
 * @param mapper the map function to apply.
 * @return a new graph
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public <NV> Graph<K, VV, NV> mapEdges(final MapFunction<Edge<K, EV>, NV> mapper) {
  TypeInformation<K> keyType = ((TupleTypeInfo<?>) edges.getType()).getTypeAt(0);
  TypeInformation<NV> valueType;
  if (mapper instanceof ResultTypeQueryable) {
    valueType = ((ResultTypeQueryable) mapper).getProducedType();
  } else {
    valueType = TypeExtractor.createTypeInfo(MapFunction.class, mapper.getClass(), 1, edges.getType(), null);
  }
  TypeInformation<Edge<K, NV>> returnType = (TypeInformation<Edge<K, NV>>) new TupleTypeInfo(
      Edge.class, keyType, keyType, valueType);
  return mapEdges(mapper, returnType);
}
origin: org.apache.flink/flink-gelly_2.11

/**
 * Apply a function to the attribute of each vertex in the graph.
 *
 * @param mapper the map function to apply.
 * @return a new graph
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public <NV> Graph<K, NV, EV> mapVertices(final MapFunction<Vertex<K, VV>, NV> mapper) {
  TypeInformation<K> keyType = ((TupleTypeInfo<?>) vertices.getType()).getTypeAt(0);
  TypeInformation<NV> valueType;
  if (mapper instanceof ResultTypeQueryable) {
    valueType = ((ResultTypeQueryable) mapper).getProducedType();
  } else {
    valueType = TypeExtractor.createTypeInfo(MapFunction.class, mapper.getClass(), 1, vertices.getType(), null);
  }
  TypeInformation<Vertex<K, NV>> returnType = (TypeInformation<Vertex<K, NV>>) new TupleTypeInfo(
      Vertex.class, keyType, valueType);
  return mapVertices(mapper, returnType);
}
origin: org.apache.flink/flink-core

/**
 * Creates a {@link TypeInformation} from the given parameters.
 *
 * If the given {@code instance} implements {@link ResultTypeQueryable}, its information
 * is used to determine the type information. Otherwise, the type information is derived
 * based on the given class information.
 *
 * @param instance            instance to determine type information for
 * @param baseClass            base class of {@code instance}
 * @param clazz                class of {@code instance}
 * @param returnParamPos    index of the return type in the type arguments of {@code clazz}
 * @param <OUT>                output type
 * @return type information
 */
@SuppressWarnings("unchecked")
@PublicEvolving
public static <OUT> TypeInformation<OUT> createTypeInfo(Object instance, Class<?> baseClass, Class<?> clazz, int returnParamPos) {
  if (instance instanceof ResultTypeQueryable) {
    return ((ResultTypeQueryable<OUT>) instance).getProducedType();
  } else {
    return createTypeInfo(baseClass, clazz, returnParamPos, null, null);
  }
}
org.apache.flink.api.java.typeutilsResultTypeQueryable

Javadoc

This interface can be implemented by functions and input formats to tell the framework about their produced data type. This method acts as an alternative to the reflection analysis that is otherwise performed and is useful in situations where the produced data type may vary depending on parametrization.

Most used methods

  • getProducedType
    Gets the data type (as a TypeInformation) produced by this function or input format.

Popular classes and methods

  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
    Returns a new BigDecimal instance with the specified scale. If the new scale is greater than the old
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)