/** * Assigns a new {@link org.streampipes.model.grounding.TransportFormat} to the stream definition. * @param format The transport format of the stream at runtime (e.g., JSON or Thrift). Use * {@link org.streampipes.sdk.helpers.Formats} to use some pre-defined formats (or create a new format as * described in the developer guide). * @return this */ public DataStreamBuilder format(TransportFormat format) { this.eventGrounding.setTransportFormats(Collections.singletonList(format)); return this; }
public DataSetBuilder supportedFormat(TransportFormat format) { this.supportedGrounding.setTransportFormats(Collections.singletonList(format)); return this; }
/** * Assigns supported transport formats to the pipeline elements that can be handled at runtime (e.g., * JSON or XMl). * @param formats A list of supported {@link org.streampipes.model.grounding.TransportFormat}s. Use * {@link org.streampipes.sdk.helpers.SupportedFormats} to assign formats from some pre-defined * ones or create your own by following the developer guide. * @return this */ public BU supportedFormats(List<TransportFormat> formats) { this.supportedGrounding.setTransportFormats(formats); return me(); }
public EventGrounding getEventGrounding() { EventGrounding grounding = new EventGrounding(); grounding.setTransportFormats(Arrays.asList(getFormat())); grounding.setTransportProtocols(Arrays.asList(getProtocol())); return grounding; }
public EventGrounding getEventGrounding() { EventGrounding grounding = new EventGrounding(); grounding.setTransportFormats(Arrays.asList(getFormat())); grounding.setTransportProtocols(Arrays.asList(getProtocol())); return grounding; }
public static EventGrounding makeDummyGrounding() { EventGrounding grounding = new EventGrounding(); grounding.setTransportFormats(Arrays.asList(new TransportFormat())); grounding.setTransportProtocol(ProtocolGenerator.makeDummyProtocol()); return grounding; } }
public static EventGrounding getSupportedGrounding() { EventGrounding grounding = new EventGrounding(); grounding.setTransportFormats(standardFormat()); grounding.setTransportProtocols(standardProtocols()); return grounding; } }
public DataSetModificationMessage selectGrounding() { // TODO grounding negotiation TransportProtocol protocol = new KafkaTransportProtocol(BackendConfig.INSTANCE.getKafkaHost(), BackendConfig.INSTANCE.getKafkaPort(), TopicGenerator.generateRandomTopic(), BackendConfig.INSTANCE.getZookeeperHost(), BackendConfig.INSTANCE.getZookeeperPort()); TransportFormat format = spDataSet.getSupportedGrounding().getTransportFormats().get(0); EventGrounding outputGrounding = new EventGrounding(); outputGrounding.setTransportProtocol(protocol); outputGrounding.setTransportFormats(Arrays.asList(format)); return new DataSetModificationMessage(outputGrounding,RandomStringUtils.randomAlphanumeric(10)); } }
public DataSetModificationMessage selectGrounding() { // TODO grounding negotiation TransportProtocol protocol = new KafkaTransportProtocol(BackendConfig.INSTANCE.getKafkaHost(), BackendConfig.INSTANCE.getKafkaPort(), TopicGenerator.generateRandomTopic(), BackendConfig.INSTANCE.getZookeeperHost(), BackendConfig.INSTANCE.getZookeeperPort()); TransportFormat format = spDataSet.getSupportedGrounding().getTransportFormats().get(0); EventGrounding outputGrounding = new EventGrounding(); outputGrounding.setTransportProtocol(protocol); outputGrounding.setTransportFormats(Arrays.asList(format)); return new DataSetModificationMessage(outputGrounding,RandomStringUtils.randomAlphanumeric(10)); } }
EventGrounding eg = new EventGrounding(); eg.setTransportProtocol(SupportedProtocols.kafka()); eg.setTransportFormats(Arrays.asList(SupportedFormats.jsonFormat())); ((SpDataSet) ds).setSupportedGrounding(eg); } else { eg.setTransportFormats(Arrays.asList(Formats.jsonFormat())); eg.setTransportProtocol(tp);