You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Dan Harvey (JIRA)" <ji...@apache.org> on 2015/07/24 08:58:04 UTC

[jira] [Commented] (SAMZA-741) Add support for versioning to Elasticsearch System Producer

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

Dan Harvey commented on SAMZA-741:
----------------------------------

Yes, metadata on a message would be the best place for this.

I'm not sure changing the stream per message makes sense, I think that's what you are proposing?

Another way could be to put the version in the id so something like {{foo_id@1}}, then you can write a custom {{IndexRequestFactory}} to correctly set the version.

One of the problem with specifying the version like this with the id is that we are then assuming all id's people use won't contain @, so maybe it doesn't make sense to add this to the {{DefaultIndexRequestFactory}}

This kind of use case is why we created that factory, but now it does seem harder to use to add simple things like this. You really want to extend and just be able to add to the IndexRequest rather than having to rewrite the whole thing. So another option is cleaning that up how the {{IndexRequestFactory}} works.

> Add support for versioning to Elasticsearch System Producer
> -----------------------------------------------------------
>
>                 Key: SAMZA-741
>                 URL: https://issues.apache.org/jira/browse/SAMZA-741
>             Project: Samza
>          Issue Type: Improvement
>            Reporter: Roger Hoover
>            Priority: Minor
>             Fix For: 0.10.0
>
>
> Versioning (https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#index-versioning) lets you prevent duplicate messages from temporarily overwriting new versions of a document with old ones.
> Currently, the Elasticsearch system producer does not support setting versions.  Since Kafka/Samza don't support message metadata besides a key (I think), the best approach seems to be to embed metadata into the stream name.
> We can add a version and version_type as options to the stream name.  These match up with Elasticsearch REST API (https://www.elastic.co/blog/elasticsearch-versioning-support)
> {noformat}
> {index-name}/{type-name}?version={version-id}&version_type={version-type}
> {noformat}
> If the producer receives a failed insert/update due to version conflict, it should drop that old message and continue.



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