You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/08/10 08:56:20 UTC

[jira] [Commented] (CARBONDATA-155) Code refactor to avoid the Type Casting in compareTo method

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

ASF GitHub Bot commented on CARBONDATA-155:
-------------------------------------------

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

    https://github.com/apache/incubator-carbondata/pull/56#discussion_r74208162
  
    --- Diff: core/src/main/java/org/carbondata/core/carbon/datastore/block/TableBlockInfo.java ---
    @@ -185,6 +207,16 @@ public long getBlockLength() {
             > ((TableBlockInfo) other).blockOffset + ((TableBlockInfo) other).blockLength) {
           return 1;
         }
    +    //compare the startBlockLetNumber
    +    int diffStartBlockLetNumber =
    +        blockletInfos.getStartBlockletNumber() - ((TableBlockInfo) other).blockletInfos
    --- End diff --
    
    comment will be taken care in jirra [CARBONDATA-155](https://issues.apache.org/jira/browse/CARBONDATA-155) 


> Code refactor to avoid the Type Casting in compareTo method
> -----------------------------------------------------------
>
>                 Key: CARBONDATA-155
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-155
>             Project: CarbonData
>          Issue Type: Bug
>            Reporter: Mohammad Shahid Khan
>
> PraveenAdlakha added a note 23 hours ago
> Hi ,
> Would like to suggest a couple of things here remove Comparable from the class definition as Distributable is already implementing it.
> Let use generics so that we donot have to typeCast everywhere in the compare method for that need to do two things:
> 1) Change the class definition of Distributable to :
> public abstract class Distributable> implements Comparable
> 2) Change the compareTo method definition to:
> public int compareTo(TableBlockInfo other)
> Let me know incase you are facing any isssue in doing this I will provide the patch if needed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)