Examples of TransferManager


Examples of com.amazonaws.services.s3.transfer.TransferManager

     */
    public void useClient(AmazonS3Client client) {
        Region s3region = client.getRegion();

        synchronized (transferManagersByRegion) {
            TransferManager tm = transferManagersByRegion.remove(s3region);
            if (tm != null) {
                tm.shutdownNow();
            }
            clientsByRegion.put(s3region, client);
        }
    }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.TransferManager

     *         instantiated automatically from any existing
     *         {@link AmazonS3Client},
     */
    public TransferManager getTransferManager(Region region) {
        synchronized (transferManagersByRegion) {
            TransferManager tm = transferManagersByRegion.get(region);
            if (tm == null) {
                tm = new TransferManager(getClient(region));
                transferManagersByRegion.put(region, tm);
            }
            return tm;
        }
    }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.TransferManager

        }

        AmazonS3 s3 = new AmazonS3Client(credentials);
        Region usWest2 = Region.getRegion(Regions.US_WEST_2);
        s3.setRegion(usWest2);
        tx = new TransferManager(s3);

        bucketName = "s3-upload-sdk-sample-" + credentials.getAWSAccessKeyId().toLowerCase();

        new S3TransferProgressSample();
    }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.TransferManager

        assert !isBlank(key);

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(format("Multipart sending file %1$s as S3 object %2$s in " + "bucket %3$s", sourceFile.getName(), key, bucketName));
        }
        TransferManager tm = new TransferManager(S3Utils.acquireClient(clientOptions));
        Upload upload = tm.upload(bucketName, key, sourceFile);
        upload.waitForCompletion();
    }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.TransferManager

        assert !isBlank(key);

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(format("Multipart sending stream as S3 object %1$s in " + "bucket %2$s", key, bucketName));
        }
        TransferManager tm = new TransferManager(S3Utils.acquireClient(clientOptions));
        Upload upload = tm.upload(bucketName, key, sourceStream, null);
        upload.waitForCompletion();
    }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.TransferManager

        assert req != null;

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Multipart sending object to S3 using PutObjectRequest");
        }
        TransferManager tm = new TransferManager(S3Utils.acquireClient(clientOptions));
        Upload upload = tm.upload(req);
        upload.waitForCompletion();

    }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.TransferManager

    return new AmazonS3Client(provider);
  }

  private static boolean upload(AmazonS3 s3, String bucketName, String destinationFile, File source)
  {
    TransferManager mgr = new TransferManager(s3);
    Upload upload = mgr.upload(bucketName, destinationFile, source);

    try {
      upload.waitForUploadResult();
    } catch (InterruptedException e) {
      return false;
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.TransferManager

    super(credentialsProvider);
    init();
  }
 
  protected void init() {
    transferManager = new TransferManager(this);
    TransferManagerConfiguration configuration = new TransferManagerConfiguration();
    configuration.setMultipartUploadThreshold(100 * Constants.KB);
    transferManager.setConfiguration(configuration);
  }
 
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.TransferManager

        public PrestoS3OutputStream(AmazonS3 s3, TransferManagerConfiguration config, String host, String key, File tempFile)
                throws IOException
        {
            super(new BufferedOutputStream(new FileOutputStream(checkNotNull(tempFile, "tempFile is null"))));

            transferManager = new TransferManager(checkNotNull(s3, "s3 is null"));
            transferManager.setConfiguration(checkNotNull(config, "config is null"));

            this.host = checkNotNull(host, "host is null");
            this.key = checkNotNull(key, "key is null");
            this.tempFile = tempFile;
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.TransferManager

            String writeThreadsStr = prop.getProperty(S3Constants.S3_WRITE_THREADS);
            if (writeThreadsStr != null) {
                writeThreads = Integer.parseInt(writeThreadsStr);
            }
            LOG.info("Using thread pool of [{}] threads in S3 transfer manager.", writeThreads);
            tmx = new TransferManager(s3service,
                (ThreadPoolExecutor) Executors.newFixedThreadPool(writeThreads,
                    new NamedThreadFactory("s3-transfer-manager-worker")));
           
            int asyncWritePoolSize = 10;
            String maxConnsStr = prop.getProperty(S3Constants.S3_MAX_CONNS);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.