Search in sources :

Example 1 with GiraphConfiguration

use of org.apache.giraph.conf.GiraphConfiguration in project incubator-rya by apache.

the class TestVertexFormat method testRyaInput.

/*
    Write a simple parent-child directed graph to Cloudbase.
    Run a job which reads the values
    into subclasses that extend CloudbaseVertex I/O formats.
    Check the output after the job.
    */
@Test
public void testRyaInput() throws Exception {
    AccumuloRdfConfiguration conf = getConf();
    AccumuloRyaDAO ryaDAO = RyaSailFactory.getAccumuloDAO(conf);
    ryaDAO.add(new RyaStatement(new RyaURI("urn:test#1234"), new RyaURI("urn:test#pred1"), new RyaURI("urn:test#obj1")));
    ryaDAO.add(new RyaStatement(new RyaURI("urn:test#1234"), new RyaURI("urn:test#pred2"), new RyaURI("urn:test#obj2")));
    ryaDAO.add(new RyaStatement(new RyaURI("urn:test#1234"), new RyaURI("urn:test#pred3"), new RyaURI("urn:test#obj3")));
    ryaDAO.add(new RyaStatement(new RyaURI("urn:test#1234"), new RyaURI("urn:test#pred4"), new RyaURI("urn:test#obj4")));
    ryaDAO.flush();
    GiraphJob job = new GiraphJob(conf, getCallingMethodName());
    setupConfiguration(job);
    GiraphConfiguration giraphConf = job.getConfiguration();
    giraphConf.setComputationClass(EdgeNotification.class);
    giraphConf.setVertexInputFormatClass(RyaVertexInputFormat.class);
    giraphConf.setVertexOutputFormatClass(TestTextOutputFormat.class);
    if (log.isInfoEnabled())
        log.info("Running edge notification job using Rya Vertex input");
}
Also used : AccumuloRyaDAO(org.apache.rya.accumulo.AccumuloRyaDAO) RyaURI(org.apache.rya.api.domain.RyaURI) GiraphConfiguration(org.apache.giraph.conf.GiraphConfiguration) RyaStatement(org.apache.rya.api.domain.RyaStatement) GiraphJob(org.apache.giraph.job.GiraphJob) AccumuloRdfConfiguration(org.apache.rya.accumulo.AccumuloRdfConfiguration) Test(org.junit.Test)

Aggregations

GiraphConfiguration (org.apache.giraph.conf.GiraphConfiguration)1 GiraphJob (org.apache.giraph.job.GiraphJob)1 AccumuloRdfConfiguration (org.apache.rya.accumulo.AccumuloRdfConfiguration)1 AccumuloRyaDAO (org.apache.rya.accumulo.AccumuloRyaDAO)1 RyaStatement (org.apache.rya.api.domain.RyaStatement)1 RyaURI (org.apache.rya.api.domain.RyaURI)1 Test (org.junit.Test)1