@Test public void testGetCardinality() { CubeDesc cube = getTestKylinCubeWithSeller(); CuboidScheduler scheduler = new CuboidScheduler(cube); assertEquals(0, scheduler.getCardinality(0)); assertEquals(7, scheduler.getCardinality(127)); assertEquals(1, scheduler.getCardinality(1)); assertEquals(1, scheduler.getCardinality(8)); assertEquals(6, scheduler.getCardinality(126)); }
public int getCardinality(long cuboid) { if (cuboid > max || cuboid < 0) { throw new IllegalArgumentException("Cubiod " + cuboid + " is out of scope 0-" + max); } return Long.bitCount(cuboid); }
CuboidScheduler { public int getCardinality(long cuboid) { if (cuboid > max || cuboid < 0) { throw new IllegalArgumentException("Cubiod " + cuboid + " is out of scope 0-" + max); } return Long.bitCount(cuboid); } }
CuboidScheduler { public int getCardinality(long cuboid) { if (cuboid > max || cuboid < 0) { throw new IllegalArgumentException("Cubiod " + cuboid + " is out of scope 0-" + max); } return Long.bitCount(cuboid); } CuboidScheduler(CubeDesc cube); }
CuboidScheduler { public int getCardinality(long cuboid) { if (cuboid > max || cuboid < 0) { throw new IllegalArgumentException("Cubiod " + cuboid + " is out of scope 0-" + max); } return Long.bitCount(cuboid); } CuboidScheduler(CubeDesc cube); Collection<Long> getSpanningCuboid(long cuboid); Collection<Long> findSmallerSibling(long cuboid); int getCardinality(long cuboid); }
CuboidScheduler { public int getCardinality(long cuboid) { if (cuboid > max || cuboid < 0) { throw new IllegalArgumentException("Cubiod " + cuboid + " is out of scope 0-" + max); } return Long.bitCount(cuboid); } CuboidScheduler(CubeDesc cube); Collection<Long> getSpanningCuboid(long cuboid); Collection<Long> findSmallerSibling(long cuboid); int getCardinality(long cuboid);  }