Skip to content

Commit

Permalink
Set hadoop home dir to appdata directory
Browse files Browse the repository at this point in the history
  • Loading branch information
pflooky committed Mar 21, 2024
1 parent e775cf6 commit 30e1a07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ Full docs can be found [**here**](https://data.catering).

1. [Mac download](https://nightly.link/data-catering/data-caterer/workflows/build/main/data-caterer-mac.zip)
2. [Windows download](https://nightly.link/data-catering/data-caterer/workflows/build/main/data-caterer-windows.zip)
1. After downloaded, go to 'Downloads' folder and 'Extract All'
1. After downloaded, go to 'Downloads' folder and 'Extract All' from data-caterer-windows
2. Double-click 'DataCaterer-1.0.0' to install Data Caterer
3. Go to '/Program Files/DataCaterer' folder and run DataCaterer application
4. If browser doesn't open, go to [http://localhost:9898](http://localhost:9898) in your preferred browser
3. Click on 'More info' then at the bottom, click 'Run anyway'
4. Go to '/Program Files/DataCaterer' folder and run DataCaterer application
5. If browser doesn't open, go to [http://localhost:9898](http://localhost:9898) in your preferred browser
3. [Linux download](https://nightly.link/data-catering/data-caterer/workflows/build/main/data-caterer-linux.zip)
4. Docker
```shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package io.github.datacatering.datacaterer.core.ui.config

import org.apache.log4j.Logger

import java.nio.file.Paths

object UiConfiguration {

private val LOGGER = Logger.getLogger(getClass.getName)
Expand All @@ -11,21 +13,21 @@ object UiConfiguration {
def getInstallDirectory: String = {
val osName = System.getProperty("os.name").toLowerCase
if (osName.contains("win")) {
setHadoopHome()
val appDataDir = System.getenv("APPDATA")
setHadoopHome(appDataDir)
s"$appDataDir/DataCaterer"
} else if (osName.contains("nix") || osName.contains("nux") || osName.contains("aix")) {
"/opt/DataCaterer"
} else if (osName.contains("mac")) {
"/Applications/DataCaterer.app"
"/Library/DataCaterer"
} else {
LOGGER.warn(s"Unknown operating system name, defaulting install directory to '/tmp/DataCaterer', os.name=$osName")
"/tmp/DataCaterer"
}
}

private def setHadoopHome(): Unit = {
System.setProperty("hadoop.home.dir", "/")
private def setHadoopHome(appDataDir: String): Unit = {
System.setProperty("hadoop.home.dir", s"$appDataDir/hadoop")
}

}

0 comments on commit 30e1a07

Please sign in to comment.