Tabnine Logo
GraphCsvReader
Code IndexAdd Tabnine to your IDE (free)

How to use
GraphCsvReader
in
org.apache.flink.graph

Best Java code snippets using org.apache.flink.graph.GraphCsvReader (Showing top 15 results out of 315)

origin: apache/flink

/**
* Creates a graph from a CSV file of edges. Vertices will be created automatically.
*
* @param edgesPath a path to a CSV file with the Edges data
* @param context the execution environment.
* @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
* on which calling methods to specify types of the Vertex ID, Vertex value and Edge value returns a Graph.
*
* @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
*/
public static GraphCsvReader fromCsvReader(String edgesPath, ExecutionEnvironment context) {
  return new GraphCsvReader(edgesPath, context);
}
origin: apache/flink

@Override
public Graph<K, NullValue, NullValue> create(ExecutionEnvironment env) throws Exception {
  GraphCsvReader reader = Graph.fromCsvReader(inputFilename.getValue(), env)
    .ignoreCommentsEdges(commentPrefix.getValue())
    .lineDelimiterEdges(lineDelimiter.getValue())
    .fieldDelimiterEdges(fieldDelimiter.getValue());
    case INTEGER:
      graph = (Graph<K, NullValue, NullValue>) reader
        .keyType(IntValue.class);
      break;
        .keyType(LongValue.class);
      break;
        .keyType(StringValue.class);
      break;
origin: apache/flink

private static Graph<Long, Double, Double> getGraph(ExecutionEnvironment env) {
  if (fileOutput) {
    return Graph.fromCsvReader(verticesInputPath, edgesInputPath, env).lineDelimiterEdges("\n")
        .types(Long.class, Double.class, Double.class);
  } else {
    return Graph.fromDataSet(IncrementalSSSPData.getDefaultVertexDataSet(env), IncrementalSSSPData.getDefaultEdgeDataSet(env), env);
  }
}
origin: apache/flink

/**
* Creates a Graph from a CSV file of vertices and a CSV file of edges.
*
* @param verticesPath path to a CSV file with the Vertex data.
* @param edgesPath path to a CSV file with the Edge data
* @param context the Flink execution environment.
* @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
* on which calling methods to specify types of the Vertex ID, Vertex value and Edge value returns a Graph.
*
* @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
*/
public static GraphCsvReader fromCsvReader(String verticesPath, String edgesPath, ExecutionEnvironment context) {
  return new GraphCsvReader(verticesPath, edgesPath, context);
}
origin: apache/flink

private static Graph<Long, Double, Double> getSSSPGraph(ExecutionEnvironment env) {
  if (fileOutput) {
    return Graph.fromCsvReader(verticesInputPath, edgesInSSSPInputPath, env).lineDelimiterEdges("\n")
        .types(Long.class, Double.class, Double.class);
  } else {
    return Graph.fromDataSet(IncrementalSSSPData.getDefaultVertexDataSet(env), IncrementalSSSPData.getDefaultEdgesInSSSP(env), env);
  }
}
origin: apache/flink

/**
 * Creates a graph from a CSV file of edges. Vertices will be created automatically and
 * Vertex values can be initialized using a user-defined mapper.
 *
 * @param edgesPath a path to a CSV file with the Edge data
 * @param vertexValueInitializer the mapper function that initializes the vertex values.
 * It allows to apply a map transformation on the vertex ID to produce an initial vertex value.
 * @param context the execution environment.
 * @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
 * on which calling methods to specify types of the Vertex ID, Vertex Value and Edge value returns a Graph.
 *
 * @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
 */
public static <K, VV> GraphCsvReader fromCsvReader(String edgesPath,
    final MapFunction<K, VV> vertexValueInitializer, ExecutionEnvironment context) {
  return new GraphCsvReader(edgesPath, vertexValueInitializer, context);
}
origin: com.alibaba.blink/flink-gelly

/**
* Creates a graph from a CSV file of edges. Vertices will be created automatically.
*
* @param edgesPath a path to a CSV file with the Edges data
* @param context the execution environment.
* @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
* on which calling methods to specify types of the Vertex ID, Vertex value and Edge value returns a Graph.
*
* @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
*/
public static GraphCsvReader fromCsvReader(String edgesPath, ExecutionEnvironment context) {
  return new GraphCsvReader(edgesPath, context);
}
origin: org.apache.flink/flink-gelly_2.10

/**
* Creates a Graph from a CSV file of vertices and a CSV file of edges.
* 
* @param verticesPath path to a CSV file with the Vertex data.
* @param edgesPath path to a CSV file with the Edge data
* @param context the Flink execution environment.
* @return An instance of {@link org.apache.flink.graph.GraphCsvReader}, 
* on which calling methods to specify types of the Vertex ID, Vertex value and Edge value returns a Graph.
* 
* @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
*/
public static GraphCsvReader fromCsvReader(String verticesPath, String edgesPath, ExecutionEnvironment context) {
  return new GraphCsvReader(verticesPath, edgesPath, context);
}
origin: org.apache.flink/flink-gelly_2.10

/** 
* Creates a graph from a CSV file of edges. Vertices will be created automatically.
*
* @param edgesPath a path to a CSV file with the Edges data
* @param context the execution environment.
* @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
* on which calling methods to specify types of the Vertex ID, Vertex value and Edge value returns a Graph.
* 
* @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
*/
public static GraphCsvReader fromCsvReader(String edgesPath, ExecutionEnvironment context) {
  return new GraphCsvReader(edgesPath, context);
}
origin: org.apache.flink/flink-gelly_2.11

/**
* Creates a graph from a CSV file of edges. Vertices will be created automatically.
*
* @param edgesPath a path to a CSV file with the Edges data
* @param context the execution environment.
* @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
* on which calling methods to specify types of the Vertex ID, Vertex value and Edge value returns a Graph.
*
* @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
*/
public static GraphCsvReader fromCsvReader(String edgesPath, ExecutionEnvironment context) {
  return new GraphCsvReader(edgesPath, context);
}
origin: org.apache.flink/flink-gelly_2.11

/**
* Creates a Graph from a CSV file of vertices and a CSV file of edges.
*
* @param verticesPath path to a CSV file with the Vertex data.
* @param edgesPath path to a CSV file with the Edge data
* @param context the Flink execution environment.
* @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
* on which calling methods to specify types of the Vertex ID, Vertex value and Edge value returns a Graph.
*
* @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
*/
public static GraphCsvReader fromCsvReader(String verticesPath, String edgesPath, ExecutionEnvironment context) {
  return new GraphCsvReader(verticesPath, edgesPath, context);
}
origin: com.alibaba.blink/flink-gelly

/**
* Creates a Graph from a CSV file of vertices and a CSV file of edges.
*
* @param verticesPath path to a CSV file with the Vertex data.
* @param edgesPath path to a CSV file with the Edge data
* @param context the Flink execution environment.
* @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
* on which calling methods to specify types of the Vertex ID, Vertex value and Edge value returns a Graph.
*
* @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
* @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
*/
public static GraphCsvReader fromCsvReader(String verticesPath, String edgesPath, ExecutionEnvironment context) {
  return new GraphCsvReader(verticesPath, edgesPath, context);
}
origin: com.alibaba.blink/flink-gelly

/**
 * Creates a graph from a CSV file of edges. Vertices will be created automatically and
 * Vertex values can be initialized using a user-defined mapper.
 *
 * @param edgesPath a path to a CSV file with the Edge data
 * @param vertexValueInitializer the mapper function that initializes the vertex values.
 * It allows to apply a map transformation on the vertex ID to produce an initial vertex value.
 * @param context the execution environment.
 * @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
 * on which calling methods to specify types of the Vertex ID, Vertex Value and Edge value returns a Graph.
 *
 * @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
 */
public static <K, VV> GraphCsvReader fromCsvReader(String edgesPath,
    final MapFunction<K, VV> vertexValueInitializer, ExecutionEnvironment context) {
  return new GraphCsvReader(edgesPath, vertexValueInitializer, context);
}
origin: org.apache.flink/flink-gelly_2.10

/** 
 * Creates a graph from a CSV file of edges. Vertices will be created automatically and
 * Vertex values can be initialized using a user-defined mapper.
 *
 * @param edgesPath a path to a CSV file with the Edge data
 * @param vertexValueInitializer the mapper function that initializes the vertex values.
 * It allows to apply a map transformation on the vertex ID to produce an initial vertex value.
 * @param context the execution environment.
 * @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
 * on which calling methods to specify types of the Vertex ID, Vertex Value and Edge value returns a Graph.
 * 
 * @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
 */
public static <K, VV> GraphCsvReader fromCsvReader(String edgesPath,
    final MapFunction<K, VV> vertexValueInitializer, ExecutionEnvironment context) {
  return new GraphCsvReader(edgesPath, vertexValueInitializer, context);
}
origin: org.apache.flink/flink-gelly_2.11

/**
 * Creates a graph from a CSV file of edges. Vertices will be created automatically and
 * Vertex values can be initialized using a user-defined mapper.
 *
 * @param edgesPath a path to a CSV file with the Edge data
 * @param vertexValueInitializer the mapper function that initializes the vertex values.
 * It allows to apply a map transformation on the vertex ID to produce an initial vertex value.
 * @param context the execution environment.
 * @return An instance of {@link org.apache.flink.graph.GraphCsvReader},
 * on which calling methods to specify types of the Vertex ID, Vertex Value and Edge value returns a Graph.
 *
 * @see org.apache.flink.graph.GraphCsvReader#types(Class, Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#vertexTypes(Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#edgeTypes(Class, Class)
 * @see org.apache.flink.graph.GraphCsvReader#keyType(Class)
 */
public static <K, VV> GraphCsvReader fromCsvReader(String edgesPath,
    final MapFunction<K, VV> vertexValueInitializer, ExecutionEnvironment context) {
  return new GraphCsvReader(edgesPath, vertexValueInitializer, context);
}
org.apache.flink.graphGraphCsvReader

Javadoc

A class to build a Graph using path(s) provided to CSV file(s) with optional vertex and edge data. The class also configures the CSV readers used to read edge and vertex data such as the field types, the delimiters (row and field), the fields that should be included or skipped, and other flags, such as whether to skip the initial line as the header. The configuration is done using the functions provided in the org.apache.flink.api.java.io.CsvReader class.

Most used methods

  • <init>
  • fieldDelimiterEdges
    Configures the Delimiter that separates fields in a row for the CSV reader used to read the edges (
  • ignoreCommentsEdges
    Configures the string that starts comments for the Edge Csv Reader. By default comments will be trea
  • keyType
    Creates a Graph from CSV input without vertex values or edge values.
  • lineDelimiterEdges
    Configures the Delimiter that separates rows for the CSV reader used to read the edges ( '\n') is us
  • types
    Creates a Graph from CSV input with vertex values and edge values. The vertex values are specified t

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Reference (javax.naming)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now