Skip to content

Commit ab76509

Browse files
committed
fix(ENGKNOW-3189): Add feature flags to control caching.
1 parent d0c4d6e commit ab76509

5 files changed

Lines changed: 10 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ jobs:
142142
files: '**/TEST-*.xml'
143143

144144
publishSnapshot:
145-
if: ${{ github.ref == 'refs/heads/main' }}
146-
needs: [test, slowTest, integrationTest]
145+
#if: ${{ github.ref == 'refs/heads/main' }}
146+
#needs: [test, slowTest, integrationTest]
147147
runs-on: ubuntu-latest
148148
steps:
149149
- uses: actions/checkout@v4

drivers/src/main/java/org/gorpipe/s3/driver/S3Source.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ public class S3Source implements StreamSource {
7070

7171
// software.amazon.nio.s3..aws-java-nio-spi-for-s3 only uses credentials from the default provider chain (can not specify creds
7272
// in the driver as we can for Carlspring). So we can not use it for multiple accounts (if using key and secret).
73-
private static final boolean USE_S3_CARLSPRING_FILESYSTEM = Boolean.parseBoolean(System.getProperty("gor.s3.use.carlspring.filesystem", "true"));
74-
private static final boolean USE_S3_FILESYSTEM_OUTPUTSTREAM = Boolean.parseBoolean(System.getProperty("gor.s3.use.filesystem.outputstream", "false"));
73+
private static final boolean USE_S3_CARLSPRING_FILESYSTEM = Boolean.parseBoolean(System.getProperty("gor.s3.carlspring.filesystem", "true"));
74+
private static final boolean USE_S3_FILESYSTEM_OUTPUTSTREAM = Boolean.parseBoolean(System.getProperty("gor.s3.filesystem.outputstream", "false"));
7575
// Use NIO filesystem where possible. Some S3 operations using the NIO filesystem are not supported by the OCI S3 compatibility layer.
7676
// TODP: Maybe we should create a OCIS3CompatSource.
7777
private static final boolean OCI_S3_COMPATIBLE = Boolean.parseBoolean(System.getProperty("gor.oci.s3.compatible", "true"));
7878

79-
private static final boolean USE_META_CACHE = true ;
79+
private static final boolean USE_META_CACHE = Boolean.parseBoolean(System.getProperty("gor.s3.meta.cache", "true")) ;
8080
protected final SourceReference sourceReference;
8181
protected final String bucket;
8282
protected final String key;

gortools/src/main/java/gorsat/Script/BaseScriptExecutionEngine.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,10 @@ public String getFileSignatureAndUpdateSignatureMap(GorSession session, String c
146146
var signatureKey = AnalysisUtilities.getSignatureFromSignatureCommand(session, commandToExecute);
147147
var fileListKey = String.join(" ", usedFiles);
148148

149-
boolean SIDE_EFFECTS_FORCE_RUN = Boolean.parseBoolean(System.getProperty("gor.gorpipe.sideeffects.force_run", "false"));
150-
if (usedFiles.stream().anyMatch(DataUtil::isYml)
151-
|| (SIDE_EFFECTS_FORCE_RUN && MacroUtilities.containsWriteCommand(commandToExecute))) {
149+
boolean sideEffectsForceRun = Boolean.parseBoolean(System.getProperty("gor.gorpipe.sideeffects.force_run", "false"));
150+
boolean ymlForceRun = Boolean.parseBoolean(System.getProperty("gor.gorpipe.yml.force_run", "true"));
151+
if (ymlForceRun && usedFiles.stream().anyMatch(DataUtil::isYml)
152+
|| (sideEffectsForceRun && MacroUtilities.containsWriteCommand(commandToExecute))) {
152153
// Cases were we always want to run the query:
153154
// 1. if any of the files is a template expansion, we treat this as if non-deterministic. We do not
154155
// model how expansion might depend on files and parameters.

gortools/src/main/scala/gorsat/process/GorPrePipe.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ object GorPrePipe {
4545
val availNorCommands: Array[String] = GorPipeCommands.getNorCommands ++ GorInputSources.getInputSources
4646

4747
private val supportedGorSQLFileEndings = Array[String](".json",".csv",".tsv",".gor",".gorz",".gor.gz",".gord",".txt",".vcf",".bgen",".parquet",".adam",".mt",".xml")
48-
private val commandsContainingInputSources = Array[String]("PARALLEL", "GOR","NOR","SPARK","MAP","MULTIMAP","INSET","MERGE","JOIN","LEFTJOIN","VARJOIN","GORIF", "NORIF"/*,"CSVSEL","CSVCC","GTGEN"*/)
48+
private val commandsContainingInputSources = Array[String]("PARALLEL", "GOR","NOR","SPARK","MAP","MULTIMAP","INSET","MERGE","JOIN","LEFTJOIN","VARJOIN","GORIF", "NORIF", "EXEC"/*,"CSVSEL","CSVCC","GTGEN"*/)
4949
val gorpred = (p: String) => supportedGorSQLFileEndings.map(e => p.toLowerCase.endsWith(e)).reduce((a,b) => a || b)
5050

5151
private def getCommandArgument(command: String) : Option[CommandArguments] = {

model/src/test/java/org/gorpipe/gor/driver/linkfile/LinkFileTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,4 @@ private ReuseStrategySetupResult setupReuseStrategyTest(LinkFileV1.LinkReuseStra
468468

469469
return new ReuseStrategySetupResult(linkFile, initialCount, latestBefore, newFile);
470470
}
471-
472-
473471
}

0 commit comments

Comments
 (0)