1515
1616package io .confluent .connect .s3 ;
1717
18- import com .amazonaws .ClientConfiguration ;
19- import com .amazonaws .auth .AWSCredentialsProvider ;
20- import com .amazonaws .auth .AWSStaticCredentialsProvider ;
21- import com .amazonaws .auth .BasicAWSCredentials ;
22- import com .amazonaws .auth .DefaultAWSCredentialsProviderChain ;
23- import com .amazonaws .regions .RegionUtils ;
24- import com .amazonaws .regions .Regions ;
25- import com .amazonaws .services .s3 .model .CannedAccessControlList ;
26- import com .amazonaws .services .s3 .model .SSEAlgorithm ;
27- import io .confluent .connect .storage .common .util .StringUtils ;
28- import org .apache .kafka .common .Configurable ;
29- import org .apache .kafka .common .config .AbstractConfig ;
30- import org .apache .kafka .common .config .ConfigDef ;
31- import org .apache .kafka .common .config .ConfigDef .Importance ;
32- import org .apache .kafka .common .config .ConfigDef .Type ;
33- import org .apache .kafka .common .config .ConfigDef .Validator ;
34- import org .apache .kafka .common .config .ConfigDef .Width ;
35- import org .apache .kafka .common .config .ConfigException ;
36- import org .apache .kafka .common .config .types .Password ;
37- import org .apache .kafka .common .utils .Utils ;
38- import org .apache .kafka .connect .errors .ConnectException ;
39- import org .apache .kafka .connect .json .DecimalFormat ;
40- import org .apache .parquet .hadoop .metadata .CompressionCodecName ;
18+ import static org .apache .kafka .common .config .ConfigDef .Range .atLeast ;
4119
4220import java .util .ArrayList ;
4321import java .util .Arrays ;
5634import java .util .stream .IntStream ;
5735import java .util .zip .Deflater ;
5836
37+ import org .apache .kafka .common .Configurable ;
38+ import org .apache .kafka .common .config .AbstractConfig ;
39+ import org .apache .kafka .common .config .ConfigDef ;
40+ import org .apache .kafka .common .config .ConfigDef .Importance ;
41+ import org .apache .kafka .common .config .ConfigDef .Type ;
42+ import org .apache .kafka .common .config .ConfigDef .Validator ;
43+ import org .apache .kafka .common .config .ConfigDef .Width ;
44+ import org .apache .kafka .common .config .ConfigException ;
45+ import org .apache .kafka .common .config .types .Password ;
46+ import org .apache .kafka .common .utils .Utils ;
47+ import org .apache .kafka .connect .errors .ConnectException ;
48+ import org .apache .kafka .connect .json .DecimalFormat ;
49+ import org .apache .parquet .hadoop .metadata .CompressionCodecName ;
50+
51+ import com .amazonaws .ClientConfiguration ;
52+ import com .amazonaws .auth .AWSCredentialsProvider ;
53+ import com .amazonaws .auth .AWSStaticCredentialsProvider ;
54+ import com .amazonaws .auth .BasicAWSCredentials ;
55+ import com .amazonaws .auth .DefaultAWSCredentialsProviderChain ;
56+ import com .amazonaws .regions .Region ;
57+ import com .amazonaws .regions .RegionUtils ;
58+ import com .amazonaws .regions .Regions ;
59+ import com .amazonaws .services .s3 .model .CannedAccessControlList ;
60+ import com .amazonaws .services .s3 .model .SSEAlgorithm ;
61+
5962import io .confluent .connect .s3 .format .avro .AvroFormat ;
6063import io .confluent .connect .s3 .format .bytearray .ByteArrayFormat ;
6164import io .confluent .connect .s3 .format .json .JsonFormat ;
6770import io .confluent .connect .storage .common .GenericRecommender ;
6871import io .confluent .connect .storage .common .ParentValueRecommender ;
6972import io .confluent .connect .storage .common .StorageCommonConfig ;
73+ import io .confluent .connect .storage .common .util .StringUtils ;
7074import io .confluent .connect .storage .format .Format ;
7175import io .confluent .connect .storage .partitioner .DailyPartitioner ;
7276import io .confluent .connect .storage .partitioner .DefaultPartitioner ;
7579import io .confluent .connect .storage .partitioner .PartitionerConfig ;
7680import io .confluent .connect .storage .partitioner .TimeBasedPartitioner ;
7781
78- import static org .apache .kafka .common .config .ConfigDef .Range .atLeast ;
79-
8082public class S3SinkConnectorConfig extends StorageSinkConnectorConfig {
8183
8284 // S3 Group
@@ -1123,14 +1125,14 @@ public void ensureValid(String name, Object region) {
11231125 throw new ConfigException (
11241126 name ,
11251127 region ,
1126- "Value must be one of: " + Utils . join ( RegionUtils .getRegions (), ", " )
1128+ "Value must be one of: " + RegionUtils .getRegions (). stream (). map ( Region :: toString ). collect ( Collectors . joining ( ", " ) )
11271129 );
11281130 }
11291131 }
11301132
11311133 @ Override
11321134 public String toString () {
1133- return "[" + Utils . join ( RegionUtils .getRegions (), ", " ) + "]" ;
1135+ return "[" + RegionUtils .getRegions (). stream (). map ( Region :: toString ). collect ( Collectors . joining ( ", " ) ) + "]" ;
11341136 }
11351137 }
11361138
@@ -1144,7 +1146,7 @@ private static class CompressionTypeValidator implements ConfigDef.Validator {
11441146 TYPES_BY_NAME .put (compressionType .name , compressionType );
11451147 names .add (compressionType .name );
11461148 }
1147- ALLOWED_VALUES = Utils .join (names , ", " );
1149+ ALLOWED_VALUES = String .join (" , " , names );
11481150 }
11491151
11501152 @ Override
@@ -1220,7 +1222,7 @@ public void ensureValid(String name, Object compressionCodecName) {
12201222
12211223 @ Override
12221224 public String toString () {
1223- return "[" + Utils .join (ALLOWED_VALUES , ", " ) + "]" ;
1225+ return "[" + String .join (" , " , ALLOWED_VALUES ) + "]" ;
12241226 }
12251227 }
12261228
@@ -1234,7 +1236,7 @@ private static class CannedAclValidator implements ConfigDef.Validator {
12341236 ACLS_BY_HEADER_VALUE .put (acl .toString (), acl );
12351237 aclHeaderValues .add (acl .toString ());
12361238 }
1237- ALLOWED_VALUES = Utils .join (aclHeaderValues , ", " );
1239+ ALLOWED_VALUES = String .join (" , " , aclHeaderValues );
12381240 }
12391241
12401242 @ Override
0 commit comments