hama-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward J. Yoon" <edwardy...@apache.org>
Subject Re: Question about HAMA-839, "Support NullWritable in Hama Pipes"
Date Tue, 24 Nov 2015 06:37:59 GMT
Below patch solves the problem. If you have any objections, I'll apply
this patch.


Index: core/src/main/java/org/apache/hama/pipes/protocol/UplinkReader.java
===================================================================
--- core/src/main/java/org/apache/hama/pipes/protocol/UplinkReader.java
(revision 1716034)
+++ core/src/main/java/org/apache/hama/pipes/protocol/UplinkReader.java
(working copy)
@@ -108,7 +108,9 @@
         // MessageType.values()[cmd] may cause NullPointerException (bad
         // command)

-        if (cmd == MessageType.WRITE_KEYVALUE.code &&
isPeerAvailable()) { // INCOMING
+        if (cmd == -1) {
+          continue;
+        } else if (cmd == MessageType.WRITE_KEYVALUE.code &&
isPeerAvailable()) { // INCOMING
           writeKeyValue();
         } else if (cmd == MessageType.READ_KEYVALUE.code &&
isPeerAvailable()) { // OUTGOING
           readKeyValue();




On Tue, Oct 6, 2015 at 1:45 AM, Martin Illecker <martin@illecker.at> wrote:
> Hello,
>
> I’m sorry, this appears to be related to my issue HAMA-839.
>
> I don’t know why this code has been removed but I will investigate it!
>
> Best regards
> Martin
>
>> Am 05.10.2015 um 08:09 schrieb Edward J. Yoon <edwardyoon@apache.org>:
>>
>> Hello,
>>
>> Can someone explain why below code has been removed?
>>
>> Index: core/src/main/java/org/apache/hama/pipes/protocol/UplinkReader.java
>> ===================================================================
>> --- core/src/main/java/org/apache/hama/pipes/protocol/UplinkReader.java
>> (revision 1556897)
>> +++ core/src/main/java/org/apache/hama/pipes/protocol/UplinkReader.java
>> (working copy)
>>
>> @@ -99,10 +104,9 @@
>>         }
>>
>>         int cmd = readCommand();
>> -        if (cmd == -1) {
>> -          continue;
>> -        }
>> -        LOG.debug("Handling uplink command: " + MessageType.values()[cmd]);
>> +        LOG.debug("Handling uplink command: " + cmd);
>> +        // MessageType.values()[cmd] may cause NullPointerException (bad
>> +        // command)
>>
>>
>> --
>> Best Regards, Edward J. Yoon
>



-- 
Best Regards, Edward J. Yoon

Mime
View raw message