tech.ydb.topic.read.impl.BatchMeta Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-sdk-topic Show documentation
Show all versions of ydb-sdk-topic Show documentation
Topic client implementation
package tech.ydb.topic.read.impl;
import java.time.Instant;
import java.util.Map;
import tech.ydb.core.utils.ProtobufUtils;
import tech.ydb.proto.topic.YdbTopic;
import tech.ydb.topic.description.Codec;
/**
* @author Nikolay Perfilov
*/
public class BatchMeta {
private final String producerId;
private final Map writeSessionMeta;
private final Codec codec;
private final Instant writtenAt;
public BatchMeta(YdbTopic.StreamReadMessage.ReadResponse.Batch batch) {
this.producerId = batch.getProducerId();
this.writeSessionMeta = batch.getWriteSessionMetaMap();
this.codec = tech.ydb.topic.utils.ProtoUtils.codecFromProto(batch.getCodec());
this.writtenAt = ProtobufUtils.protoToInstant(batch.getWrittenAt());
}
public String getProducerId() {
return producerId;
}
public Map getWriteSessionMeta() {
return writeSessionMeta;
}
public Codec getCodec() {
return codec;
}
public Instant getWrittenAt() {
return writtenAt;
}
}