Package org.apache.druid.server.http
Class SegmentListerResource
java.lang.Object
org.apache.druid.server.http.SegmentListerResource
Endpoints exposed here are to be used only for druid internal management of segments by Coordinators, Brokers etc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.fasterxml.jackson.databind.ObjectMapperprotected static final EmittingLoggerprotected final com.fasterxml.jackson.databind.ObjectMapper -
Constructor Summary
ConstructorsConstructorDescriptionSegmentListerResource(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, com.fasterxml.jackson.databind.ObjectMapper smileMapper, BatchDataSegmentAnnouncer announcer, SegmentLoadDropHandler loadDropRequestHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDataSegmentChangeRequests(long timeout, SegmentLoadingMode loadingMode, List<DataSegmentChangeRequest> changeRequestList, javax.servlet.http.HttpServletRequest req) This endpoint is used by HttpLoadQueuePeon to assign segment load/drop requests batch.javax.ws.rs.core.ResponsegetSegmentLoadingCapabilities(javax.servlet.http.HttpServletRequest req) getSegments(long counter, long hash, long timeout, javax.servlet.http.HttpServletRequest req) This endpoint is used by HttpServerInventoryView to keep an up-to-date list of segments served by historical/realtime nodes.
-
Field Details
-
log
-
jsonMapper
protected final com.fasterxml.jackson.databind.ObjectMapper jsonMapper -
smileMapper
protected final com.fasterxml.jackson.databind.ObjectMapper smileMapper
-
-
Constructor Details
-
SegmentListerResource
@Inject public SegmentListerResource(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, com.fasterxml.jackson.databind.ObjectMapper smileMapper, @Nullable BatchDataSegmentAnnouncer announcer, @Nullable SegmentLoadDropHandler loadDropRequestHandler)
-
-
Method Details
-
getSegments
public Void getSegments(long counter, long hash, long timeout, @Context javax.servlet.http.HttpServletRequest req) throws IOException This endpoint is used by HttpServerInventoryView to keep an up-to-date list of segments served by historical/realtime nodes. This endpoint lists segments served by this server and can also incrementally provide the segments added/dropped since last response. Here is how, this is used. (1) Client sends first request /druid/internal/v1/segments?counter=-1&timeout=Server responds with list of segments currently served and a <counter,hash> pair. (2) Client sends subsequent requests /druid/internal/v1/segments?counter= &hash= &timeout= Where <counter,hash> values are used from the last response. Server responds with list of segment updates since given counter. This endpoint makes the client wait till either there is some segment update or given timeout elapses. So, clients keep on sending next request immediately after receiving the response in order to keep the list of segments served by this server up-to-date. - Parameters:
counter- counter received in last response.hash- hash received in last response.timeout- after which response is sent even if there are no new segment updates.req-- Returns:
- null to avoid "MUST return a non-void type" warning.
- Throws:
IOException
-
applyDataSegmentChangeRequests
public void applyDataSegmentChangeRequests(long timeout, @Nullable SegmentLoadingMode loadingMode, List<DataSegmentChangeRequest> changeRequestList, @Context javax.servlet.http.HttpServletRequest req) throws IOException This endpoint is used by HttpLoadQueuePeon to assign segment load/drop requests batch. This endpoint makes the client wait till one of the following events occur. Note that this is implemented using async IO so no jetty threads are held while in wait.- Given timeout elapses.
- Some load/drop request completed.
- Throws:
IOException
-
getSegmentLoadingCapabilities
public javax.ws.rs.core.Response getSegmentLoadingCapabilities(@Context javax.servlet.http.HttpServletRequest req)
-