mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 00:29:38 +08:00
[Streaming] Support streaming flow control (#7152)
* streaming writer use event driven model. * add RefreshChannelInfo * fix name * minor changes according reviewer comments * Fix according to reviewer's comments * fix bazel lint * code polished * Add more comments * rename Stop & Start of EventQueue to Freeze and Unfreeze. * add override * fix * fix return value * support flow control * add flow control ut in mock transfer * minor changes according to comments * add java and python worker adaption Co-authored-by: wanxing <wanxing.wwx@alibaba-inc.com>
This commit is contained in:
@@ -40,5 +40,10 @@ public class Config {
|
||||
// operator type
|
||||
public static final String OPERATOR_TYPE = "operator_type";
|
||||
|
||||
// flow control
|
||||
public static final String FLOW_CONTROL_TYPE = "streaming.flow_control_type";
|
||||
public static final String WRITER_CONSUMED_STEP = "streaming.writer.consumed_step";
|
||||
public static final String READER_CONSUMED_STEP = "streaming.reader.consumed_step";
|
||||
|
||||
|
||||
}
|
||||
|
||||
+13
@@ -31,6 +31,19 @@ public class ChannelUtils {
|
||||
builder.setEmptyMessageInterval(
|
||||
Integer.parseInt(conf.get(Config.STREAMING_EMPTY_MESSAGE_INTERVAL)));
|
||||
}
|
||||
if (conf.containsKey(Config.FLOW_CONTROL_TYPE)) {
|
||||
builder.setFlowControlType(
|
||||
Streaming.FlowControlType.forNumber(
|
||||
Integer.parseInt(conf.get(Config.FLOW_CONTROL_TYPE))));
|
||||
}
|
||||
if (conf.containsKey(Config.WRITER_CONSUMED_STEP)) {
|
||||
builder.setWriterConsumedStep(
|
||||
Integer.parseInt(conf.get(Config.WRITER_CONSUMED_STEP)));
|
||||
}
|
||||
if (conf.containsKey(Config.READER_CONSUMED_STEP)) {
|
||||
builder.setReaderConsumedStep(
|
||||
Integer.parseInt(conf.get(Config.READER_CONSUMED_STEP)));
|
||||
}
|
||||
Streaming.StreamingConfig streamingConf = builder.build();
|
||||
LOGGER.info("Streaming native conf {}", streamingConf.toString());
|
||||
return streamingConf.toByteArray();
|
||||
|
||||
Reference in New Issue
Block a user