RegularDegreeEdgePool extends AbstractRegularDegreeEdgePool { public RegularDegreeEdgePool(int expectedNumNodes, int maxDegree, StatsReceiver statsReceiver) { super(expectedNumNodes, maxDegree, statsReceiver); IntToIntPairHashMap intToIntPairHashMap; if (maxDegree == 2) { intToIntPairHashMap = new IntToIntPairArrayIndexBasedMap(expectedNumNodes, -1, scopedStatsReceiver); } else { intToIntPairHashMap = new IntToIntPairConcurrentHashMap(expectedNumNodes, 0.5, -1, scopedStatsReceiver); } readerAccessibleInfo = new ReaderAccessibleInfo( new ShardedBigIntArray(expectedNumNodes, maxDegree, 0, scopedStatsReceiver), intToIntPairHashMap ); } RegularDegreeEdgePool(int expectedNumNodes, int maxDegree, StatsReceiver statsReceiver); @Override void addEdge(int nodeA, int nodeB); @Override void addEdge(int nodeA, int nodeB, long metadata); @Override long[] getMetadataShard(int node);  }
@Test public void testRegularDegreeEdgePool() throws Exception { int maxNumNodes = 4; int maxDegree = 3; RegularDegreeEdgePool regularDegreeEdgePool = new RegularDegreeEdgePool(maxNumNodes, maxDegree, new NullStatsReceiver()); for (int i = 0; i < 3; i++) { addEdgesToPool(regularDegreeEdgePool); testAndResetPool(regularDegreeEdgePool, true, 0.00762939453125); } }