Package org.apache.pinot.common.utils
Class FileUploadDownloadClient
- java.lang.Object
-
- org.apache.pinot.common.utils.FileUploadDownloadClient
-
- All Implemented Interfaces:
AutoCloseable
public class FileUploadDownloadClient extends Object implements AutoCloseable
TheFileUploadDownloadClientclass provides methods to upload schema/segment, download segment or send segment completion protocol request through HTTP/HTTPS.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileUploadDownloadClient.CustomHeadersstatic classFileUploadDownloadClient.FileUploadTypestatic classFileUploadDownloadClient.QueryParameters
-
Constructor Summary
Constructors Constructor Description FileUploadDownloadClient()FileUploadDownloadClient(SSLContext sslContext)
-
Method Summary
Modifier and Type Method Description SimpleHttpResponseaddSchema(URI uri, String schemaName, File schemaFile)Deprecated.SimpleHttpResponseaddSchema(URI uri, String schemaName, File schemaFile, List<org.apache.http.Header> headers, List<org.apache.http.NameValuePair> parameters)Add schema.voidclose()intdownloadFile(URI uri, int socketTimeoutMs, File dest)Deprecated.intdownloadFile(URI uri, File dest)Deprecated.intdownloadFile(URI uri, File dest, AuthProvider authProvider)Download a file.intdownloadFile(URI uri, File dest, AuthProvider authProvider, List<org.apache.http.Header> httpHeaders)Download a file.FiledownloadUntarFileStreamed(URI uri, File dest, AuthProvider authProvider, List<org.apache.http.Header> httpHeaders, long maxStreamRateInByte)Download and untar a file in a streamed way with rate limitSimpleHttpResponseendReplaceSegments(URI uri, int socketTimeoutMs, AuthProvider authProvider)End replace segments with default settings.static URIgetDeleteSchemaURI(String protocol, String host, int port, String schemaName)static URIgetDeleteSegmentHttpUri(String host, int port, String rawTableName, String segmentName, String tableType)Deprecated.static URIgetDeleteTableURI(String protocol, String host, int port, String tableName, String type, String retention)static URIgetEndReplaceSegmentsURI(URI controllerURI, String rawTableName, String tableType, String segmentLineageEntryId)HttpClientgetHttpClient()static URIgetOldUploadSegmentHttpsURI(String host, int port)Deprecated.static URIgetOldUploadSegmentHttpURI(String host, int port)Deprecated.static URIgetRetrieveAllSegmentWithTableTypeHttpUri(String host, int port, String rawTableName, String tableType)Deprecated.static URIgetRetrieveSchemaHttpURI(String host, int port, String schemaName)Deprecated.static URIgetRetrieveSchemaURI(String protocol, String host, int port, String schemaName)static URIgetRetrieveTableConfigHttpURI(String host, int port, String rawTableName)Deprecated.static URIgetRetrieveTableConfigURI(String protocol, String host, int port, String rawTableName)static URIgetRevertReplaceSegmentsURI(URI controllerURI, String rawTableName, String tableType, String segmentLineageEntryId, boolean forceRevert)Map<String,List<String>>getSegments(URI controllerUri, String rawTableName, TableType tableType, boolean excludeReplacedSegments)Returns a map from a given tableType to a list of segments for that given tableType (OFFLINE or REALTIME) If tableType is left unspecified, both OFFLINE and REALTIME segments will be returned in the map.static URIgetStartReplaceSegmentsURI(URI controllerURI, String rawTableName, String tableType, boolean forceCleanup)static URIgetUploadSchemaHttpsURI(String host, int port)Deprecated.static URIgetUploadSchemaHttpURI(String host, int port)Deprecated.static URIgetUploadSchemaURI(String protocol, String host, int port)static URIgetUploadSchemaURI(URI controllerURI)static URIgetUploadSegmentHttpsURI(String host, int port)Deprecated.static URIgetUploadSegmentHttpURI(String host, int port)Deprecated.static URIgetUploadSegmentURI(String protocol, String host, int port)static URIgetUploadSegmentURI(URI controllerURI)static URIgetURI(String protocol, String host, int port, String path)static URIgetURI(String protocol, String host, int port, String path, String query)static List<org.apache.http.NameValuePair>makeTableParam(String tableName)Generate a param list with a table name attribute.SimpleHttpResponserevertReplaceSegments(URI uri)Revert replace segments with default settings.SimpleHttpResponsesendSegmentCompletionProtocolRequest(URI uri, int socketTimeoutMs)Deprecated.SimpleHttpResponsesendSegmentCompletionProtocolRequest(URI uri, List<org.apache.http.Header> headers, List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs)Send segment completion protocol request.SimpleHttpResponsesendSegmentJson(URI uri, String jsonString)Deprecated.SimpleHttpResponsesendSegmentJson(URI uri, String jsonString, List<org.apache.http.Header> headers, List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs)Send segment json.SimpleHttpResponsesendSegmentUri(URI uri, String downloadUri, String rawTableName)Deprecated.SimpleHttpResponsesendSegmentUri(URI uri, String downloadUri, List<org.apache.http.Header> headers, List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs)Send segment uri.SimpleHttpResponsestartReplaceSegments(URI uri, StartReplaceSegmentsRequest startReplaceSegmentsRequest, AuthProvider authProvider)Start replace segments with default settings.SimpleHttpResponseupdateSchema(URI uri, String schemaName, File schemaFile)Deprecated.SimpleHttpResponseupdateSchema(URI uri, String schemaName, File schemaFile, List<org.apache.http.Header> headers, List<org.apache.http.NameValuePair> parameters)Update schema.SimpleHttpResponseuploadSegment(URI uri, String segmentName, File segmentFile, String tableName)Deprecated.SimpleHttpResponseuploadSegment(URI uri, String segmentName, File segmentFile, String tableName, TableType tableType)Upload segment with segment file using default settings.SimpleHttpResponseuploadSegment(URI uri, String segmentName, File segmentFile, String tableName, TableType tableType, boolean enableParallelPushProtection, boolean allowRefresh)Upload segment with segment file using table name, type, enableParallelPushProtection and allowRefresh as request parameters.SimpleHttpResponseuploadSegment(URI uri, String segmentName, File segmentFile, List<org.apache.http.Header> headers, List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs)Upload segment with segment file.SimpleHttpResponseuploadSegment(URI uri, String segmentName, InputStream inputStream, String rawTableName)Upload segment with segment file input stream using default settings.SimpleHttpResponseuploadSegment(URI uri, String segmentName, InputStream inputStream, List<org.apache.http.Header> headers, List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs)Upload segment with segment file input stream.SimpleHttpResponseuploadSegment(URI uri, String segmentName, InputStream inputStream, List<org.apache.http.Header> headers, List<org.apache.http.NameValuePair> parameters, String tableName, TableType tableType)Upload segment with segment file input stream.SimpleHttpResponseuploadSegmentMetadata(URI uri, String segmentName, File segmentMetadataFile, List<org.apache.http.Header> headers, List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs)Upload segment by sending a zip of creation.meta and metadata.properties.SimpleHttpResponseuploadSegmentMetadataFiles(URI uri, Map<String,File> metadataFiles, int segmentUploadRequestTimeoutMs)Deprecated.SimpleHttpResponseuploadSegmentMetadataFiles(URI uri, Map<String,File> metadataFiles, List<org.apache.http.Header> headers, List<org.apache.http.NameValuePair> parameters, int segmentUploadRequestTimeoutMs)StringuploadToSegmentStore(String uri)Used by controllers to send requests to servers: Controller periodic task uses this endpoint to ask servers to upload committed llc segment to segment store if missing.
-
-
-
Constructor Detail
-
FileUploadDownloadClient
public FileUploadDownloadClient()
-
FileUploadDownloadClient
public FileUploadDownloadClient(SSLContext sslContext)
-
-
Method Detail
-
getHttpClient
public HttpClient getHttpClient()
-
getURI
public static URI getURI(String protocol, String host, int port, String path) throws URISyntaxException
- Throws:
URISyntaxException
-
getURI
public static URI getURI(String protocol, String host, int port, String path, String query) throws URISyntaxException
- Throws:
URISyntaxException
-
getRetrieveTableConfigHttpURI
@Deprecated public static URI getRetrieveTableConfigHttpURI(String host, int port, String rawTableName) throws URISyntaxException
Deprecated.Deprecated due to lack of protocol/scheme support. May break for deployments with TLS/SSL enabled- Throws:
URISyntaxException- See Also:
getRetrieveTableConfigURI(String, String, int, String)
-
getRetrieveTableConfigURI
public static URI getRetrieveTableConfigURI(String protocol, String host, int port, String rawTableName) throws URISyntaxException
- Throws:
URISyntaxException
-
getDeleteSegmentHttpUri
@Deprecated public static URI getDeleteSegmentHttpUri(String host, int port, String rawTableName, String segmentName, String tableType) throws URISyntaxException
Deprecated.Deprecated due to lack of protocol/scheme support. May break for deployments with TLS/SSL enabled This method calls the old segment endpoint. We will deprecate this behavior soon.- Throws:
URISyntaxException
-
getRetrieveAllSegmentWithTableTypeHttpUri
@Deprecated public static URI getRetrieveAllSegmentWithTableTypeHttpUri(String host, int port, String rawTableName, String tableType) throws URISyntaxException
Deprecated.Deprecated due to lack of protocol/scheme support. May break for deployments with TLS/SSL enabled This method calls the old segment endpoint. We will deprecate this behavior soon.- Throws:
URISyntaxException
-
getRetrieveSchemaHttpURI
@Deprecated public static URI getRetrieveSchemaHttpURI(String host, int port, String schemaName) throws URISyntaxException
Deprecated.Deprecated due to lack of protocol/scheme support. May break for deployments with TLS/SSL enabled- Throws:
URISyntaxException- See Also:
getRetrieveSchemaURI(String, String, int, String)
-
getRetrieveSchemaURI
public static URI getRetrieveSchemaURI(String protocol, String host, int port, String schemaName) throws URISyntaxException
- Throws:
URISyntaxException
-
getUploadSchemaHttpURI
@Deprecated public static URI getUploadSchemaHttpURI(String host, int port) throws URISyntaxException
Deprecated.Deprecated due to lack of protocol/scheme support. May break for deployments with TLS/SSL enabled- Throws:
URISyntaxException- See Also:
getUploadSchemaURI(String, String, int)
-
getUploadSchemaHttpsURI
@Deprecated public static URI getUploadSchemaHttpsURI(String host, int port) throws URISyntaxException
Deprecated.Deprecated due to lack of protocol/scheme support. May break for deployments with TLS/SSL enabled- Throws:
URISyntaxException- See Also:
getUploadSchemaURI(String, String, int)
-
getUploadSchemaURI
public static URI getUploadSchemaURI(String protocol, String host, int port) throws URISyntaxException
- Throws:
URISyntaxException
-
getDeleteSchemaURI
public static URI getDeleteSchemaURI(String protocol, String host, int port, String schemaName) throws URISyntaxException
- Throws:
URISyntaxException
-
getDeleteTableURI
public static URI getDeleteTableURI(String protocol, String host, int port, String tableName, String type, String retention) throws URISyntaxException
- Throws:
URISyntaxException
-
getUploadSchemaURI
public static URI getUploadSchemaURI(URI controllerURI) throws URISyntaxException
- Throws:
URISyntaxException
-
getOldUploadSegmentHttpURI
@Deprecated public static URI getOldUploadSegmentHttpURI(String host, int port) throws URISyntaxException
Deprecated.Deprecated due to lack of protocol/scheme support. May break for deployments with TLS/SSL enabled
-
getOldUploadSegmentHttpsURI
@Deprecated public static URI getOldUploadSegmentHttpsURI(String host, int port) throws URISyntaxException
Deprecated.Deprecated due to lack of protocol/scheme support. May break for deployments with TLS/SSL enabled
-
getUploadSegmentHttpURI
@Deprecated public static URI getUploadSegmentHttpURI(String host, int port) throws URISyntaxException
Deprecated.Deprecated due to lack of protocol/scheme support. May break for deployments with TLS/SSL enabled- Throws:
URISyntaxException- See Also:
getUploadSegmentURI(String, String, int)
-
getUploadSegmentHttpsURI
@Deprecated public static URI getUploadSegmentHttpsURI(String host, int port) throws URISyntaxException
Deprecated.Deprecated due to lack of protocol/scheme support. May break for deployments with TLS/SSL enabled- Throws:
URISyntaxException- See Also:
getUploadSegmentURI(String, String, int)
-
getUploadSegmentURI
public static URI getUploadSegmentURI(String protocol, String host, int port) throws URISyntaxException
- Throws:
URISyntaxException
-
getUploadSegmentURI
public static URI getUploadSegmentURI(URI controllerURI) throws URISyntaxException
- Throws:
URISyntaxException
-
getStartReplaceSegmentsURI
public static URI getStartReplaceSegmentsURI(URI controllerURI, String rawTableName, String tableType, boolean forceCleanup) throws URISyntaxException
- Throws:
URISyntaxException
-
getEndReplaceSegmentsURI
public static URI getEndReplaceSegmentsURI(URI controllerURI, String rawTableName, String tableType, String segmentLineageEntryId) throws URISyntaxException
- Throws:
URISyntaxException
-
getRevertReplaceSegmentsURI
public static URI getRevertReplaceSegmentsURI(URI controllerURI, String rawTableName, String tableType, String segmentLineageEntryId, boolean forceRevert) throws URISyntaxException
- Throws:
URISyntaxException
-
addSchema
@Deprecated public SimpleHttpResponse addSchema(URI uri, String schemaName, File schemaFile) throws IOException, HttpErrorStatusException
Deprecated.Deprecated due to lack of auth header support. May break for deployments with auth enabled Add schema.- Parameters:
uri- URIschemaName- Schema nameschemaFile- Schema file- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException- See Also:
addSchema(URI, String, File, List, List)
-
addSchema
public SimpleHttpResponse addSchema(URI uri, String schemaName, File schemaFile, @Nullable List<org.apache.http.Header> headers, @Nullable List<org.apache.http.NameValuePair> parameters) throws IOException, HttpErrorStatusException
Add schema.- Parameters:
uri- URIschemaName- Schema nameschemaFile- Schema fileheaders- HTTP headersparameters- HTTP parameters- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
updateSchema
@Deprecated public SimpleHttpResponse updateSchema(URI uri, String schemaName, File schemaFile) throws IOException, HttpErrorStatusException
Deprecated.Deprecated due to lack of auth header support. May break for deployments with auth enabled Update schema.- Parameters:
uri- URIschemaName- Schema nameschemaFile- Schema file- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException- See Also:
updateSchema(URI, String, File, List, List)
-
updateSchema
public SimpleHttpResponse updateSchema(URI uri, String schemaName, File schemaFile, @Nullable List<org.apache.http.Header> headers, @Nullable List<org.apache.http.NameValuePair> parameters) throws IOException, HttpErrorStatusException
Update schema.- Parameters:
uri- URIschemaName- Schema nameschemaFile- Schema fileheaders- HTTP headersparameters- HTTP parameters- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
uploadSegmentMetadata
public SimpleHttpResponse uploadSegmentMetadata(URI uri, String segmentName, File segmentMetadataFile, @Nullable List<org.apache.http.Header> headers, @Nullable List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs) throws IOException, HttpErrorStatusException
Upload segment by sending a zip of creation.meta and metadata.properties.- Parameters:
uri- URIsegmentName- Segment namesegmentMetadataFile- Segment metadata fileheaders- Optional http headersparameters- Optional query parameterssocketTimeoutMs- Socket timeout in milliseconds- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
uploadSegmentMetadataFiles
@Deprecated public SimpleHttpResponse uploadSegmentMetadataFiles(URI uri, Map<String,File> metadataFiles, int segmentUploadRequestTimeoutMs) throws IOException, HttpErrorStatusException
Deprecated.Deprecated due to lack of auth header support. May break for deployments with auth enabled
-
uploadSegmentMetadataFiles
public SimpleHttpResponse uploadSegmentMetadataFiles(URI uri, Map<String,File> metadataFiles, @Nullable List<org.apache.http.Header> headers, @Nullable List<org.apache.http.NameValuePair> parameters, int segmentUploadRequestTimeoutMs) throws IOException, HttpErrorStatusException
- Throws:
IOExceptionHttpErrorStatusException
-
uploadSegment
public SimpleHttpResponse uploadSegment(URI uri, String segmentName, File segmentFile, @Nullable List<org.apache.http.Header> headers, @Nullable List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs) throws IOException, HttpErrorStatusException
Upload segment with segment file. Note: table name needs to be added as a parameter except for the case where this gets called during realtime segment commit protocol. TODO: fix the realtime segment commit protocol to add table name as a parameter.- Parameters:
uri- URIsegmentName- Segment namesegmentFile- Segment fileheaders- Optional http headersparameters- Optional query parameterssocketTimeoutMs- Socket timeout in milliseconds- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
uploadSegment
@Deprecated public SimpleHttpResponse uploadSegment(URI uri, String segmentName, File segmentFile, String tableName) throws IOException, HttpErrorStatusException
Deprecated.Deprecated due to lack of auth header support. May break for deployments with auth enabled Upload segment with segment file using default settings. Include table name as a request parameter.- Parameters:
uri- URIsegmentName- Segment namesegmentFile- Segment filetableName- Table name with or without type suffix- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException- See Also:
uploadSegment(URI, String, InputStream, List, List, int)
-
uploadSegment
public SimpleHttpResponse uploadSegment(URI uri, String segmentName, File segmentFile, String tableName, TableType tableType) throws IOException, HttpErrorStatusException
Upload segment with segment file using default settings. Include table name and type as a request parameters.- Parameters:
uri- URIsegmentName- Segment namesegmentFile- Segment filetableName- Table name with or without type suffixtableType- Table type- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
uploadSegment
public SimpleHttpResponse uploadSegment(URI uri, String segmentName, File segmentFile, String tableName, TableType tableType, boolean enableParallelPushProtection, boolean allowRefresh) throws IOException, HttpErrorStatusException
Upload segment with segment file using table name, type, enableParallelPushProtection and allowRefresh as request parameters.- Parameters:
uri- URIsegmentName- Segment namesegmentFile- Segment filetableName- Table name with or without type suffixtableType- Table typeenableParallelPushProtection- enable protection against concurrent segment uploads for the same segmentallowRefresh- whether to refresh a segment if it already exists- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
uploadSegment
public SimpleHttpResponse uploadSegment(URI uri, String segmentName, InputStream inputStream, @Nullable List<org.apache.http.Header> headers, @Nullable List<org.apache.http.NameValuePair> parameters, String tableName, TableType tableType) throws IOException, HttpErrorStatusException
Upload segment with segment file input stream. Note: table name has to be set as a parameter.- Parameters:
uri- URIsegmentName- Segment nameinputStream- Segment file input streamheaders- Optional http headersparameters- Optional query parameterstableName- Table name with or without type suffixtableType- Table type- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
uploadSegment
public SimpleHttpResponse uploadSegment(URI uri, String segmentName, InputStream inputStream, @Nullable List<org.apache.http.Header> headers, @Nullable List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs) throws IOException, HttpErrorStatusException
Upload segment with segment file input stream. Note: table name has to be set as a parameter.- Parameters:
uri- URIsegmentName- Segment nameinputStream- Segment file input streamheaders- Optional http headersparameters- Optional query parameterssocketTimeoutMs- Socket timeout in milliseconds- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
uploadSegment
public SimpleHttpResponse uploadSegment(URI uri, String segmentName, InputStream inputStream, String rawTableName) throws IOException, HttpErrorStatusException
Upload segment with segment file input stream using default settings. Include table name as a request parameter.- Parameters:
uri- URIsegmentName- Segment nameinputStream- Segment file input streamrawTableName- Raw table name- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
getSegments
public Map<String,List<String>> getSegments(URI controllerUri, String rawTableName, @Nullable TableType tableType, boolean excludeReplacedSegments) throws Exception
Returns a map from a given tableType to a list of segments for that given tableType (OFFLINE or REALTIME) If tableType is left unspecified, both OFFLINE and REALTIME segments will be returned in the map.- Throws:
Exception
-
uploadToSegmentStore
public String uploadToSegmentStore(String uri) throws URISyntaxException, IOException, HttpErrorStatusException
Used by controllers to send requests to servers: Controller periodic task uses this endpoint to ask servers to upload committed llc segment to segment store if missing.- Parameters:
uri- The uri to ask servers to upload segment to segment store- Returns:
- the uploaded segment download url from segment store
- Throws:
URISyntaxExceptionIOExceptionHttpErrorStatusException- TODO: migrate this method to another class
-
sendSegmentUri
public SimpleHttpResponse sendSegmentUri(URI uri, String downloadUri, @Nullable List<org.apache.http.Header> headers, @Nullable List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs) throws IOException, HttpErrorStatusException
Send segment uri. Note: table name has to be set as a parameter.- Parameters:
uri- URIdownloadUri- Segment download uriheaders- Optional http headersparameters- Optional query parameterssocketTimeoutMs- Socket timeout in milliseconds- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
sendSegmentUri
@Deprecated public SimpleHttpResponse sendSegmentUri(URI uri, String downloadUri, String rawTableName) throws IOException, HttpErrorStatusException
Deprecated.Deprecated due to lack of auth header support. May break for deployments with auth enabled Send segment uri using default settings. Include table name as a request parameter.- Parameters:
uri- URIdownloadUri- Segment download urirawTableName- Raw table name- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException- See Also:
sendSegmentUri(URI, String, List, List, int)
-
sendSegmentJson
public SimpleHttpResponse sendSegmentJson(URI uri, String jsonString, @Nullable List<org.apache.http.Header> headers, @Nullable List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs) throws IOException, HttpErrorStatusException
Send segment json.- Parameters:
uri- URIjsonString- Segment json stringheaders- Optional http headersparameters- Optional query parameterssocketTimeoutMs- Socket timeout in milliseconds- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
sendSegmentJson
@Deprecated public SimpleHttpResponse sendSegmentJson(URI uri, String jsonString) throws IOException, HttpErrorStatusException
Deprecated.Deprecated due to lack of auth header support. May break for deployments with auth enabled Send segment json using default settings.- Parameters:
uri- URIjsonString- Segment json string- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException- See Also:
sendSegmentJson(URI, String, List, List, int)
-
startReplaceSegments
public SimpleHttpResponse startReplaceSegments(URI uri, StartReplaceSegmentsRequest startReplaceSegmentsRequest, @Nullable AuthProvider authProvider) throws IOException, HttpErrorStatusException
Start replace segments with default settings.- Parameters:
uri- URIstartReplaceSegmentsRequest- requestauthProvider- auth provider- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
endReplaceSegments
public SimpleHttpResponse endReplaceSegments(URI uri, int socketTimeoutMs, @Nullable AuthProvider authProvider) throws IOException, HttpErrorStatusException
End replace segments with default settings.- Parameters:
uri- URIauthProvider- auth provider- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
revertReplaceSegments
public SimpleHttpResponse revertReplaceSegments(URI uri) throws IOException, HttpErrorStatusException
Revert replace segments with default settings.- Parameters:
uri- URI- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
sendSegmentCompletionProtocolRequest
@Deprecated public SimpleHttpResponse sendSegmentCompletionProtocolRequest(URI uri, int socketTimeoutMs) throws IOException, HttpErrorStatusException
Deprecated.Deprecated due to lack of auth header support. May break for deployments with auth enabled Send segment completion protocol request.- Parameters:
uri- URIsocketTimeoutMs- Socket timeout in milliseconds- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException- See Also:
sendSegmentCompletionProtocolRequest(URI, List, List, int)
-
sendSegmentCompletionProtocolRequest
public SimpleHttpResponse sendSegmentCompletionProtocolRequest(URI uri, @Nullable List<org.apache.http.Header> headers, @Nullable List<org.apache.http.NameValuePair> parameters, int socketTimeoutMs) throws IOException, HttpErrorStatusException
Send segment completion protocol request.- Parameters:
uri- URIheaders- Optional http headersparameters- Optional query parameterssocketTimeoutMs- Socket timeout in milliseconds- Returns:
- Response
- Throws:
IOExceptionHttpErrorStatusException
-
downloadFile
@Deprecated public int downloadFile(URI uri, int socketTimeoutMs, File dest) throws IOException, HttpErrorStatusException
Deprecated.Deprecated due to lack of auth header support. May break for deployments with auth enabled Download a file using default settings- Parameters:
uri- URIsocketTimeoutMs- Socket timeout in millisecondsdest- File destination- Returns:
- Response status code
- Throws:
IOExceptionHttpErrorStatusException- See Also:
HttpClient.downloadFile(URI, int, File, AuthProvider, List)
-
downloadFile
@Deprecated public int downloadFile(URI uri, File dest) throws IOException, HttpErrorStatusException
Deprecated.Deprecated due to lack of auth header support. May break for deployments with auth enabled Download a file.- Parameters:
uri- URIdest- File destination- Returns:
- Response status code
- Throws:
IOExceptionHttpErrorStatusException- See Also:
downloadFile(URI, File, AuthProvider)
-
downloadFile
public int downloadFile(URI uri, File dest, AuthProvider authProvider) throws IOException, HttpErrorStatusException
Download a file.- Parameters:
uri- URIdest- File destinationauthProvider- auth provider- Returns:
- Response status code
- Throws:
IOExceptionHttpErrorStatusException
-
downloadFile
public int downloadFile(URI uri, File dest, AuthProvider authProvider, List<org.apache.http.Header> httpHeaders) throws IOException, HttpErrorStatusException
Download a file.- Parameters:
uri- URIdest- File destinationauthProvider- auth providerhttpHeaders- http headers- Returns:
- Response status code
- Throws:
IOExceptionHttpErrorStatusException
-
downloadUntarFileStreamed
public File downloadUntarFileStreamed(URI uri, File dest, AuthProvider authProvider, List<org.apache.http.Header> httpHeaders, long maxStreamRateInByte) throws IOException, HttpErrorStatusException
Download and untar a file in a streamed way with rate limit- Parameters:
uri- URIdest- File destinationauthProvider- auth tokenhttpHeaders- http headersmaxStreamRateInByte- limit the rate to write download-untar stream to disk, in bytes -1 for no disk write limit, 0 for limit the writing to min(untar, download) rate- Returns:
- Response status code
- Throws:
IOExceptionHttpErrorStatusException
-
makeTableParam
public static List<org.apache.http.NameValuePair> makeTableParam(String tableName)
Generate a param list with a table name attribute.- Parameters:
tableName- table name- Returns:
- param list
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
-