This is an automated email from the ASF dual-hosted git repository.
nwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
The following commit(s) were added to refs/heads/master by this push:
new 20a892a Improve the error message (with numbers) for the 'More More
containers allocated than instance' exception (#3244)
20a892a is described below
commit 20a892a3a1e3da373d03f654cb655d53e8fa4518
Author: Ning Wang <[email protected]>
AuthorDate: Wed Apr 24 23:36:27 2019 -0700
Improve the error message (with numbers) for the 'More More containers
allocated than instance' exception (#3244)
---
.../java/org/apache/heron/packing/roundrobin/RoundRobinPacking.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/heron/packing/src/java/org/apache/heron/packing/roundrobin/RoundRobinPacking.java
b/heron/packing/src/java/org/apache/heron/packing/roundrobin/RoundRobinPacking.java
index b28d71f..b02700e 100644
---
a/heron/packing/src/java/org/apache/heron/packing/roundrobin/RoundRobinPacking.java
+++
b/heron/packing/src/java/org/apache/heron/packing/roundrobin/RoundRobinPacking.java
@@ -365,7 +365,9 @@ public class RoundRobinPacking implements IPacking,
IRepacking {
Map<Integer, List<InstanceId>> allocation = new HashMap<>();
int totalInstance = TopologyUtils.getTotalInstance(parallelismMap);
if (numContainer > totalInstance) {
- throw new RuntimeException("More containers allocated than instance.");
+ throw new RuntimeException(
+ String.format("More containers (%d) allocated than instances (%d).",
+ numContainer, totalInstance));
}
for (int i = 1; i <= numContainer; ++i) {