giraph-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GIRAPH-1163) Changes to support sending exceptions over thrift calls.
Date Wed, 11 Oct 2017 20:03:00 GMT

    [ https://issues.apache.org/jira/browse/GIRAPH-1163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16200862#comment-16200862
] 

ASF GitHub Bot commented on GIRAPH-1163:
----------------------------------------

Github user majakabiljo commented on a diff in the pull request:

    https://github.com/apache/giraph/pull/52#discussion_r144119650
  
    --- Diff: giraph-core/src/main/java/org/apache/giraph/writable/kryo/KryoWritableWrapper.java
---
    @@ -120,4 +126,50 @@ public static Writable wrapIfNeeded(Object object) {
       public static <T> T wrapAndCopy(T object) {
         return WritableUtils.createCopy(new KryoWritableWrapper<>(object)).get();
       }
    +
    +  /**
    +   * Try converting the object to byte array.
    +   * @param object Object
    +   * @param <T> Type
    +   * @return byte array
    +   */
    +  public static <T> byte [] tryConvertToByteArray(T object) {
    +    byte [] arr = null;
    +    try {
    +      KryoWritableWrapper<T> wrapper =
    +              new KryoWritableWrapper<>(object);
    +      arr = WritableUtils.toByteArrayUnsafe(wrapper);
    +      // Checkstyle exception due to unsafe conversion
    +      // CHECKSTYLE: stop IllegalCatch
    +    } catch (Exception e) {
    --- End diff --
    
    Is there some exception you saw because of which you are putting this, or just as safety?
(if latter, it might be better not to do it in these utility methods but from place where
you call them)


> Changes to support sending exceptions over thrift calls.
> --------------------------------------------------------
>
>                 Key: GIRAPH-1163
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-1163
>             Project: Giraph
>          Issue Type: Bug
>            Reporter: Yuksel Akinci
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message