File tree Expand file tree Collapse file tree 3 files changed +28
-7
lines changed
src/main/scala/za/co/absa/hyperdrive/trigger/api/rest Expand file tree Collapse file tree 3 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 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>
144145 </dependencyManagement >
145146
146147 <dependencies >
148+
147149 <dependency >
148150 <groupId >org.apache.logging.log4j</groupId >
149151 <artifactId >log4j-api</artifactId >
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 >
Original file line number Diff line number Diff line change 1-
21/*
32 * Copyright 2018 ABSA Group Limited
43 *
1716package za .co .absa .hyperdrive .trigger .api .rest
1817
1918import 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
2326class 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}
Original file line number Diff line number Diff 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 ] {
You can’t perform that action at this time.
0 commit comments