[ 
https://issues.apache.org/jira/browse/BEAM-8335?focusedWorklogId=332228&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-332228
 ]

ASF GitHub Bot logged work on BEAM-8335:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Oct/19 21:18
            Start Date: 22/Oct/19 21:18
    Worklog Time Spent: 10m 
      Work Description: davidyan74 commented on pull request #9720: [BEAM-8335] 
Add initial modules for interactive streaming support
URL: https://github.com/apache/beam/pull/9720#discussion_r337754649
 
 

 ##########
 File path: model/interactive/src/main/proto/beam_interactive_api.proto
 ##########
 @@ -0,0 +1,178 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Protocol Buffers describing a service that can be used in conjunction with
+ * the TestStream class in order to control a pipeline remotely.
+ */
+
+syntax = "proto3";
+
+package org.apache.beam.model.interactive.v1;
+
+option go_package = "interactive_v1";
+option java_package = "org.apache.beam.model.interactive.v1";
+option java_outer_classname = "BeamInteractiveApi";
+
+import "beam_runner_api.proto";
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/duration.proto";
+
+
+service InteractiveService {
+  // A TestStream will request for events using this RPC.
+  rpc Events(EventsRequest) returns (stream EventsResponse) {}
+
+  // Starts the stream of events to the EventsRequest. It is also allowed for
+  // setting the playback_speed while RUNNING. If the stream is paused, this
+  // will unpause the stream at the specified playback speed.
+  rpc Start (StartRequest) returns (StartResponse) {}
+
+  // Advances the stream to the specified offset then pauses the stream. This
+  // starts the stream if it is not RUNNING then pauses the stream when the
+  // offset is reached.
+  rpc Advance (AdvanceRequest) returns (AdvanceResponse) {}
+
+  // Stops and resets the stream to the beginning.
+  rpc Stop (StopRequest) returns (StopResponse) {}
+
+  // Pauses the stream of events to the EventsRequest. If there is already an
+  // outstanding EventsRequest streaming events, then the stream will pause
+  // after the EventsResponse is completed.
+  // To un-pause, send either a Start or Advance request.
+  rpc Pause (PauseRequest) returns (PauseResponse) {}
+
+  // Sends a single element to the EventsRequest then pauses the stream.
+  rpc Step (StepRequest) returns (StepResponse) {}
+
+  // Responds with debugging and other cache-specific metadata.
+  rpc Status (StatusRequest) returns (StatusResponse) {}
+}
+
+// The state of the InteractiveService. The default state is STOPPED.
+enum State {
+  // The InteractiveService is not replaying. Goes to RUNNING with a
+  // StartRequest.
+  STOPPED = 0;
+
+  // The InteractiveService is replaying events. Goes to PAUSED with a
+  // PauseRequest. Goes to STOPPED with a StopRequest.
+  RUNNING = 1;
+
+  // The InteractiveService is paused from replaying events. Goes to RUNNING
+  // with either a StartRequest or a StepRequest. Goes to STOPPED with a
+  // StopRequest.
+  PAUSED = 2;
+
+  // The InteractiveService is stepping through a single event. Will move to
+  // PAUSED after quiescence.
+  STEPPING = 3;
+
+
+  // The InteractiveService is advancing until a specified duration is reached.
+  // Will move to PAUSED after the stream advances sufficiently.
+  ADVANCING = 4;
+}
+
+message StartRequest {
+  // (Optional) How quickly the stream will be played back, e.g. if
+  // playback_speed == 2, then the stream will replay events twice as fast as
+  // they were recorded. If unspecified, this will default to 1.
+  double playback_speed = 1;
+}
+message StartResponse { }
+
+message AdvanceRequest {
+  // (Required) Will advance the stream by replaying events as quickly as
+  // possible until the stream timestamp has advanced by the specified amount.
+  google.protobuf.Duration advance_by = 1;
+}
+message AdvanceResponse {}
+
+message StopRequest { }
+message StopResponse { }
+
+message PauseRequest { }
+message PauseResponse {
+  // The current timestamp of the replay stream.
+  google.protobuf.Timestamp stream_time = 1;
+
+  // The minimum watermark across all of the faked replayable unbounded 
sources.
+  google.protobuf.Timestamp watermark = 2;
+}
+
+message StatusRequest { }
+message StatusResponse {
+  // The current timestamp of the replay stream. Is MIN_TIMESTAMP when state
+  // is STOPPED.
+  google.protobuf.Timestamp stream_time = 1;
+
+  // The minimum watermark across all of the faked replayable unbounded 
sources.
+  // Is MIN_TIMESTAMP when state is STOPPED.
+  google.protobuf.Timestamp watermark = 2;
+
+  // The latest timestamp of the recording stream. Is MIN_TIMESTAMP if there is
+  // no recording.
+  google.protobuf.Timestamp recording_time = 3;
+
+  // The set playback_speed from the StartRequest. Playback speed is set by
+  // StartRequest, or if the stream_time is the current time and the recording
+  // is still happening, the playback speed is 1, else 0.
+  double playback_speed = 4;
+
+  // The state of the InteractiveService. The default state is STOPPED.
+  State state = 5;
+}
+
+message StepRequest {
+  // (Optional) The count of events to stream. If unspecified, the default is
+  // 1, i.e. only read a single element from any source and send it through
+  // the pipeline.
+  int64 count = 1;
+}
+message StepResponse { }
 
 Review comment:
   Should this also return stream_time and watermark?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 332228)
    Time Spent: 10h 20m  (was: 10h 10m)

> Add streaming support to Interactive Beam
> -----------------------------------------
>
>                 Key: BEAM-8335
>                 URL: https://issues.apache.org/jira/browse/BEAM-8335
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-py-interactive
>            Reporter: Sam Rohde
>            Assignee: Sam Rohde
>            Priority: Major
>          Time Spent: 10h 20m
>  Remaining Estimate: 0h
>
> This issue tracks the work items to introduce streaming support to the 
> Interactive Beam experience. This will allow users to:
>  * Write and run a streaming job in IPython
>  * Automatically cache records from unbounded sources
>  * Add a replay experience that replays all cached records to simulate the 
> original pipeline execution
>  * Add controls to play/pause/stop/step individual elements from the cached 
> records
>  * Add ability to inspect/visualize unbounded PCollections



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to