private int putFileToS3(ResultSet resultSet, int taskId, AmazonS3 s3Client, String bucketName) throws SQLException {

        // Set File Name.
        // It is not possible to append to an existing S3 file, ReplicaDB will generate one file per job
        // renaming file name with the taskid
        if (options.getJobs() > 1)
            keyFileName = keyFileName.substring(0, keyFileName.lastIndexOf(".")) + "_" + taskId + keyFileName.substring(keyFileName.lastIndexOf("."));

        // Setting up Streaming transfer
        int numStreams = 1;
        final StreamTransferManager manager = new StreamTransferManager(bucketName, keyFileName, s3Client)
                .numStreams(numStreams)
                .numUploadThreads(2)
                .queueCapacity(2)
                .partSize(5);

        final List<MultiPartOutputStream> streams = manager.getMultiPartOutputStreams();
        int processedRows = 0;

        try {
            MultiPartOutputStream outputStream = streams.get(0);
            // Write data to the specific file manager
            processedRows = this.fileManager.writeData(outputStream, resultSet, taskId, null);
            outputStream.close();
        } catch (Exception e) {
            // Aborts all uploads
            throw manager.abort(e);
        }

        // Finishing off
        manager.complete();
        return processedRows;

    }
Load ReplicaDB custom options for Amazon S3
src/main/java/org/replicadb/manager/S3Manager.java