Skip to content

JoinBolt didn't deal with buffer==null #51

@zqhxuyuan

Description

@zqhxuyuan

I see the logic of cacheWindow(buffersForRule) and window(buffer) is different between AggregatorBolt, SortBolt and JoinBolt. In JoinBolt ,there are non processing in situation① below (Line 176):

  if (buffersForRule != null) {
        buffer = buffersForRule.getIfPresent(flowInfo.getPartition());
        if (buffer != null) {    // if we have a buffer already, process it
              if(op.getEvictionPolicy() == Policy.TIME)
                    buffer.timeEvict(op.getEvictionThreshold());
        }
       //Here no else ....  ①
 } else {
       //new buffersForRule and buildWindow, then put to buffer and buffersForRule...
 }

but in Agg and Sort there both has this logic:

                if (cacheWindow != null) { 
                    window = cacheWindow.getIfPresent(flowInfo.getPartition());
                    if (window != null) {    // if we have a buffer already, process it
                        if (op.getEvictionPolicy() == Policy.TIME)
                            window.timeEvict(op.getEvictionThreshold());
                    } else {
                        //....
                    }
                } else {
                    //....
                }

Can u explain why here does't need?
As I understand, different partition should given different window/buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions