Uploaded image for project: 'Samza'
  1. Samza
  2. SAMZA-654

Add Elasticsearch Producer



    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.10.0
    • None
    • None


      Elasticsearch is likely to be a common output datastore for Samza so it would be good to have a Producer (and possibly Consumer) as part of the core project.

      Elasticsearch organises data into indexes which can contain multiple types of documents. Each document has a id which it is identified by and the source which is it's actual data. These map well on to concepts in Samza.

      Elasticsearch also has mappings which defines how it indexes the documents pushed to it. I don't think the Samza System should be concerned with this.

      (index, type) -> stream

      id -> key

      source -> message

      The main one needing to be agreed upon is how the index and type are defined as a stream. We've started by simply joining them with a / as they would in the elasticsearch REST api and using that as the stream name.

      The java elasticsearch client can deal with the source being a variety of types that can be presented as json (Object, Map, byte[]). We could just pass objects to the Producer or use the Samza json serde to handle that (or maybe both), we're currently passing through the message object and assuming the client can deal with it.

      Elasticsearch also has the ability to bulk index documents, so combining this with correctly flushing the Producer can get good performance.

      Finally we'd need to think how this can be configured. Elasticsearch java client has two different transports that have various configuration. Currently we are only using the TransportClient, we should probably make it configurable or maybe not initially.


        1. 0001-SAMZA-654-Added-ElasticsearchSystemProducer-and-Fact.patch
          11 kB
          Dan Harvey
        2. ElasticsearchSystemProducer.patch
          59 kB
          Dan Harvey
        3. ElasticsearchSystemProducer.patch
          59 kB
          Dan Harvey
        4. ElasticsearchSystemProducer.patch
          56 kB
          Dan Harvey
        5. ElasticsearchSystemProducer.patch
          28 kB
          Dan Harvey

        Issue Links



              danharvey Dan Harvey
              danharvey Dan Harvey
              1 Vote for this issue
              8 Start watching this issue