clintropolis commented on a change in pull request #8088: Add intermediary data server for shuffle URL: https://github.com/apache/incubator-druid/pull/8088#discussion_r304674327
########## File path: indexing-service/src/main/java/org/apache/druid/indexing/worker/http/ShuffleResource.java ########## @@ -0,0 +1,122 @@ +/* + * 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.indexing.worker.http; + +import com.google.common.io.ByteStreams; +import com.google.inject.Inject; +import com.sun.jersey.spi.container.ResourceFilters; +import org.apache.druid.indexing.worker.IntermediaryDataManager; +import org.apache.druid.java.util.common.DateTimes; +import org.apache.druid.java.util.common.StringUtils; +import org.apache.druid.java.util.common.logger.Logger; +import org.apache.druid.server.http.security.StateResourceFilter; +import org.joda.time.Interval; + +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.core.StreamingOutput; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.List; + +/** + * HTTP endpoints for shuffle system. The MiddleManager and Indexer use this resource to serve intermediary shuffle + * data. + * + * We use {@link StateResourceFilter} here because it performs an admin-like authorization and + * all endpoints here are supposed to be used for only internal communcation. + * Another possible alternate could be performing datasource-level authorization as in TaskResourceFilter. + * However, datasource information is not available in middleManagers or indexers yet which makes hard to use it. + * We could develop a new ResourceFileter in the future if needed. Review comment: :+1: ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org