beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [5/7] beam git commit: Flesh out TimerSpec and StateSpec in Runner API
Date Fri, 26 May 2017 17:47:48 GMT
Flesh out TimerSpec and StateSpec in Runner API


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/9497e5ea
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/9497e5ea
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/9497e5ea

Branch: refs/heads/master
Commit: 9497e5eaecf5d7eb7f18709935c183b03116f75f
Parents: b0dc523
Author: Kenneth Knowles <klk@google.com>
Authored: Thu May 25 07:12:08 2017 -0700
Committer: Kenneth Knowles <klk@google.com>
Committed: Fri May 26 10:22:37 2017 -0700

----------------------------------------------------------------------
 .../src/main/proto/beam_runner_api.proto        | 40 ++++++++++++++------
 1 file changed, 29 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/9497e5ea/sdks/common/runner-api/src/main/proto/beam_runner_api.proto
----------------------------------------------------------------------
diff --git a/sdks/common/runner-api/src/main/proto/beam_runner_api.proto b/sdks/common/runner-api/src/main/proto/beam_runner_api.proto
index c8722e6..1612209 100644
--- a/sdks/common/runner-api/src/main/proto/beam_runner_api.proto
+++ b/sdks/common/runner-api/src/main/proto/beam_runner_api.proto
@@ -247,21 +247,39 @@ message Parameter {
 }
 
 message StateSpec {
-  // TODO: AST for state spec
-  string id = 1;
-  Type type = 2;
-
-  enum Type {
-    VALUE = 0;
-    BAG = 1;
-    MAP = 2;
-    SET = 3;
+  oneof spec {
+    ValueStateSpec value_spec = 1;
+    BagStateSpec bag_spec = 2;
+    CombiningStateSpec combining_spec = 3;
+    MapStateSpec map_spec = 4;
+    SetStateSpec set_spec = 5;
   }
 }
 
+message ValueStateSpec {
+  string coder_id = 1;
+}
+
+message BagStateSpec {
+  string element_coder_id = 1;
+}
+
+message CombiningStateSpec {
+  string accumulator_coder_id = 1;
+  SdkFunctionSpec combine_fn = 2;
+}
+
+message MapStateSpec {
+  string key_coder_id = 1;
+  string value_coder_id = 2;
+}
+
+message SetStateSpec {
+  string element_coder_id = 1;
+}
+
 message TimerSpec {
-  // TODO: AST for timer spec
-  string id = 1;
+  TimeDomain time_domain = 1;
 }
 
 enum IsBounded {


Mime
View raw message