@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.encoding.hashCode(); h *= 1000003; h ^= this.messageMaxBytes; h *= 1000003; h ^= this.encoder.hashCode(); h *= 1000003; h ^= this.endpoint.hashCode(); h *= 1000003; h ^= this.connectTimeout; h *= 1000003; h ^= this.readTimeout; h *= 1000003; h ^= this.compressionEnabled ? 1231 : 1237; h *= 1000003; h ^= this.mediaType.hashCode(); return h; }
/** Asynchronously sends the spans as a POST to {@link #endpoint()}. */ @Override public void sendSpans(List<byte[]> encodedSpans, Callback callback) { if (closeCalled) throw new IllegalStateException("close"); try { byte[] message = encoder().encode(encodedSpans); send(message, mediaType()); callback.onComplete(); } catch (Throwable e) { callback.onError(e); if (e instanceof Error) throw (Error) e; } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof KafkaSender) { KafkaSender that = (KafkaSender) o; return (this.encoding.equals(that.encoding())) && (this.messageMaxBytes == that.messageMaxBytes()) && (this.encoder.equals(that.encoder())) && (this.topic.equals(that.topic())) && (this.properties.equals(that.properties())); } return false; }
public final KafkaSender build() { return encoder(BytesMessageEncoder.forEncoding(encoding())).autoBuild(); }
/** * This sends all of the spans as a single message. * * <p>NOTE: this blocks until the metadata server is available. */ @SuppressWarnings("FutureReturnValueIgnored") // callbacks are used instead @Override public void sendSpans(List encodedSpans, Callback callback) { if (closeCalled) throw new IllegalStateException("closed"); try { final byte[] message = encoder().encode(encodedSpans); get().send(new ProducerRecord<>(topic(), message), (metadata, exception) -> { if (exception == null) { callback.onComplete(); } else { callback.onError(exception); } }); } catch (Throwable e) { callback.onError(e); if (e instanceof Error) throw (Error) e; } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof KafkaSender) { KafkaSender that = (KafkaSender) o; return (this.encoding.equals(that.encoding())) && (this.messageMaxBytes == that.messageMaxBytes()) && (this.encoder.equals(that.encoder())) && (this.topic.equals(that.topic())) && (this.properties.equals(that.properties())); } return false; }
public final KafkaSender build() { return encoder(BytesMessageEncoder.forEncoding(encoding())).autoBuild(); }
/** * This sends all of the spans as a single message. * * <p>NOTE: this blocks until the metadata server is available. */ @SuppressWarnings("FutureReturnValueIgnored") // callbacks are used instead @Override public void sendSpans(List encodedSpans, Callback callback) { if (closeCalled) throw new IllegalStateException("closed"); try { final byte[] message = encoder().encode(encodedSpans); get().send(new ProducerRecord<>(topic(), message), (metadata, exception) -> { if (exception == null) { callback.onComplete(); } else { callback.onError(exception); } }); } catch (Throwable e) { callback.onError(e); if (e instanceof Error) throw (Error) e; } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof URLConnectionSender) { URLConnectionSender that = (URLConnectionSender) o; return (this.encoding.equals(that.encoding())) && (this.messageMaxBytes == that.messageMaxBytes()) && (this.encoder.equals(that.encoder())) && (this.endpoint.equals(that.endpoint())) && (this.connectTimeout == that.connectTimeout()) && (this.readTimeout == that.readTimeout()) && (this.compressionEnabled == that.compressionEnabled()) && (this.mediaType.equals(that.mediaType())); } return false; }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.encoding.hashCode(); h *= 1000003; h ^= this.messageMaxBytes; h *= 1000003; h ^= this.encoder.hashCode(); h *= 1000003; h ^= this.topic.hashCode(); h *= 1000003; h ^= this.properties.hashCode(); return h; }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.encoding.hashCode(); h *= 1000003; h ^= this.messageMaxBytes; h *= 1000003; h ^= this.encoder.hashCode(); h *= 1000003; h ^= this.topic.hashCode(); h *= 1000003; h ^= this.properties.hashCode(); return h; }