@ Nullable public Boolean isHandOffComplete ( String dataSource , SegmentDescriptor descriptor ) { try { FullResponseHolder response = druidLeaderClient . go ( druidLeaderClient . makeRequest ( HttpMethod . GET , StringUtils . format ( "/druid/coordinator/v1/datasources/%s/handoffComplete?interval=%s&partitionNumber=%d&version=%s" , StringUtils . urlEncode ( dataSource ) , descriptor . getInterval ( ) , descriptor . getPartitionNumber ( ) , descriptor . getVersion ( ) ) ) ) ; if ( response . getStatus ( ) . equals ( HttpResponseStatus . NOT_FOUND ) ) { return null ; } if ( ! response . getStatus ( ) . equals ( HttpResponseStatus . OK ) ) { throw new ISE ( "Error while fetching serverView status[%s] content[%s]" , response . getStatus ( ) , response . getContent ( ) ) ; } return jsonMapper . readValue ( response . getContent ( ) , new TypeReference < Boolean > ( ) { } ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Checks the given segment is handed off or not . It can return null if the HTTP call returns 404 which can happen during rolling update .