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

ASF GitHub Bot logged work on GOBBLIN-1673:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Sep/22 22:36
            Start Date: 07/Sep/22 22:36
    Worklog Time Spent: 10m 
      Work Description: homatthew commented on code in PR #3539:
URL: https://github.com/apache/gobblin/pull/3539#discussion_r965353884


##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/messaging/MessageBuffer.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+package org.apache.gobblin.runtime.messaging;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Unidirectional buffer for sending messages from a container to another 
container listening to the buffer.
+ * Example use case is for sending messages from taskrunner -> AM. If messages 
need to be
+ * sent bi-directionally, use multiple message buffers with different channels
+ *
+ * This interface provides the following:
+ * <ul>
+ *   <li>No guaranteed order delivery</li>
+ *   <li>Single reader</li>
+ *   <li>Multiple concurrent writers</li>
+ *   <li>Messages delivered at most once</li>
+ * </ul>
+ */
+public interface MessageBuffer<T> {
+  /**
+   * Channel name for the message buffer. If a message is published to a 
channel on one container, another
+   * container should be
+   * @return
+   */
+  String getChannelName();
+
+  /**
+   * Publish item to message buffer
+   * @param item
+   * @return item successfully added to buffer
+   * @throws IOException if unable to add message to buffer
+   */
+  void publish(T item) throws IOException;
+
+  /**
+   * Give callback {@link Consumer} object for processing all published {@link 
T}. It is safe to subscribe multiple
+   * consumer objects but only one container reading from a {@link 
MessageBuffer}
+   * @throws IOException if unable to fetch messages from buffer
+   */
+  void subscribe(Consumer<T> consumer) throws IOException;

Review Comment:
   Doesn't throw IO Exception anymore





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

            Worklog Id:     (was: 806846)
    Remaining Estimate: 69.5h  (was: 69h 40m)
            Time Spent: 2.5h  (was: 2h 20m)

> [Helix Dynamic Workunit] Message Schema for splitting workuntis
> ---------------------------------------------------------------
>
>                 Key: GOBBLIN-1673
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1673
>             Project: Apache Gobblin
>          Issue Type: New Feature
>          Components: gobblin-helix
>            Reporter: Matthew Ho
>            Assignee: Abhishek Tiwari
>            Priority: Major
>   Original Estimate: 72h
>          Time Spent: 2.5h
>  Remaining Estimate: 69.5h
>
> For the Helix Dynamic Workunits, task runners will produce messages 
> indicating the current workunit health and the application master will 
> consume these messages.
> A message will be sent from the task runner to the AM when the task runner 
> experiences lag during ingestion. This ticket is the schema proposal for this 
> message.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to