Example usage for org.apache.hadoop.mapred JobConf set

List of usage examples for org.apache.hadoop.mapred JobConf set

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred JobConf set.

Prototype

public void set(String name, String value) 

Source Link

Document

Set the value of the name property.

Usage

From source file:gaffer.accumulo.TestAccumuloBackedGraphUpdatingConf.java

License:Apache License

@Test
public void testSetConfigurationWithTypeValuesAndEntitiesOnly() throws Exception {
    String instanceName = "testSetConfigurationWithTypeValuesAndEntitiesOnly";
    AccumuloBackedGraph graph = setUpGraphAndMockAccumulo(instanceName);
    AccumuloConfig accumuloConfig = setUpAccumuloConfig(instanceName);

    JobConf conf = new JobConf();
    conf.set("fs.default.name", "file:///");
    conf.set("mapred.job.tracker", "local");
    graph.setTimeWindow(sevenDaysBefore, sixDaysBefore);
    graph.setReturnEntitiesOnly();/* w ww . ja  va  2s .  c  o  m*/
    graph.setConfiguration(conf, new TypeValue("customer", "A"), accumuloConfig);
    FileSystem fs = FileSystem.getLocal(conf);

    // Run
    Driver driver = new Driver();
    driver.setConf(conf);
    String outputDir = tempFolder.newFolder().getAbsolutePath();
    FileUtils.deleteDirectory(outputDir);

    assertEquals(0, driver.run(new String[] { outputDir }));

    // Read results in
    Set<GraphElementWithStatistics> results = new HashSet<GraphElementWithStatistics>();
    int count = readResults(fs, new Path(outputDir), results);

    // There should be 1 entity
    assertEquals(1, count);
    Set<GraphElementWithStatistics> expectedResults = new HashSet<GraphElementWithStatistics>();
    Entity entity1 = new Entity("customer", "A", "purchase", "count", visibilityString1, sevenDaysBefore,
            sixDaysBefore);
    SetOfStatistics statisticsEntity1 = new SetOfStatistics();
    statisticsEntity1.addStatistic("entity_count", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(entity1), statisticsEntity1));

    assertEquals(expectedResults, results);
    graph.setTimeWindowToAllTime();
    graph.setReturnEntitiesAndEdges();
}

From source file:gaffer.accumulo.TestAccumuloBackedGraphUpdatingConf.java

License:Apache License

@Test
public void testSetConfigurationWithTypeValuesAndEdgesOnly() throws Exception {
    String instanceName = "testSetConfigurationWithTypeValuesAndEdgesOnly";
    AccumuloBackedGraph graph = setUpGraphAndMockAccumulo(instanceName);
    AccumuloConfig accumuloConfig = setUpAccumuloConfig(instanceName);

    JobConf conf = new JobConf();
    conf.set("fs.default.name", "file:///");
    conf.set("mapred.job.tracker", "local");
    graph.setTimeWindow(sevenDaysBefore, sixDaysBefore);
    graph.setReturnEdgesOnly();//  ww w. j a v  a2s . com
    graph.setConfiguration(conf, new TypeValue("customer", "A"), accumuloConfig);
    FileSystem fs = FileSystem.getLocal(conf);

    // Run
    Driver driver = new Driver();
    driver.setConf(conf);
    String outputDir = tempFolder.newFolder().getAbsolutePath();
    FileUtils.deleteDirectory(outputDir);

    assertEquals(0, driver.run(new String[] { outputDir }));

    // Read results in
    Set<GraphElementWithStatistics> results = new HashSet<GraphElementWithStatistics>();
    int count = readResults(fs, new Path(outputDir), results);

    // There should be 1 edge
    assertEquals(1, count);
    Set<GraphElementWithStatistics> expectedResults = new HashSet<GraphElementWithStatistics>();
    Edge edge1 = new Edge("customer", "A", "product", "P", "purchase", "instore", true, visibilityString1,
            sevenDaysBefore, sixDaysBefore);
    SetOfStatistics statistics1 = new SetOfStatistics();
    statistics1.addStatistic("count", new Count(1));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge1), statistics1));

    assertEquals(expectedResults, results);
    graph.setTimeWindowToAllTime();
    graph.setReturnEntitiesAndEdges();
}

