private CuboidResult buildCuboid(CuboidResult parent, long cuboidId) throws IOException { final String consumerName = "AggrCache@Cuboid " + cuboidId; MemoryBudgetController.MemoryConsumer consumer = new MemoryBudgetController.MemoryConsumer() { @Override public int freeUp(int mb) { return 0; // cannot free up on demand } @Override public String toString() { return consumerName; } }; // reserve memory for aggregation cache, can't be larger than the parent memBudget.reserveInsist(consumer, parent.aggrCacheMB); try { return aggregateCuboid(parent, cuboidId); } finally { memBudget.reserve(consumer, 0); } }
private CuboidResult buildCuboid(CuboidResult parent, long cuboidId) throws IOException { final String consumerName = "AggrCache@Cuboid " + cuboidId; MemoryBudgetController.MemoryConsumer consumer = new MemoryBudgetController.MemoryConsumer() { @Override public int freeUp(int mb) { return 0; // cannot free up on demand } @Override public String toString() { return consumerName; } }; // reserve memory for aggregation cache, can't be larger than the parent memBudget.reserveInsist(consumer, parent.aggrCacheMB); try { return aggregateCuboid(parent, cuboidId); } finally { memBudget.reserve(consumer, 0); } }
mbc.reserveInsist(b, n); assertTrue(System.currentTimeMillis() - bWaitStart > 1000);
private CuboidResult buildCuboid(CuboidResult parent, long cuboidId) throws IOException { final String consumerName = "AggrCache@Cuboid " + cuboidId; MemoryBudgetController.MemoryConsumer consumer = new MemoryBudgetController.MemoryConsumer() { @Override public int freeUp(int mb) { return 0; // cannot free up on demand } @Override public String toString() { return consumerName; } }; // reserve memory for aggregation cache, can't be larger than the parent memBudget.reserveInsist(consumer, parent.aggrCacheMB); try { return aggregateCuboid(parent, cuboidId); } finally { memBudget.reserve(consumer, 0); } }
private CuboidResult buildCuboid(CuboidResult parent, long cuboidId) throws IOException { final String consumerName = "AggrCache@Cuboid " + cuboidId; MemoryBudgetController.MemoryConsumer consumer = new MemoryBudgetController.MemoryConsumer() { @Override public int freeUp(int mb) { return 0; // cannot free up on demand } @Override public String toString() { return consumerName; } }; // reserve memory for aggregation cache, can't be larger than the parent memBudget.reserveInsist(consumer, parent.aggrCacheMB); try { return aggregateCuboid(parent, cuboidId); } finally { memBudget.reserve(consumer, 0); } }