public static Fields getSingleOutputStreamFields(IComponent component) { OutputFieldsGetter getter = new OutputFieldsGetter(); component.declareOutputFields(getter); Map<String, StreamInfo> declaration = getter.getFieldsDeclaration(); if(declaration.size()!=1) { throw new RuntimeException("Trident only supports components that emit a single stream"); } StreamInfo si = declaration.values().iterator().next(); if(si.is_direct()) { throw new RuntimeException("Trident does not support direct streams"); } return new Fields(si.get_output_fields()); }
private ComponentCommon getComponentCommon(String id, IComponent component) { ComponentCommon ret = new ComponentCommon(_commons.get(id)); OutputFieldsGetter getter = new OutputFieldsGetter(); component.declareOutputFields(getter); ret.set_streams(getter.getFieldsDeclaration()); return ret; }
private ComponentCommon getComponentCommon(String id, IComponent component) { ComponentCommon ret = new ComponentCommon(_commons.get(id)); OutputFieldsGetter getter = new OutputFieldsGetter(); component.declareOutputFields(getter); // declare watermark stream for all components getter.declareStream(Common.WATERMARK_STREAM_ID, new Fields("watermark")); ret.set_streams(getter.getFieldsDeclaration()); return ret; }
/** * Verifies that the actual component declares only the given values and nothing else, <b>in order</b>. * * @param fields the given fields. * @return {@code this} assertion object. * @see ObjectEnumerableAssert#containsExactly(Object...) */ public IComponentAssert declareExactly(String... fields) { OutputFieldsDeclarer declarer = mock(OutputFieldsDeclarer.class); actual.declareOutputFields(declarer); ArgumentCaptor<Fields> fieldsCaptor = ArgumentCaptor.forClass(Fields.class); verify(declarer).declare(fieldsCaptor.capture()); assertThat(fieldsCaptor.getValue()).containsExactly(fields); return myself; } }
public static Fields getSingleOutputStreamFields(IComponent component) { OutputFieldsGetter getter = new OutputFieldsGetter(); component.declareOutputFields(getter); Map<String, StreamInfo> declaration = getter.getFieldsDeclaration(); if(declaration.size()!=1) { throw new RuntimeException("Trident only supports components that emit a single stream"); } StreamInfo si = declaration.values().iterator().next(); if(si.is_direct()) { throw new RuntimeException("Trident does not support direct streams"); } return new Fields(si.get_output_fields()); }
public static Fields getSingleOutputStreamFields(IComponent component) { OutputFieldsGetter getter = new OutputFieldsGetter(); component.declareOutputFields(getter); Map<String, StreamInfo> declaration = getter.getFieldsDeclaration(); if(declaration.size()!=1) { throw new RuntimeException("Trident only supports components that emit a single stream"); } StreamInfo si = declaration.values().iterator().next(); if(si.is_direct()) { throw new RuntimeException("Trident does not support direct streams"); } return new Fields(si.get_output_fields()); }
private ComponentCommon getComponentCommon(String id, IComponent component) { ComponentCommon ret = new ComponentCommon(_commons.get(id)); OutputFieldsGetter getter = new OutputFieldsGetter(); component.declareOutputFields(getter); ret.set_streams(getter.getFieldsDeclaration()); return ret; }
private ComponentCommon getComponentCommon(String id, IComponent component) { ComponentCommon ret = new ComponentCommon(_commons.get(id)); OutputFieldsGetter getter = new OutputFieldsGetter(); component.declareOutputFields(getter); ret.set_streams(getter.getFieldsDeclaration()); return ret; }