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

org.codelibs.elasticsearch.df.util.RequestUtil Maven / Gradle / Ivy

package org.codelibs.elasticsearch.df.util;

import static org.elasticsearch.common.unit.TimeValue.parseTimeValue;

import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.rest.RestRequest;

public class RequestUtil {
    private static final TimeValue DEFAULT_SCROLL = new TimeValue(60000);

    private RequestUtil() {
    }

    public static TimeValue getScroll(final RestRequest request) {
        final String scroll = request.param("scroll");
        if (scroll != null) {
            return parseTimeValue(scroll, DEFAULT_SCROLL, "");
        } else {
            return DEFAULT_SCROLL;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy