Ejemplo n.º 1
0
  /** Reads files from src/test/resource/data and inserts into Accumulo single-table schema. */
  public static void ingestSingleSCALE(int SCALE, char version, String baseName, Connector conn)
      throws FileNotFoundException {
    TripleFileWriter tripleFileWriter = new TripleFileWriter(conn);
    File rowFile = getDataFile(String.valueOf(SCALE) + version + "r.txt");
    File colFile = getDataFile(String.valueOf(SCALE) + version + "c.txt");

    // deleteExistingTables
    log.debug("estimated # of nodes in " + baseName + " about to insert: " + (1 << SCALE) * 16);
    long cnt =
        tripleFileWriter.writeTripleFile_Single(rowFile, colFile, null, ",", baseName, true, true);
    log.info("Wrote " + cnt + " edges to single-table with base name " + baseName);
  }
Ejemplo n.º 2
0
  /**
   * Reads files from src/test/resource/data and inserts into Accumulo using D4M Schema
   * table+transpose+degree.
   */
  public static void ingestAdjacencySCALE(int SCALE, char version, String baseName, Connector conn)
      throws FileNotFoundException {
    TripleFileWriter tripleFileWriter = new TripleFileWriter(conn);
    File rowFile = getDataFile(String.valueOf(SCALE) + version + "r.txt");
    File colFile = getDataFile(String.valueOf(SCALE) + version + "c.txt");

    // deleteExistingTables
    long cnt =
        tripleFileWriter.writeTripleFile_Adjacency(
            rowFile, colFile, null, ",", baseName, true, true);
    log.info("Wrote " + cnt + " edges to D4M Adjacency tables with base name " + baseName);
  }
Ejemplo n.º 3
0
  public static void ingestIncidenceFromAdjacencySCALE(
      int SCALE, char version, String baseName, Connector conn) {
    //    D4mDbTableOperations d4mtops = new
    // D4mDbTableOperations(conn.getInstance().getInstanceName(),
    // conn.getInstance().getZooKeepers(),
    //        conn.whoami(), pass );
    TripleFileWriter tripleFileWriter = new TripleFileWriter(conn);

    // deleteExistingTables
    log.debug("estimated # of nodes in " + baseName + " about to insert: " + (1 << SCALE) * 16);
    long cnt =
        tripleFileWriter.writeFromAdjacency_Incidence(
            baseName, true, true, (1 << SCALE) * 16); // upper bound on #edges
    log.info("Wrote " + cnt + " edges to D4M Incidence tables with base name " + baseName);
  }
Ejemplo n.º 4
0
  public static void ingestIncidenceSCALE(
      int SCALE, char version, String baseName, Connector conn) {
    //    D4mDbTableOperations d4mtops = new
    // D4mDbTableOperations(conn.getInstance().getInstanceName(),
    // conn.getInstance().getZooKeepers(),
    //        conn.whoami(), pass );
    TripleFileWriter tripleFileWriter = new TripleFileWriter(conn);
    File rowFile = getDataFile(String.valueOf(SCALE) + version + "r.txt");
    File colFile = getDataFile(String.valueOf(SCALE) + version + "c.txt");

    // deleteExistingTables
    log.debug("estimated # of nodes in " + baseName + " about to insert: " + (1 << SCALE) * 16);
    long cnt =
        tripleFileWriter.writeTripleFile_Incidence(
            rowFile,
            colFile,
            null,
            ",",
            baseName,
            true,
            true,
            (1 << SCALE) * 16); // upper bound on #edges
    log.info("Wrote " + cnt + " edges to D4M Incidence tables with base name " + baseName);
  }