This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SubmitTask { | |
| private static final int DEFAULT_THREAD_COUNT = 4; // default number of threads | |
| private final ThreadPoolExecutor executorService; | |
| public SubmitTask() { | |
| this.executorService = (ThreadPoolExecutor) Executors.newFixedThreadPool(DEFAULT_THREAD_COUNT); | |
| } | |
| // if we only submit task to executor service then our thread pool will not closed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.amazonaws.regions.Regions; | |
| import com.amazonaws.services.s3.AmazonS3; | |
| import com.amazonaws.services.s3.AmazonS3ClientBuilder; | |
| import com.amazonaws.services.s3.internal.Constants; | |
| import com.amazonaws.services.s3.model.*; | |
| import lombok.extern.log4j.Log4j2; | |
| import java.io.ByteArrayInputStream; | |
| import java.io.ByteArrayOutputStream; | |
| import java.io.InputStream; |
OlderNewer