All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.ytsaurus.client.request.ReadSerializationContext Maven / Gradle / Ivy

package tech.ytsaurus.client.request;

import java.nio.ByteBuffer;

import tech.ytsaurus.client.TableAttachmentReader;
import tech.ytsaurus.client.rows.WireRowDeserializer;
import tech.ytsaurus.rpcproxy.ERowsetFormat;
import tech.ytsaurus.ysontree.YTreeNode;

public class ReadSerializationContext extends SerializationContext {

    public ReadSerializationContext(TableAttachmentReader attachmentReader) {
        this.attachmentReader = attachmentReader;
    }

    public ReadSerializationContext(WireRowDeserializer deserializer) {
        this(TableAttachmentReader.wireProtocol(deserializer));
    }

    private ReadSerializationContext(ERowsetFormat rowsetFormat, TableAttachmentReader attachmentReader) {
        this.rowsetFormat = rowsetFormat;
        this.attachmentReader = attachmentReader;
    }

    private ReadSerializationContext(Format format, TableAttachmentReader attachmentReader) {
        this.format = format;
        this.rowsetFormat = ERowsetFormat.RF_FORMAT;
        this.attachmentReader = attachmentReader;
    }

    public static ReadSerializationContext binaryArrow() {
        return new ReadSerializationContext<>(ERowsetFormat.RF_ARROW, TableAttachmentReader.byteBuffer());
    }

    public static ReadSerializationContext ysonBinary() {
        return new ReadSerializationContext<>(Format.ysonBinary(), TableAttachmentReader.ysonBinary());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy