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

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

The newest version!
package tech.ytsaurus.client.request;

import java.util.List;
import java.util.stream.Collectors;

import tech.ytsaurus.core.YtTimestamp;
import tech.ytsaurus.rpcproxy.TRspListQueries;

/**
 * Immutable list queries result.
 *
 * @see tech.ytsaurus.client.ApiServiceClient#listQueries(ListQueries)
 */
public class ListQueriesResult {
    private final List queries;
    private final boolean incomplete;
    private final YtTimestamp timestamp;

    public ListQueriesResult(TRspListQueries rsp) {
        this.queries = rsp.getQueriesList().stream()
                .map(Query::new)
                .collect(Collectors.toList());
        this.incomplete = rsp.getIncomplete();
        this.timestamp = YtTimestamp.valueOf(rsp.getTimestamp());
    }

    /**
     * Get queries.
     *
     * @return queries.
     */
    public List getQueries() {
        return queries;
    }

    /**
     * Whether result is incomplete.
     *
     * @return true if result is incomplete, false otherwise.
     */
    public boolean isIncomplete() {
        return incomplete;
    }

    /**
     * Get timestamp.
     *
     * @return timestamp.
     */
    public YtTimestamp getTimestamp() {
        return timestamp;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy