@Synchronized
    public SegmentOutputStream getSegmentOutputStreamForKey(String routingKey) {
        if (currentSegments == null) {
            return null;
        }
        return writers.get(getSegmentForEvent(routingKey));
    }
@ Synchronized public SegmentOutputStream getSegmentOutputStreamForKey ( String routingKey ) { if ( currentSegments == null ) { return null ; } return writers . get ( getSegmentForEvent ( routingKey ) ) ; }
Selects which segment an event should be written to.

@param routingKey The key that should be used to select from the segment that the event
should go to.
@return The SegmentOutputStream for the segment that has been selected or null if
{@link #refreshSegmentEventWriters(Consumer)} needs to be called.