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

tech.ydb.yoj.repository.db.readtable.ReadTableParams Maven / Gradle / Ivy

Go to download

Core YOJ (YDB ORM for Java) abstractions and APIs for domain entities, repositories, transactions etc.

The newest version!
package tech.ydb.yoj.repository.db.readtable;

import lombok.Builder;
import lombok.Value;
import tech.ydb.yoj.ExperimentalApi;

import java.time.Duration;

@Value
@Builder
public class ReadTableParams {
    boolean ordered;
    ID fromKey;
    boolean fromInclusive;
    ID toKey;
    boolean toInclusive;
    int rowLimit;
    @Builder.Default
    Duration timeout = Duration.ofSeconds(60);

    /**
     * Set this to {@code true} to use a {@code Spliterator} contract-conformant and less memory consuming implementation for the {@code Stream}
     * returned by {@code readTable()}.
     * 

Note that using the new implementation currently has a negative performance impact, for more information refer to * GitHub Issue #42. */ @ExperimentalApi(issue = "https://github.com/ydb-platform/yoj-project/issues/42") boolean useNewSpliterator; int batchLimitBytes; int batchLimitRows; public static ReadTableParams getDefault() { return ReadTableParams.builder().build(); } public static class ReadTableParamsBuilder { public ReadTableParams.ReadTableParamsBuilder ordered() { this.ordered = true; return this; } public ReadTableParams.ReadTableParamsBuilder fromKeyInclusive(ID fromKey) { return fromKey(fromKey).fromInclusive(true); } public ReadTableParams.ReadTableParamsBuilder toKeyInclusive(ID toKey) { return toKey(toKey).toInclusive(true); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy