コード例 #1
0
  static {
    long time = System.currentTimeMillis();
    ISubgraphTemplate graph = GoogleGraphLoader.constructGoogleGraph();
    System.out.println("graph load: " + (System.currentTimeMillis() - time) / 1000.0);

    time = System.currentTimeMillis();
    _partition =
        new BasePartition(
            1,
            graph,
            PropertySet.EmptyPropertySet,
            PropertySet.EmptyPropertySet,
            Long2IntMaps.EMPTY_MAP,
            new TestSubgraphFactory());
    System.out.println("graph partitioning: " + (System.currentTimeMillis() - time) / 1000.0);
  }
コード例 #2
0
  public void doSerializationRoundtrip(String serializationType, SliceManager sliceManager)
      throws IOException {
    long time = System.currentTimeMillis();
    long bytes = sliceManager.writePartition(_partition);
    System.out.println(
        serializationType
            + " serialization: "
            + (System.currentTimeMillis() - time) / 1000.0
            + "s , "
            + bytes / 1000.0
            + "kb");

    time = System.currentTimeMillis();
    IPartition actualPartition = sliceManager.readPartition();
    System.out.println(
        serializationType
            + " deserialization: "
            + (System.currentTimeMillis() - time) / 1000.0
            + "s");

    assertEquals(_partition, actualPartition);

    sliceManager.deletePartition();
  }