-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing parts of the query routing, adding version specific folders, n…
…ew modes
- Loading branch information
Showing
26 changed files
with
259 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
config/src/main/java/org/polypheny/db/util/PolyphenyMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright 2019-2023 The Polypheny Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.polypheny.db.util; | ||
|
||
public enum PolyphenyMode { | ||
PRODUCTION, | ||
DEVELOPMENT, | ||
TEST, | ||
BENCHMARK | ||
} |
69 changes: 69 additions & 0 deletions
69
config/src/main/java/org/polypheny/db/util/VersionCollector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright 2019-2023 The Polypheny Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.polypheny.db.util; | ||
|
||
|
||
import java.io.FileInputStream; | ||
import java.io.InputStream; | ||
import java.util.Properties; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
public class VersionCollector { | ||
|
||
|
||
public static final String VERSION = "version"; | ||
public static final String BRANCH = "branch"; | ||
public static VersionCollector INSTANCE = new VersionCollector(); | ||
|
||
private final Properties versionProperties = new Properties(); | ||
|
||
final String version; | ||
|
||
final String branch; | ||
|
||
public boolean inJar = false; | ||
|
||
|
||
private VersionCollector() { | ||
InputStream inputStream = getClass().getClassLoader().getResourceAsStream( "classpath:/version.properties" ); | ||
|
||
try { | ||
if ( inputStream == null ) { | ||
inJar = true; | ||
// When running unit tests, no jar is built, so we load a copy of the file that we saved during build.gradle. | ||
// Possibly this also is the case during debugging, therefore we save in bin/main instead of bin/test. | ||
inputStream = new FileInputStream( "bin/main/version.properties" ); | ||
} | ||
|
||
versionProperties.load( inputStream ); | ||
} catch ( Exception e ) { | ||
useDefaults(); | ||
} | ||
version = versionProperties.getProperty( VERSION ); | ||
branch = versionProperties.getProperty( BRANCH ); | ||
|
||
} | ||
|
||
|
||
private void useDefaults() { | ||
log.warn( "Using default version." ); | ||
versionProperties.put( VERSION, "default" ); | ||
versionProperties.put( BRANCH, "default" ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.