Search in sources :

Example 1 with HopsTorrentAdvanceDownload

use of io.hops.hopsworks.dela.old_dto.HopsTorrentAdvanceDownload in project hopsworks by logicalclocks.

the class TransferDelaController method advanceDownload.

public void advanceDownload(String publicDSId, HDFSEndpoint hdfsEndpoint, KafkaEndpoint kafkaEndpoint, ExtendedDetails details) throws DelaException {
    if (!delaStateController.transferDelaAvailable()) {
        throw new DelaException(RESTCodes.DelaErrorCode.DELA_TRANSFER_NOT_AVAILABLE, Level.SEVERE, DelaException.Source.LOCAL);
    }
    HopsTorrentAdvanceDownload reqContent = new HopsTorrentAdvanceDownload(new TorrentId(publicDSId), kafkaEndpoint, hdfsEndpoint, details);
    try {
        ClientWrapper<SuccessJSON> rc = ClientWrapper.httpInstance(SuccessJSON.class).setTarget(settings.getDELA_TRANSFER_HTTP_ENDPOINT()).setPath("torrent/hops/download/advance/xml").setPayload(reqContent);
        SuccessJSON result = rc.doPost();
    } catch (IllegalStateException ise) {
        logger.log(Level.WARNING, "dela communication fail:{0}", ise.getMessage());
        throw new DelaException(RESTCodes.DelaErrorCode.COMMUNICATION_FAILURE, Level.SEVERE, DelaException.Source.DELA, null, ise.getMessage(), ise);
    }
}
Also used : TorrentId(io.hops.hopsworks.dela.old_dto.TorrentId) SuccessJSON(io.hops.hopsworks.dela.old_dto.SuccessJSON) HopsTorrentAdvanceDownload(io.hops.hopsworks.dela.old_dto.HopsTorrentAdvanceDownload) DelaException(io.hops.hopsworks.exceptions.DelaException)

Aggregations

HopsTorrentAdvanceDownload (io.hops.hopsworks.dela.old_dto.HopsTorrentAdvanceDownload)1 SuccessJSON (io.hops.hopsworks.dela.old_dto.SuccessJSON)1 TorrentId (io.hops.hopsworks.dela.old_dto.TorrentId)1 DelaException (io.hops.hopsworks.exceptions.DelaException)1