Class MarlinProducerResultImpl

  • All Implemented Interfaces:
    com.mapr.fs.jni.MarlinProducerResult
    Direct Known Subclasses:
    MarlinProducerResultImplV10

    public class MarlinProducerResultImpl
    extends java.lang.Object
    implements com.mapr.fs.jni.MarlinProducerResult
    This structure maintains all the data structures related to a producer request. Once marlin server comes back with a completion callback for a request then this request is marked done and populated with all the metadata coming from the server. The future returned to the caller waits on this done call to actually return the request metadata.
    • Constructor Summary

      Constructors 
      Constructor Description
      MarlinProducerResultImpl​(java.lang.String topic, int feed, org.apache.kafka.clients.producer.Callback callback, int serKeySz, int serValSz)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void await()
      Await the completion of this request
      boolean await​(long timeout, java.util.concurrent.TimeUnit unit)
      Await the completion of this request (up to the given time interval)
      org.apache.kafka.clients.producer.Callback callback()  
      boolean completed()
      Has the request completed?
      void done​(int feedid, long offset, long timestamp, java.lang.Exception error)  
      java.lang.Exception error()
      The error thrown (generally on the server) while processing this request
      int getFeed()  
      org.apache.kafka.clients.producer.RecordMetadata getRecordMetadata()  
      java.lang.String getTopic()  
      long offset()
      The base offset for the request (the first offset in the record set)
      void onCompletion()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • topic

        protected final java.lang.String topic
      • feed

        protected volatile int feed
      • offset

        protected volatile long offset
      • timestamp

        protected volatile long timestamp
      • serializedKeySize

        protected int serializedKeySize
      • serializedValueSize

        protected final int serializedValueSize
    • Constructor Detail

      • MarlinProducerResultImpl

        public MarlinProducerResultImpl​(java.lang.String topic,
                                        int feed,
                                        org.apache.kafka.clients.producer.Callback callback,
                                        int serKeySz,
                                        int serValSz)
    • Method Detail

      • done

        public void done​(int feedid,
                         long offset,
                         long timestamp,
                         java.lang.Exception error)
        Specified by:
        done in interface com.mapr.fs.jni.MarlinProducerResult
      • getTopic

        public java.lang.String getTopic()
      • getFeed

        public int getFeed()
      • getRecordMetadata

        public org.apache.kafka.clients.producer.RecordMetadata getRecordMetadata()
      • await

        public void await()
                   throws java.lang.InterruptedException
        Await the completion of this request
        Throws:
        java.lang.InterruptedException
      • await

        public boolean await​(long timeout,
                             java.util.concurrent.TimeUnit unit)
                      throws java.lang.InterruptedException
        Await the completion of this request (up to the given time interval)
        Parameters:
        timeout - The maximum time to wait
        unit - The unit for the max time
        Returns:
        true if the request completed, false if we timed out
        Throws:
        java.lang.InterruptedException
      • completed

        public boolean completed()
        Has the request completed?
      • offset

        public long offset()
        The base offset for the request (the first offset in the record set)
      • error

        public java.lang.Exception error()
        The error thrown (generally on the server) while processing this request
      • callback

        public org.apache.kafka.clients.producer.Callback callback()
      • onCompletion

        public void onCompletion()
        Specified by:
        onCompletion in interface com.mapr.fs.jni.MarlinProducerResult