Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@allenxwang
Copy link
Contributor

ElasticSearchSink uses MessageQueue4Sink for message handoff between the input and the sink. Its writeTo() method is simply implemented as enqueuing the message to MessageQueue4Sink, which will drop the message if queue is full. Therefore, the queue for ElasticSearchSink is typically configured as a large file based queue to minimize the possibility of dropping messages. This complicates some Suro operations and monitoring as it will have local storage and hence becomes stateful.

In case that the input to ElasticSearchSink is KafkaConsumer, where there is already a file queue offered by Kafka, having another queue in the system makes things complicated and unnecessary. In this case, if sink is too busy, it should just naturally slow down the input (KafkaConsumer) which will cause lag in the consumer but without having to deal with back pressure.

Therefore, a synchronous queue seems to be a good fit in this case where it can block the input if sink busy, and shift the back pressure to its upstream.

With this update, user can configure the queue to be synchronous queue by specifying the capacity of the queue to be 0.

@cloudbees-pull-request-builder

NetflixOSS » suro » suro-pull-requests #61 FAILURE
Looks like there's a problem with this pull request

@cloudbees-pull-request-builder

suro-pull-requests #229 FAILURE
Looks like there's a problem with this pull request

@cloudbees-pull-request-builder

suro-pull-requests #230 SUCCESS
This pull request looks good

@cloudbees-pull-request-builder

NetflixOSS » suro » suro-pull-requests #62 SUCCESS
This pull request looks good

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you were just changing this offer to put. but that will be a big change.

you current change doesn't break any existing behavior. looks good/safe to me.

nitpicking: a if-else might be more straightforward.

@cloudbees-pull-request-builder

NetflixOSS » suro » suro-pull-requests #63 SUCCESS
This pull request looks good

@cloudbees-pull-request-builder

suro-pull-requests #231 SUCCESS
This pull request looks good

allenxwang pushed a commit that referenced this pull request May 19, 2015
Use synchronous queue when sink does not want to drop message to deal with back pressure
@allenxwang allenxwang merged commit 12a087f into Netflix:master May 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants