@@ -49,30 +49,30 @@ enum Keys {
49
49
TaskConfig (Map <String , String > props ) {
50
50
this .props = props ;
51
51
52
- region = Regions .fromName (getConfig (Keys .REGION ));
53
- accessKeyId = getConfig (Keys .ACCESS_KEY_ID , "" );
54
- secretKey = getConfig (Keys .SECRET_KEY , "" );
55
- topicFormat = getConfig (Keys .TOPIC_FORMAT );
56
- shards = Arrays .stream (getConfig (Keys .SHARDS ).split ("," )).filter (shardId -> !shardId .isEmpty ()).collect (Collectors .toList ());
52
+ region = Regions .fromName (getValue (Keys .REGION ));
53
+ accessKeyId = getValue (Keys .ACCESS_KEY_ID , "" );
54
+ secretKey = getValue (Keys .SECRET_KEY , "" );
55
+ topicFormat = getValue (Keys .TOPIC_FORMAT );
56
+ shards = Arrays .stream (getValue (Keys .SHARDS ).split ("," )).filter (shardId -> !shardId .isEmpty ()).collect (Collectors .toList ());
57
57
}
58
58
59
59
String tableForShard (String shardId ) {
60
- return getConfig (shardId + "." + Keys .TABLE );
60
+ return getValue (shardId + "." + Keys .TABLE );
61
61
}
62
62
63
63
String streamArnForShard (String shardId ) {
64
- return getConfig (shardId + "." + Keys .STREAM_ARN );
64
+ return getValue (shardId + "." + Keys .STREAM_ARN );
65
65
}
66
66
67
- private String getConfig (String key ) {
67
+ private String getValue (String key ) {
68
68
final String value = props .get (key );
69
69
if (value == null ) {
70
70
throw new ConfigException (key , "Missing task configuration" );
71
71
}
72
72
return value ;
73
73
}
74
74
75
- private String getConfig (String key , String defaultValue ) {
75
+ private String getValue (String key , String defaultValue ) {
76
76
return props .getOrDefault (key , defaultValue );
77
77
}
78
78
0 commit comments