You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nemo.apache.org by GitBox <gi...@apache.org> on 2018/08/31 04:28:30 UTC

[GitHub] wonook commented on a change in pull request #113: [NEMO-15] Run Spark ALS in distributed mode

wonook commented on a change in pull request #113: [NEMO-15] Run Spark ALS in distributed mode
URL: https://github.com/apache/incubator-nemo/pull/113#discussion_r213909693
 
 

 ##########
 File path: runtime/master/src/main/java/edu/snu/nemo/runtime/master/RuntimeMaster.java
 ##########
 @@ -328,6 +331,25 @@ public void onMessage(final ControlMessage.Message message) {
     @Override
     public void onMessageWithContext(final ControlMessage.Message message, final MessageContext messageContext) {
       switch (message.getType()) {
+        case RequestBroadcastVariable:
+          final Serializable tag =
+            SerializationUtils.deserialize(message.getRequestbroadcastVariableMsg().getTag().toByteArray());
+          final Object broadcastVariable = InMasterBroadcastVariables.getBroadcastVariable(tag);
+          if (broadcastVariable == null) {
+            throw new IllegalStateException(tag.toString());
+          }
+          messageContext.reply(
+            ControlMessage.Message.newBuilder()
+              .setId(RuntimeIdManager.generateMessageId())
+              .setListenerId(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID)
+              .setType(ControlMessage.MessageType.InMasterBroadcastVariable)
+              .setBroadcastVariableMsg(ControlMessage.InMasterBroadcastVariableMessage.newBuilder()
+                .setRequestId(message.getId())
+                // TODO #206: Efficient Broadcast Variable Serialization
+                .setVariabe(ByteString.copyFrom(SerializationUtils.serialize((Serializable) broadcastVariable)))
 
 Review comment:
   setVariabe?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services