Differential D6167 Diff 22342 java/src/main/java/org/softwareheritage/graph/experiments/topology/ConnectedComponents.java
Changeset View
Changeset View
Standalone View
Standalone View
java/src/main/java/org/softwareheritage/graph/experiments/topology/ConnectedComponents.java
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | private static JSAPResult parse_args(String[] args) { | ||||
System.exit(1); | System.exit(1); | ||||
} | } | ||||
} catch (JSAPException e) { | } catch (JSAPException e) { | ||||
e.printStackTrace(); | e.printStackTrace(); | ||||
} | } | ||||
return config; | return config; | ||||
} | } | ||||
private HashMap<Long, Long> /* ArrayList<ArrayList<Long>> */ compute(ProgressLogger pl, boolean byOrigin) throws IOException { | private HashMap<Long, Long> /* ArrayList<ArrayList<Long>> */ compute(ProgressLogger pl, boolean byOrigin) | ||||
throws IOException { | |||||
final long n = graph.numNodes(); | final long n = graph.numNodes(); | ||||
final long maxN = graph.maxNodeNumber(); | final long maxN = graph.maxNodeNumber(); | ||||
// Allow enough memory to behave like in-memory queue | // Allow enough memory to behave like in-memory queue | ||||
int bufferSize = (int) Math.min(Arrays.MAX_ARRAY_SIZE & ~0x7, 8L * maxN); | int bufferSize = (int) Math.min(Arrays.MAX_ARRAY_SIZE & ~0x7, 8L * maxN); | ||||
// Use a disk based queue to store BFS frontier | // Use a disk based queue to store BFS frontier | ||||
final File queueFile = File.createTempFile(ConnectedComponents.class.getSimpleName(), "queue"); | final File queueFile = File.createTempFile(ConnectedComponents.class.getSimpleName(), "queue"); | ||||
▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines |