Skip to content

Commit 44af491

Browse files
committed
Removed unnecessary code that already existed in main
1 parent 78f8e3a commit 44af491

File tree

3 files changed

+34
-43
lines changed

3 files changed

+34
-43
lines changed

nifi-extension-bundles/nifi-iceberg-bundle/nifi-iceberg-aws/src/main/java/org/apache/nifi/services/iceberg/aws/S3IcebergFileIOProvider.java

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -103,39 +103,35 @@ public class S3IcebergFileIOProvider extends AbstractControllerService implement
103103
)
104104
.build();
105105

106-
static final PropertyDescriptor ENDPOINT = new PropertyDescriptor.Builder()
107-
.name("Endpoint")
108-
.description("Endpoint Override URL, use for on-premise s3 compactible solutions")
106+
static final PropertyDescriptor ENDPOINT_URL = new PropertyDescriptor.Builder()
107+
.name("Endpoint URL")
108+
.description("""
109+
Endpoint URL to use instead of the AWS default including scheme, host, port, and path.
110+
The AWS libraries select an endpoint URL based on the AWS region, but this property overrides
111+
the selected endpoint URL, allowing use with other S3-compatible endpoints.""")
109112
.required(false)
110-
.addValidator(StandardValidators.URI_VALIDATOR)
111-
.dependsOn(
112-
AUTHENTICATION_STRATEGY,
113-
AuthenticationStrategy.BASIC_CREDENTIALS
114-
)
113+
.addValidator(StandardValidators.URL_VALIDATOR)
115114
.build();
116115

117-
static final PropertyDescriptor PATH_STYLE_ACCESS = new PropertyDescriptor.Builder()
116+
static final PropertyDescriptor PATH_STYLE_ACCESS = new PropertyDescriptor.Builder()
118117
.name("Path Style Access")
119-
.description("Path Style Access, use for on-premise s3 compactible solutions")
118+
.description("""
119+
Path-style access can be enforced by setting this property to true. Set it to true if the configured
120+
endpoint does not support virtual-hosted-style requests, only path-style requests.""")
121+
.allowableValues(Boolean.TRUE.toString(), Boolean.FALSE.toString())
122+
.defaultValue(String.valueOf(S3FileIOProperties.PATH_STYLE_ACCESS_DEFAULT))
120123
.required(true)
121124
.addValidator(StandardValidators.BOOLEAN_VALIDATOR)
122-
.allowableValues("true", "false")
123-
.defaultValue(String.valueOf(S3FileIOProperties.PATH_STYLE_ACCESS_DEFAULT))
124-
.dependsOn(
125-
AUTHENTICATION_STRATEGY,
126-
AuthenticationStrategy.BASIC_CREDENTIALS
127-
)
128125
.build();
129126

130127
static final PropertyDescriptor STORAGE_CLASS = new PropertyDescriptor.Builder()
131128
.name("Storage Class")
132-
.description("Storage Class, use for on-premise s3 compactible solutions")
133-
.required(false)
129+
.description("""
130+
Specifies the S3 storage class to use when writing objects.
131+
Primarily intended for on-premises or S3-compatible object storage implementations.""")
132+
.required(true)
134133
.allowableValues(StorageClass.values())
135-
.dependsOn(
136-
AUTHENTICATION_STRATEGY,
137-
AuthenticationStrategy.BASIC_CREDENTIALS
138-
)
134+
.defaultValue(String.valueOf(StorageClass.STANDARD))
139135
.build();
140136

141137
private static final List<PropertyDescriptor> PROPERTY_DESCRIPTORS = List.of(
@@ -144,7 +140,7 @@ public class S3IcebergFileIOProvider extends AbstractControllerService implement
144140
SECRET_ACCESS_KEY,
145141
SESSION_TOKEN,
146142
CLIENT_REGION,
147-
ENDPOINT,
143+
ENDPOINT_URL,
148144
PATH_STYLE_ACCESS,
149145
STORAGE_CLASS
150146
);
@@ -189,22 +185,24 @@ private Map<String, String> getConfiguredProperties(final ConfigurationContext c
189185

190186
final String accessKeyId = context.getProperty(ACCESS_KEY_ID).getValue();
191187
final String secretAccessKey = context.getProperty(SECRET_ACCESS_KEY).getValue();
192-
final String endpoint = context.getProperty(ENDPOINT).getValue();
193-
final String pathStyleAccess = context.getProperty(PATH_STYLE_ACCESS).getValue();
194-
final String storageCLass = context.getProperty(STORAGE_CLASS).getValue();
195-
196188
contextProperties.put(S3FileIOProperties.ACCESS_KEY_ID, accessKeyId);
197189
contextProperties.put(S3FileIOProperties.SECRET_ACCESS_KEY, secretAccessKey);
198-
contextProperties.put(S3FileIOProperties.ENDPOINT, endpoint);
199-
contextProperties.put(S3FileIOProperties.PATH_STYLE_ACCESS, pathStyleAccess);
200-
contextProperties.put(S3FileIOProperties.WRITE_STORAGE_CLASS, storageCLass);
201190

202191
if (AuthenticationStrategy.SESSION_CREDENTIALS == authenticationStrategy) {
203192
final String sessionToken = context.getProperty(SESSION_TOKEN).getValue();
204193
contextProperties.put(S3FileIOProperties.SESSION_TOKEN, sessionToken);
205194
}
206195
}
207196

197+
if (context.getProperty(ENDPOINT_URL).isSet()) {
198+
final String endpoint = context.getProperty(ENDPOINT_URL).getValue();
199+
contextProperties.put(S3FileIOProperties.ENDPOINT, endpoint);
200+
}
201+
final String pathStyleAccess = context.getProperty(PATH_STYLE_ACCESS).getValue();
202+
contextProperties.put(S3FileIOProperties.PATH_STYLE_ACCESS, pathStyleAccess);
203+
204+
final String storageClass = context.getProperty(STORAGE_CLASS).getValue();
205+
contextProperties.put(S3FileIOProperties.WRITE_STORAGE_CLASS, storageClass);
208206
// HttpURLConnection Client Type avoids additional dependencies
209207
contextProperties.put(HttpClientProperties.CLIENT_TYPE, HttpClientProperties.CLIENT_TYPE_URLCONNECTION);
210208

@@ -214,4 +212,4 @@ private Map<String, String> getConfiguredProperties(final ConfigurationContext c
214212
final S3FileIOProperties ioProperties = new S3FileIOProperties(contextProperties);
215213
return ioProperties.properties();
216214
}
217-
}
215+
}

nifi-extension-bundles/nifi-iceberg-bundle/nifi-iceberg-aws/src/test/java/org/apache/nifi/services/iceberg/aws/S3IcebergFileIOProviderTest.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ class S3IcebergFileIOProviderTest {
4747

4848
private static final String SESSION_TOKEN = "SessionToken";
4949

50-
private static final String ENDPOINT = "Endpoint";
51-
52-
private static final String PATH_STYLE_ACCESS = "PathStyleAccess";
53-
54-
private static final String STORAGE_CLASS = "StorageClass";
55-
5650
private TestRunner runner;
5751

5852
private S3IcebergFileIOProvider provider;
@@ -88,9 +82,6 @@ void testGetFileIOSessionCredentials() {
8882
runner.setProperty(provider, S3IcebergFileIOProvider.SECRET_ACCESS_KEY, SECRET_ACCESS_KEY);
8983
runner.setProperty(provider, S3IcebergFileIOProvider.SESSION_TOKEN, SESSION_TOKEN);
9084
runner.setProperty(provider, S3IcebergFileIOProvider.CLIENT_REGION, CLIENT_REGION);
91-
runner.setProperty(provider, S3IcebergFileIOProvider.ENDPOINT, ENDPOINT);
92-
runner.setProperty(provider, S3IcebergFileIOProvider.PATH_STYLE_ACCESS, PATH_STYLE_ACCESS);
93-
runner.setProperty(provider, S3IcebergFileIOProvider.STORAGE_CLASS, STORAGE_CLASS);
9485

9586
runner.enableControllerService(provider);
9687

@@ -105,9 +96,6 @@ void testGetFileIOSessionCredentials() {
10596
assertEquals(SECRET_ACCESS_KEY, configuredProperties.get(S3FileIOProperties.SECRET_ACCESS_KEY));
10697
assertEquals(SESSION_TOKEN, configuredProperties.get(S3FileIOProperties.SESSION_TOKEN));
10798
assertEquals(CLIENT_REGION, configuredProperties.get(AwsClientProperties.CLIENT_REGION));
108-
assertEquals(ENDPOINT, configuredProperties.get(S3FileIOProperties.ENDPOINT));
109-
assertEquals(PATH_STYLE_ACCESS, configuredProperties.get(S3FileIOProperties.PATH_STYLE_ACCESS));
110-
assertEquals(STORAGE_CLASS, configuredProperties.get(S3FileIOProperties.WRITE_STORAGE_CLASS));
11199
}
112100
}
113101

nifi-extension-bundles/nifi-iceberg-bundle/nifi-iceberg-parquet-writer/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
<groupId>org.apache.iceberg</groupId>
5151
<artifactId>iceberg-parquet</artifactId>
5252
</dependency>
53+
<!-- Iceberg Data dependencies -->
54+
<dependency>
55+
<groupId>org.apache.iceberg</groupId>
56+
<artifactId>iceberg-data</artifactId>
57+
</dependency>
5358
<!-- Override Parquet version from iceberg-parquet -->
5459
<dependency>
5560
<groupId>org.apache.parquet</groupId>

0 commit comments

Comments
 (0)