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

io.deephaven.proto.flight.util.ArrowHelper Maven / Gradle / Ivy

The newest version!
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.proto.flight.util;

import org.apache.arrow.flight.FlightDescriptor;
import org.apache.arrow.flight.Ticket;
import org.apache.arrow.flight.impl.Flight;

import java.util.List;

public class ArrowHelper {
    public static FlightDescriptor descriptor(org.apache.arrow.flight.impl.Flight.FlightDescriptor impl) {
        switch (impl.getType()) {
            case PATH:
                return FlightDescriptor.path(impl.getPathList());
            case CMD:
                return FlightDescriptor.command(impl.getCmd().toByteArray());
            default:
                throw new IllegalArgumentException("Unexpected type " + impl.getTypeValue());
        }
    }

    public static FlightDescriptor descriptor(List path) {
        return FlightDescriptor.path(path);
    }

    public static Ticket ticket(Flight.Ticket ticket) {
        return new Ticket(ticket.getTicket().toByteArray());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy