Skip to content

Commit ee0e5c2

Browse files
authored
S3a support for ingestion status (#816)
* S3a support for ingestion status * Formatting
1 parent 262b51d commit ee0e5c2

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

pom.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@
113113
<hibernate.validator.version>6.2.0.Final</hibernate.validator.version>
114114
<aws.java.sdk.bom.version>1.12.29</aws.java.sdk.bom.version>
115115
<absa.commons.version>1.0.3</absa.commons.version>
116-
116+
<hadoop-aws.version>2.7.3.2.6.1.0-129</hadoop-aws.version>
117+
<aws-java-sdk-bundle.version>1.11.375</aws-java-sdk-bundle.version>
117118
<!-- Deployment -->
118119
<gpg.plugin.version>1.6</gpg.plugin.version>
119120
<nexus.staging.plugin.version>1.6.8</nexus.staging.plugin.version>
@@ -144,6 +145,7 @@
144145
</dependencyManagement>
145146

146147
<dependencies>
148+
147149
<dependency>
148150
<groupId>org.apache.logging.log4j</groupId>
149151
<artifactId>log4j-api</artifactId>
@@ -442,6 +444,16 @@
442444
<version>${absa.commons.version}</version>
443445
<scope>test</scope>
444446
</dependency>
447+
<dependency>
448+
<groupId>org.apache.hadoop</groupId>
449+
<artifactId>hadoop-aws</artifactId>
450+
<version>${hadoop-aws.version}</version>
451+
</dependency>
452+
<dependency>
453+
<groupId>com.amazonaws</groupId>
454+
<artifactId>aws-java-sdk-bundle</artifactId>
455+
<version>${aws-java-sdk-bundle.version}</version>
456+
</dependency>
445457
</dependencies>
446458
<build>
447459
<resources>

src/main/scala/za/co/absa/hyperdrive/trigger/api/rest/WebMvcConfig.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* Copyright 2018 ABSA Group Limited
43
*
@@ -17,11 +16,21 @@
1716
package za.co.absa.hyperdrive.trigger.api.rest
1817

1918
import org.springframework.context.annotation.Configuration
20-
import org.springframework.web.servlet.config.annotation.{ViewControllerRegistry, WebMvcConfigurer}
19+
import org.springframework.web.servlet.config.annotation.{
20+
AsyncSupportConfigurer,
21+
ViewControllerRegistry,
22+
WebMvcConfigurer
23+
}
2124

2225
@Configuration
2326
class WebMvcConfig extends WebMvcConfigurer {
2427
override def addViewControllers(registry: ViewControllerRegistry): Unit = {
2528
registry.addViewController("/").setViewName("forward:/index.html")
2629
}
30+
31+
override def configureAsyncSupport(configurer: AsyncSupportConfigurer): Unit = {
32+
val timeout: Long = 3 * 60 * 1000
33+
super.configureAsyncSupport(configurer)
34+
configurer.setDefaultTimeout(timeout)
35+
}
2736
}

src/main/scala/za/co/absa/hyperdrive/trigger/api/rest/services/HdfsService.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ class HdfsServiceImpl extends HdfsService with LazyLogging {
4444
override def exists(path: Path)(implicit ugi: UserGroupInformation): Try[Boolean] = {
4545
Try {
4646
doAs {
47-
fs.exists(path)
47+
fs(path).exists(path)
4848
}
4949
}
5050
}
5151

5252
override def open(path: Path)(implicit ugi: UserGroupInformation): Try[FSDataInputStream] = {
5353
Try {
5454
doAs {
55-
fs.open(path)
55+
fs(path).open(path)
5656
}
5757
}
5858
}
@@ -62,7 +62,7 @@ class HdfsServiceImpl extends HdfsService with LazyLogging {
6262
): Try[Array[FileStatus]] = {
6363
Try {
6464
doAs {
65-
fs.listStatus(path, filter)
65+
fs(path).listStatus(path, filter)
6666
}
6767
}
6868
}
@@ -105,7 +105,7 @@ class HdfsServiceImpl extends HdfsService with LazyLogging {
105105
/**
106106
* Must not be a lazy val, because different users should get different FileSystems. FileSystem is cached internally.
107107
*/
108-
private def fs = FileSystem.get(conf)
108+
private def fs(path: Path) = path.getFileSystem(conf)
109109

110110
private def doAs[T](fn: => T)(implicit ugi: UserGroupInformation) = {
111111
ugi.doAs(new PrivilegedExceptionAction[T] {

0 commit comments

Comments
 (0)