Package com.netflix.exhibitor.core.index

Examples of com.netflix.exhibitor.core.index.QueryBuilder


        SearchId    searchHandle;
        try
        {
            boolean         hasTerms = false;
            QueryBuilder    builder = QueryBuilder.builder();
            if ( (request.getPathPrefix() != null) && (request.getPathPrefix().length() > 0) )
            {
                hasTerms = true;
                builder.pathPrefix(request.getPathPrefix());
            }
            if ( request.getOperationType() >= 0 )
            {
                hasTerms = true;
                builder.operationType(request.getOperationType());
            }
            if ( (request.getFirstDate() != null) && (request.getSecondDate() != null) )
            {
                hasTerms = true;
                Date        startDate;
                Date        endDate;
                if ( request.getFirstDate().before(request.getSecondDate()) )
                {
                    startDate = request.getFirstDate();
                    endDate = request.getSecondDate();
                }
                else
                {
                    startDate = request.getSecondDate();
                    endDate = request.getFirstDate();
                }
                Calendar      endOfDayEndDate = Calendar.getInstance();
                endOfDayEndDate.setTime(endDate);
                endOfDayEndDate.set(Calendar.HOUR_OF_DAY, 23);
                endOfDayEndDate.set(Calendar.MINUTE, 59);
                endOfDayEndDate.set(Calendar.SECOND, 59);
                endDate = endOfDayEndDate.getTime();
                builder.dateRange(startDate, endDate);
            }
            Query       query = hasTerms ? builder.build(QueryBuilder.Type.AND) : null;
            String      id = logSearch.cacheSearch(query, request.getReuseHandle(), request.getMaxResults());
            searchHandle = new SearchId(id);
        }
        finally
        {
View Full Code Here

TOP

Related Classes of com.netflix.exhibitor.core.index.QueryBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.