From source file:gaffer.accumulo.TestAccumuloBackedGraphUpdatingConf.java

License:Apache License

@Test
public void testSetConfigurationWithTypeValueRanges() throws Exception {
    String instanceName = "testSetConfigurationWithTypeValueRanges";
    AccumuloBackedGraph graph = setUpGraphAndMockAccumulo(instanceName);
    AccumuloConfig accumuloConfig = setUpAccumuloConfig(instanceName);

    JobConf conf = new JobConf();
    conf.set("fs.default.name", "file:///");
    conf.set("mapred.job.tracker", "local");
    TypeValueRange range = new TypeValueRange("customer", "A", "customer", "Z");
    graph.setConfigurationFromRanges(conf, range, accumuloConfig);
    FileSystem fs = FileSystem.getLocal(conf);

    // Run/*from  w w  w .j  a v a 2 s .  com*/
    Driver driver = new Driver();
    driver.setConf(conf);
    String outputDir = tempFolder.newFolder().getAbsolutePath();
    FileUtils.deleteDirectory(outputDir);

    assertEquals(0, driver.run(new String[] { outputDir }));

    // Read results in
    Set<GraphElementWithStatistics> results = new HashSet<GraphElementWithStatistics>();
    int count = readResults(fs, new Path(outputDir), results);

    // There should be 3 edges and 1 entity
    assertEquals(4, count);
    Set<GraphElementWithStatistics> expectedResults = new HashSet<GraphElementWithStatistics>();
    Edge edge1 = new Edge("customer", "A", "product", "P", "purchase", "instore", true, visibilityString1,
            sevenDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics1 = new SetOfStatistics();
    statistics1.addStatistic("count", new Count(20));
    statistics1.addStatistic("anotherCount", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge1), statistics1));
    Edge edge4 = new Edge("customer", "A", "product", "P", "purchase", "instore", false, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics4 = new SetOfStatistics();
    statistics4.addStatistic("countSomething", new Count(123456));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge4), statistics4));
    Edge edge5 = new Edge("customer", "B", "product", "Q", "purchase", "instore", true, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics5 = new SetOfStatistics();
    statistics5.addStatistic("count", new Count(99));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge5), statistics5));
    Entity entity1 = new Entity("customer", "A", "purchase", "count", visibilityString1, sevenDaysBefore,
            sixDaysBefore);
    SetOfStatistics statisticsEntity1 = new SetOfStatistics();
    statisticsEntity1.addStatistic("entity_count", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(entity1), statisticsEntity1));

    assertEquals(expectedResults, results);
}

From source file:gaffer.accumulo.TestAccumuloBackedGraphUpdatingConf.java

License:Apache License

@Test
public void testSetConfigurationWithPairs() throws Exception {
    String instanceName = "testSetConfigurationWithPairs";
    AccumuloBackedGraph graph = setUpGraphAndMockAccumulo(instanceName);
    AccumuloConfig accumuloConfig = setUpAccumuloConfig(instanceName);

    JobConf conf = new JobConf();
    conf.set("fs.default.name", "file:///");
    conf.set("mapred.job.tracker", "local");
    Pair<TypeValue> pair = new Pair<TypeValue>(new TypeValue("customer", "B"), new TypeValue("product", "Q"));
    graph.setConfigurationFromPairs(conf, pair, accumuloConfig);
    FileSystem fs = FileSystem.getLocal(conf);

    // Run/*from w  w  w .ja va2  s  . c o m*/
    Driver driver = new Driver();
    driver.setConf(conf);
    String outputDir = tempFolder.newFolder().getAbsolutePath();
    FileUtils.deleteDirectory(outputDir);

    assertEquals(0, driver.run(new String[] { outputDir }));

    // Read results in
    Set<GraphElementWithStatistics> results = new HashSet<GraphElementWithStatistics>();
    int count = readResults(fs, new Path(outputDir), results);

    // There should be 1 edge
    assertEquals(1, count);
    Set<GraphElementWithStatistics> expectedResults = new HashSet<GraphElementWithStatistics>();
    Edge edge5 = new Edge("customer", "B", "product", "Q", "purchase", "instore", true, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics5 = new SetOfStatistics();
    statistics5.addStatistic("count", new Count(99));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge5), statistics5));

    assertEquals(expectedResults, results);
}

From source file:gaffer.accumulo.TestAccumuloBackedGraphUpdatingConf.java

License:Apache License

@Test
public void testSetConfigurationWithRollUpOff() throws Exception {
    String instanceName = "testSetConfigurationWithRollUpOff";
    AccumuloBackedGraph graph = setUpGraphAndMockAccumulo(instanceName);
    AccumuloConfig accumuloConfig = setUpAccumuloConfig(instanceName);

    graph.rollUpOverTimeAndVisibility(false);
    JobConf conf = new JobConf();
    conf.set("fs.default.name", "file:///");
    conf.set("mapred.job.tracker", "local");
    Pair<TypeValue> pair = new Pair<TypeValue>(new TypeValue("customer", "A"), new TypeValue("product", "P"));
    graph.setConfigurationFromPairs(conf, pair, accumuloConfig);
    FileSystem fs = FileSystem.getLocal(conf);

    // Run//w  ww .  ja v a 2 s. co  m
    Driver driver = new Driver();
    driver.setConf(conf);
    String outputDir = tempFolder.newFolder().getAbsolutePath();
    FileUtils.deleteDirectory(outputDir);

    assertEquals(0, driver.run(new String[] { outputDir }));

    // Read results in
    Set<GraphElementWithStatistics> results = new HashSet<GraphElementWithStatistics>();
    int count = readResults(fs, new Path(outputDir), results);

    // There should be 3 edges
    assertEquals(3, count);
    Set<GraphElementWithStatistics> expectedResults = new HashSet<GraphElementWithStatistics>();
    Edge edge1 = new Edge("customer", "A", "product", "P", "purchase", "instore", true, visibilityString1,
            sevenDaysBefore, sixDaysBefore);
    SetOfStatistics statistics1 = new SetOfStatistics();
    statistics1.addStatistic("count", new Count(1));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge1), statistics1));
    Edge edge2 = new Edge("customer", "A", "product", "P", "purchase", "instore", true, visibilityString1,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics2 = new SetOfStatistics();
    statistics2.addStatistic("count", new Count(19));
    statistics2.addStatistic("anotherCount", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge2), statistics2));
    Edge edge4 = new Edge("customer", "A", "product", "P", "purchase", "instore", false, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics4 = new SetOfStatistics();
    statistics4.addStatistic("countSomething", new Count(123456));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge4), statistics4));

    assertEquals(expectedResults, results);
}

From source file:gaffer.accumulo.TestAccumuloBackedGraphUpdatingConf.java

License:Apache License

@Test
public void testSetConfigurationFullTableScan() throws Exception {
    String instanceName = "testSetConfigurationFullTableScan";
    AccumuloBackedGraph graph = setUpGraphAndMockAccumulo(instanceName);
    AccumuloConfig accumuloConfig = setUpAccumuloConfig(instanceName);

    JobConf conf = new JobConf();
    conf.set("fs.default.name", "file:///");
    conf.set("mapred.job.tracker", "local");
    graph.setConfiguration(conf, accumuloConfig);
    FileSystem fs = FileSystem.getLocal(conf);

    // Run/*from w  w  w.j a  v a 2s.co m*/
    Driver driver = new Driver();
    driver.setConf(conf);
    String outputDir = tempFolder.newFolder().getAbsolutePath();
    FileUtils.deleteDirectory(outputDir);

    assertEquals(0, driver.run(new String[] { outputDir }));

    // Read results in
    Set<GraphElementWithStatistics> results = new HashSet<GraphElementWithStatistics>();
    int count = readResults(fs, new Path(outputDir), results);

    // There should be 3 edges and 2 entities
    assertEquals(5, count);

    Set<GraphElementWithStatistics> expectedResults = new HashSet<GraphElementWithStatistics>();

    // Edge 1 and some statistics for it
    Edge edge1 = new Edge("customer", "A", "product", "P", "purchase", "instore", true, visibilityString1,
            sevenDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics1 = new SetOfStatistics();
    statistics1.addStatistic("count", new Count(20));
    statistics1.addStatistic("anotherCount", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge1), statistics1));
    Edge edge4 = new Edge("customer", "A", "product", "P", "purchase", "instore", false, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics4 = new SetOfStatistics();
    statistics4.addStatistic("countSomething", new Count(123456));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge4), statistics4));
    Edge edge5 = new Edge("customer", "B", "product", "Q", "purchase", "instore", true, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics5 = new SetOfStatistics();
    statistics5.addStatistic("count", new Count(99));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge5), statistics5));
    Entity entity1 = new Entity("customer", "A", "purchase", "count", visibilityString1, sevenDaysBefore,
            sixDaysBefore);
    SetOfStatistics statisticsEntity1 = new SetOfStatistics();
    statisticsEntity1.addStatistic("entity_count", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(entity1), statisticsEntity1));
    Entity entity2 = new Entity("product", "R", "purchase", "count", visibilityString1, sevenDaysBefore,
            sixDaysBefore);
    SetOfStatistics statisticsEntity2 = new SetOfStatistics();
    statisticsEntity2.addStatistic("entity_count", new Count(12345));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(entity2), statisticsEntity2));

    assertEquals(expectedResults, results);
}

From source file:gaffer.accumulo.TestAccumuloBackedGraphUpdatingConf.java

License:Apache License

@Test
public void testSetConfigurationDirectedEdgesOnly() throws Exception {
    String instanceName = "testSetConfigurationDirectedEdgesOnly";
    AccumuloBackedGraph graph = setUpGraphAndMockAccumulo(instanceName);
    AccumuloConfig accumuloConfig = setUpAccumuloConfig(instanceName);

    JobConf conf = new JobConf();
    conf.set("fs.default.name", "file:///");
    conf.set("mapred.job.tracker", "local");
    graph.setDirectedEdgesOnly();//from ww w. jav a  2 s  . c o m
    graph.setConfiguration(conf, accumuloConfig);
    FileSystem fs = FileSystem.getLocal(conf);

    // Run
    Driver driver = new Driver();
    driver.setConf(conf);
    String outputDir = tempFolder.newFolder().getAbsolutePath();
    FileUtils.deleteDirectory(outputDir);

    assertEquals(0, driver.run(new String[] { outputDir }));

    // Read results in
    Set<GraphElementWithStatistics> results = new HashSet<GraphElementWithStatistics>();
    int count = readResults(fs, new Path(outputDir), results);

    // There should be 2 edges and 2 entities
    assertEquals(4, count);

    Set<GraphElementWithStatistics> expectedResults = new HashSet<GraphElementWithStatistics>();

    // Edge 1 and some statistics for it
    Edge edge1 = new Edge("customer", "A", "product", "P", "purchase", "instore", true, visibilityString1,
            sevenDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics1 = new SetOfStatistics();
    statistics1.addStatistic("count", new Count(20));
    statistics1.addStatistic("anotherCount", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge1), statistics1));
    Edge edge5 = new Edge("customer", "B", "product", "Q", "purchase", "instore", true, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics5 = new SetOfStatistics();
    statistics5.addStatistic("count", new Count(99));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge5), statistics5));
    Entity entity1 = new Entity("customer", "A", "purchase", "count", visibilityString1, sevenDaysBefore,
            sixDaysBefore);
    SetOfStatistics statisticsEntity1 = new SetOfStatistics();
    statisticsEntity1.addStatistic("entity_count", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(entity1), statisticsEntity1));
    Entity entity2 = new Entity("product", "R", "purchase", "count", visibilityString1, sevenDaysBefore,
            sixDaysBefore);
    SetOfStatistics statisticsEntity2 = new SetOfStatistics();
    statisticsEntity2.addStatistic("entity_count", new Count(12345));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(entity2), statisticsEntity2));

    assertEquals(expectedResults, results);
}

