Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-19252

Move the transform logic of FilterList into transformCell() method to avoid extra ref to question cell

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-beta-1, 2.0.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      As Anoop Sam John and I discussed, we can implement the filterKeyValue () and transformCell() methods as following to avoid saving transformedCell & referenceCell state in FilterList, and we can avoid the costly cell clone.

      ReturnCode filterKeyValue(Cell c){
      	ReturnCode rc = null;
      	for(Filter filter: sub-filters){
      	    // ...
      	    rc = mergeReturnCode(rc, filter.filterKeyValue(c));
      	    // ... 
      	}
      	return rc;
      }
      
      Cell transformCell(Cell c) throws IOException {
      	Cell transformed = c; 
      	for(Filter filter: sub-filters){
      		if(filter.filterKeyValue(c) is INCLUDE*) {     //  ----> line#1
      			transformed = filter.transformCell(transformed);		
      		}
      	}
      	return transformed; 
      }
      

      For line #1, we need to remember the return code of the sub-filter for its filterKeyValue(). because only INCLUDE* ReturnCode, we need to transformCell for sub-filter.

      A new boolean array will be introduced in FilterList. and the cost of maintaining the boolean array will be less than the cost of maintaining the two ref of question cell.

        Attachments

        1. HBASE-19252.v1.patch
          15 kB
          Zheng Hu
        2. HBASE-19252.v2.patch
          15 kB
          Zheng Hu
        3. HBASE-19252.v3.patch
          15 kB
          Zheng Hu
        4. HBASE-19252.v4.patch
          15 kB
          Zheng Hu
        5. HBASE-19252-branch-1.4.v1.patch
          15 kB
          Zheng Hu
        6. HBASE-19252-branch-1.4.v1.patch
          15 kB
          Zheng Hu
        7. HBASE-19252-branch-1.4.v1.patch
          15 kB
          Zheng Hu

        Issue Links

          Activity

            People

            • Assignee:
              openinx Zheng Hu
              Reporter:
              openinx Zheng Hu

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment