esevastyanov commented on a change in pull request #8110: Response context refactoring URL: https://github.com/apache/incubator-druid/pull/8110#discussion_r306363302
########## File path: processing/src/main/java/org/apache/druid/query/context/ResponseContext.java ########## @@ -0,0 +1,115 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.query.context; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.druid.guice.annotations.PublicApi; +import org.apache.druid.java.util.common.jackson.JacksonUtils; + +import java.io.IOException; +import java.util.Map; + +/** + * The context for storing and passing data between chains of {@link org.apache.druid.query.QueryRunner}s. + * The context is also transferred between Druid nodes with all the data it contains. + * All the keys associated with data inside the context should be stored here. + */ +@PublicApi +public abstract class ResponseContext +{ + /** + * CTX_* keys might be aggregated into an enum. Consider refactoring that. + */ + public static final String CTX_UNCOVERED_INTERVALS = "uncoveredIntervals"; + public static final String CTX_UNCOVERED_INTERVALS_OVERFLOWED = "uncoveredIntervalsOverflowed"; + public static final String CTX_MISSING_SEGMENTS = "missingSegments"; + public static final String CTX_ETAG = "ETag"; + public static final String CTX_QUERY_TOTAL_BYTES_GATHERED = "queryTotalBytesGathered"; + /** + * This variable indicates when a running query should be expired, + * and is effective only when 'timeout' of queryContext has a positive value. + */ + public static final String CTX_TIMEOUT_AT = "timeoutAt"; + public static final String CTX_COUNT = "count"; Review comment: Added a short comment for every key but without a full description of logic hidden behind that key. Hope it would be a good starting point for this kind of documentation ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
