@Test
    public void shouldLoadVerticesRDDWithInputFormat() {
        final JavaSparkContext sparkContext = getSparkContext();

        final Configuration sparkGraphConfiguration = new BaseConfiguration();
        sparkGraphConfiguration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, GryoInputFormat.class.getCanonicalName());
        sparkGraphConfiguration.setProperty(Constants.MAPREDUCE_INPUT_FILEINPUTFORMAT_INPUTDIR,
                TestFiles.PATHS.get("tinkerpop-modern-v3.kryo"));

        // load vertices
        JavaPairRDD<Object, VertexWritable> verticesRDD = SparkIOUtil.loadVertices(sparkGraphConfiguration, sparkContext);
        assertEquals(6, verticesRDD.count());

        sparkContext.stop();
    }
@author Boxuan Li (https://li-boxuan.com)
spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/SparkRDDLoadTest.java