- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {SimpleDateFormat s =
String pattern;new SimpleDateFormat(pattern)
String template;Locale locale;new SimpleDateFormat(template, locale)
new SimpleDateFormat()
- Smart code suggestions by Codota
}
/** * Execute a sequence of calls on HdfsSpout. * * @param cmds: set of commands to run, e.g. "r,r,r,r,a1,f2,...". The commands are: r[N] - receive() called N times aN - ack, item * number: N fN - fail, item number: N */ private List<String> runSpout(HdfsSpout spout, String... cmds) { MockCollector collector = (MockCollector) spout.getCollector(); for (String cmd : cmds) { if (cmd.startsWith("r")) { int count = 1; if (cmd.length() > 1) { count = Integer.parseInt(cmd.substring(1)); } for (int i = 0; i < count; ++i) { spout.nextTuple(); } } else if (cmd.startsWith("a")) { int n = Integer.parseInt(cmd.substring(1)); Pair<HdfsSpout.MessageId, List<Object>> item = collector.items.get(n); spout.ack(item.getKey()); } else if (cmd.startsWith("f")) { int n = Integer.parseInt(cmd.substring(1)); Pair<HdfsSpout.MessageId, List<Object>> item = collector.items.get(n); spout.fail(item.getKey()); } } return collector.lines; }