From source file:gaffer.accumulo.TestAccumuloBackedGraphUpdatingConf.java

License:Apache License

@Test
public void testSetConfigurationUndirectedEdgesOnly() throws Exception {
    String instanceName = "testSetConfigurationUndirectedEdgesOnly";
    AccumuloBackedGraph graph = setUpGraphAndMockAccumulo(instanceName);
    AccumuloConfig accumuloConfig = setUpAccumuloConfig(instanceName);

    JobConf conf = new JobConf();
    conf.set("fs.default.name", "file:///");
    conf.set("mapred.job.tracker", "local");
    graph.setUndirectedEdgesOnly();/*ww w  . j  a v a 2s  . c om*/
    graph.setConfiguration(conf, accumuloConfig);
    FileSystem fs = FileSystem.getLocal(conf);

    // Run
    Driver driver = new Driver();
    driver.setConf(conf);
    String outputDir = tempFolder.newFolder().getAbsolutePath();
    FileUtils.deleteDirectory(outputDir);

    assertEquals(0, driver.run(new String[] { outputDir }));

    // Read results in
    Set<GraphElementWithStatistics> results = new HashSet<GraphElementWithStatistics>();
    int count = readResults(fs, new Path(outputDir), results);

    // There should be 1 edge and 2 entities
    assertEquals(3, count);

    Set<GraphElementWithStatistics> expectedResults = new HashSet<GraphElementWithStatistics>();

    // Edge 4 and some statistics for it
    Edge edge4 = new Edge("customer", "A", "product", "P", "purchase", "instore", false, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics4 = new SetOfStatistics();
    statistics4.addStatistic("countSomething", new Count(123456));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge4), statistics4));
    Entity entity1 = new Entity("customer", "A", "purchase", "count", visibilityString1, sevenDaysBefore,
            sixDaysBefore);
    SetOfStatistics statisticsEntity1 = new SetOfStatistics();
    statisticsEntity1.addStatistic("entity_count", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(entity1), statisticsEntity1));
    Entity entity2 = new Entity("product", "R", "purchase", "count", visibilityString1, sevenDaysBefore,
            sixDaysBefore);
    SetOfStatistics statisticsEntity2 = new SetOfStatistics();
    statisticsEntity2.addStatistic("entity_count", new Count(12345));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(entity2), statisticsEntity2));

    assertEquals(expectedResults, results);
}

From source file:gaffer.accumulo.TestAccumuloBackedGraphUpdatingConf.java

License:Apache License

@Test
public void testSetConfigurationUndirectedEdgesOnlyNoEntities() throws Exception {
    String instanceName = "testSetConfigurationUndirectedEdgesOnlyNoEntities";
    AccumuloBackedGraph graph = setUpGraphAndMockAccumulo(instanceName);
    AccumuloConfig accumuloConfig = setUpAccumuloConfig(instanceName);

    JobConf conf = new JobConf();
    conf.set("fs.default.name", "file:///");
    conf.set("mapred.job.tracker", "local");
    graph.setUndirectedEdgesOnly();/* w w w.  j  a v  a 2  s. c o m*/
    graph.setReturnEdgesOnly();
    graph.setConfiguration(conf, accumuloConfig);
    FileSystem fs = FileSystem.getLocal(conf);

    // Run
    Driver driver = new Driver();
    driver.setConf(conf);
    String outputDir = tempFolder.newFolder().getAbsolutePath();
    FileUtils.deleteDirectory(outputDir);

    assertEquals(0, driver.run(new String[] { outputDir }));

    // Read results in
    Set<GraphElementWithStatistics> results = new HashSet<GraphElementWithStatistics>();
    int count = readResults(fs, new Path(outputDir), results);

    // There should be 1 edge
    assertEquals(1, count);

    Set<GraphElementWithStatistics> expectedResults = new HashSet<GraphElementWithStatistics>();

    // Edge 4 and some statistics for it
    Edge edge4 = new Edge("customer", "A", "product", "P", "purchase", "instore", false, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics4 = new SetOfStatistics();
    statistics4.addStatistic("countSomething", new Count(123456));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge4), statistics4));

    assertEquals(expectedResults, results);
}

From source file:gaffer.accumulo.TestAccumuloBackedGraphUpdatingConf.java

License:Apache License

/**
 * Tests that calling {@link AccumuloBackedGraph#setOutgoingEdgesOnly} doesn't cause any problems
 * with full table scans (where that option should be ignored as there is nothing to be outgoing
 * from)./*from   w  w w.j  av a2s .c o  m*/
 *
 * @throws Exception
 */
@Test
public void testSetConfigurationOutgoingEdgesOnlyFullTable() throws Exception {
    String instanceName = "testSetConfigurationOutgoingEdgesOnlyFullTable";
    AccumuloBackedGraph graph = setUpGraphAndMockAccumulo(instanceName);
    AccumuloConfig accumuloConfig = setUpAccumuloConfig(instanceName);

    JobConf conf = new JobConf();
    conf.set("fs.default.name", "file:///");
    conf.set("mapred.job.tracker", "local");
    graph.setOutgoingEdgesOnly();
    graph.setConfiguration(conf, accumuloConfig);
    FileSystem fs = FileSystem.getLocal(conf);

    // Run
    Driver driver = new Driver();
    driver.setConf(conf);
    String outputDir = tempFolder.newFolder().getAbsolutePath();
    FileUtils.deleteDirectory(outputDir);

    assertEquals(0, driver.run(new String[] { outputDir }));

    // Read results in
    Set<GraphElementWithStatistics> results = new HashSet<GraphElementWithStatistics>();
    int count = readResults(fs, new Path(outputDir), results);

    // There should be 3 edges and 2 entities
    assertEquals(5, count);

    Set<GraphElementWithStatistics> expectedResults = new HashSet<GraphElementWithStatistics>();

    // Edge 1 and some statistics for it
    Edge edge1 = new Edge("customer", "A", "product", "P", "purchase", "instore", true, visibilityString1,
            sevenDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics1 = new SetOfStatistics();
    statistics1.addStatistic("count", new Count(20));
    statistics1.addStatistic("anotherCount", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge1), statistics1));
    Edge edge4 = new Edge("customer", "A", "product", "P", "purchase", "instore", false, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics4 = new SetOfStatistics();
    statistics4.addStatistic("countSomething", new Count(123456));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge4), statistics4));
    Edge edge5 = new Edge("customer", "B", "product", "Q", "purchase", "instore", true, visibilityString2,
            sixDaysBefore, fiveDaysBefore);
    SetOfStatistics statistics5 = new SetOfStatistics();
    statistics5.addStatistic("count", new Count(99));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(edge5), statistics5));
    Entity entity1 = new Entity("customer", "A", "purchase", "count", visibilityString1, sevenDaysBefore,
            sixDaysBefore);
    SetOfStatistics statisticsEntity1 = new SetOfStatistics();
    statisticsEntity1.addStatistic("entity_count", new Count(1000000));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(entity1), statisticsEntity1));
    Entity entity2 = new Entity("product", "R", "purchase", "count", visibilityString1, sevenDaysBefore,
            sixDaysBefore);
    SetOfStatistics statisticsEntity2 = new SetOfStatistics();
    statisticsEntity2.addStatistic("entity_count", new Count(12345));
    expectedResults.add(new GraphElementWithStatistics(new GraphElement(entity2), statisticsEntity2));

    assertEquals(expectedResults, results);
}