Compare commits

..

29 commits
v2.4.3 ... main

Author SHA1 Message Date
4f16842623
Merge pull request #28 from rasilon/dependabot/maven/org.apache.logging.log4j-log4j-core-2.25.3
Bump org.apache.logging.log4j:log4j-core from 2.17.1 to 2.25.3
2025-12-30 01:16:49 +00:00
dependabot[bot]
d2257f1b81
Bump org.apache.logging.log4j:log4j-core from 2.17.1 to 2.25.3
Bumps org.apache.logging.log4j:log4j-core from 2.17.1 to 2.25.3.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-version: 2.25.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-19 22:49:23 +00:00
8ab5b1b79e
Merge pull request #27 from rasilon/dependabot/maven/org.apache.commons-commons-lang3-3.18.0
Bump org.apache.commons:commons-lang3 from 3.9 to 3.18.0
2025-08-12 14:54:56 +01:00
dependabot[bot]
26d47f16c9
Bump org.apache.commons:commons-lang3 from 3.9 to 3.18.0
Bumps org.apache.commons:commons-lang3 from 3.9 to 3.18.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-lang3
  dependency-version: 3.18.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-12 02:04:46 +00:00
9f0fe6bb3b Security; update dependencies 2025-06-03 09:23:29 +01:00
bf4ed02af5 Merge branch 'main' of github.com:rasilon/ujetl 2025-06-03 08:39:23 +01:00
5f275b93d8
Merge pull request #26 from rasilon/dependabot/maven/commons-beanutils-commons-beanutils-1.11.0
Bump commons-beanutils:commons-beanutils from 1.9.4 to 1.11.0
2025-06-02 15:00:35 +01:00
dependabot[bot]
d509513084
Bump commons-beanutils:commons-beanutils from 1.9.4 to 1.11.0
Bumps commons-beanutils:commons-beanutils from 1.9.4 to 1.11.0.

---
updated-dependencies:
- dependency-name: commons-beanutils:commons-beanutils
  dependency-version: 1.11.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-28 18:01:36 +00:00
96e28a5abb Merge branch 'dev' 2024-04-17 14:22:30 +01:00
1da5fabb05 Update version for dep updates 2024-04-17 14:22:03 +01:00
8a4d892dfa
Merge pull request #25 from rasilon/dependabot/maven/org.apache.commons-commons-configuration2-2.10.1
Bump org.apache.commons:commons-configuration2 from 2.8.0 to 2.10.1
2024-03-21 19:47:15 +00:00
dependabot[bot]
07f68922b3
Bump org.apache.commons:commons-configuration2 from 2.8.0 to 2.10.1
Bumps org.apache.commons:commons-configuration2 from 2.8.0 to 2.10.1.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-configuration2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-21 19:15:25 +00:00
22af36b555
Merge pull request #24 from rasilon/dependabot/maven/org.postgresql-postgresql-42.7.2
Bump org.postgresql:postgresql from 42.4.3 to 42.7.2
2024-02-21 12:20:28 +00:00
dependabot[bot]
d0a5075191
Bump org.postgresql:postgresql from 42.4.3 to 42.7.2
Bumps [org.postgresql:postgresql](https://github.com/pgjdbc/pgjdbc) from 42.4.3 to 42.7.2.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/commits)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-21 00:12:25 +00:00
1ce7e09751
Merge pull request #23 from rasilon/dev
Fix log file param
2023-07-12 09:49:06 +01:00
f651fd720e Fix log file param 2023-07-12 09:47:21 +01:00
58b78b2021
Merge pull request #22 from rasilon/dev
New Features
2023-07-12 08:58:52 +01:00
a88ac56848 Correct test name; CnP error 2023-07-12 08:48:21 +01:00
9a8716f33e Add the real implementation 2023-07-12 08:45:48 +01:00
1b1ba551c8 Add forced driver loading 2023-07-11 15:04:33 +01:00
866d02fb52 Change how log4j finds its config.
log4j is reacting less well to reconfigurations, so this moves the config file location to earlier in the process, so that no class sees an unconfigured instance.
2023-07-11 14:07:37 +01:00
441b2f4191
Merge pull request #21 from rasilon/dev
Script the docker tagging
2023-07-11 13:51:38 +01:00
b81aedefb1 Script te docker tagging 2023-07-11 13:21:04 +01:00
584f83de0d
Merge pull request #20 from rasilon/dev
H2 security update
2023-07-11 12:50:27 +01:00
4d38679155 bump minor version with H2 update 2023-07-11 12:49:34 +01:00
b378189512 Update default log config location 2023-07-11 12:36:44 +01:00
49487a83af Update unit test syntax to the current version of H2 2023-07-11 12:33:48 +01:00
9f4729bf1d
Merge pull request #19 from rasilon/dependabot/maven/com.h2database-h2-2.2.220
Bump h2 from 2.1.210 to 2.2.220
2023-07-11 11:08:12 +01:00
dependabot[bot]
2126553e5c
Bump h2 from 2.1.210 to 2.2.220
Bumps [h2](https://github.com/h2database/h2database) from 2.1.210 to 2.2.220.
- [Release notes](https://github.com/h2database/h2database/releases)
- [Commits](https://github.com/h2database/h2database/compare/version-2.1.210...version-2.2.220)

---
updated-dependencies:
- dependency-name: com.h2database:h2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-07 21:54:12 +00:00
14 changed files with 105 additions and 33 deletions

View file

@ -1,2 +1,3 @@
#!/bin/bash #!/bin/bash
docker build --target deploy -t rasilon/ujetl docker/multistage docker build --target deploy -t rasilon/ujetl docker/multistage
docker tag rasilon/ujetl:latest rasilon/ujetl:$(xpath -q -e '/project/version/text()' pom.xml)

4
build_util/push_docker_images Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
docker push rasilon/ujetl:latest
docker push rasilon/ujetl:$(xpath -q -e '/project/version/text()' pom.xml)

View file

@ -4,6 +4,11 @@
<nRowsToLog>10000</nRowsToLog> <nRowsToLog>10000</nRowsToLog>
<blockSize>1000</blockSize> <blockSize>1000</blockSize>
<pollTimeout>500</pollTimeout> <pollTimeout>500</pollTimeout>
<drivers>
<driver>org.postgresql.Driver</driver>
<driver>org.relique.jdbc.csv.CsvDriver</driver>
</drivers>
<source> <source>
<dsn>jdbc:postgresql://testdb:5432/test</dsn> <dsn>jdbc:postgresql://testdb:5432/test</dsn>
<username>test</username> <username>test</username>

View file

@ -0,0 +1,4 @@
id,dat
1,banana
2,potato
3,nugget
1 id dat
2 1 banana
3 2 potato
4 3 nugget

View file

@ -44,10 +44,14 @@ CREATE TABLE denormalised_personalia(
lname text lname text
); );
CREATE TABLE test_csvjdbc(
id integer not null primary key,
dat text
);
GRANT SELECT ON ALL TABLES IN SCHEMA public TO test; GRANT SELECT ON ALL TABLES IN SCHEMA public TO test;
GRANT SELECT,INSERT,UPDATE ON denormalised_personalia TO test; GRANT SELECT,INSERT,UPDATE ON denormalised_personalia TO test;
\c postgres \c postgres
CREATE TABLE public.container_ready AS SELECT 1 FROM(VALUES(1)) AS a(a); CREATE TABLE public.container_ready AS SELECT 1 FROM(VALUES(1)) AS a(a);
GRANT SELECT ON public.container_ready TO TEST; GRANT SELECT ON public.container_ready TO TEST;

View file

@ -30,9 +30,9 @@ fi
/usr/bin/java \ /usr/bin/java \
-Xms1g \ -Xms1g \
-Xmx2g \ -Xmx2g \
-Dlog4j.configurationFile="$LOG_PROPS" \
-cp /usr/share/ujetl/lib/CopyingApp.jar \ -cp /usr/share/ujetl/lib/CopyingApp.jar \
com.rasilon.ujetl.CopyingApp \ com.rasilon.ujetl.CopyingApp \
--log4j "$LOG_PROPS" \
--config "/etc/ujetl/${JOBNAME}_config_live.xml" --config "/etc/ujetl/${JOBNAME}_config_live.xml"
#rm -f $LOCKFILE #rm -f $LOCKFILE

19
pom.xml
View file

@ -6,7 +6,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<groupId>com.rasilon.ujetl</groupId> <groupId>com.rasilon.ujetl</groupId>
<artifactId>CopyingApp</artifactId> <artifactId>CopyingApp</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>2.4.3</version> <version>2.5.2</version>
<name>uJETL</name> <name>uJETL</name>
<url>https://github.com/rasilon/ujetl</url> <url>https://github.com/rasilon/ujetl</url>
<properties> <properties>
@ -35,13 +35,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<version>2.1.210</version> <version>2.2.220</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.9</version> <version>3.18.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-logging</groupId> <groupId>commons-logging</groupId>
@ -51,12 +51,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId> <artifactId>commons-configuration2</artifactId>
<version>2.8.0</version> <version>2.10.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-beanutils</groupId> <groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId> <artifactId>commons-beanutils</artifactId>
<version>1.9.4</version> <version>1.11.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.beust</groupId> <groupId>com.beust</groupId>
@ -71,12 +71,17 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.17.1</version> <version>2.25.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId> <artifactId>postgresql</artifactId>
<version>42.4.3</version> <version>42.7.2</version>
</dependency>
<dependency>
<groupId>net.sourceforge.csvjdbc</groupId>
<artifactId>csvjdbc</artifactId>
<version>1.0.40</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View file

@ -34,10 +34,6 @@ public class CopyingApp {
public static void main(String[] args) { public static void main(String[] args) {
CopyingAppCommandParser cli = new CopyingAppCommandParser(args); CopyingAppCommandParser cli = new CopyingAppCommandParser(args);
LoggerContext context = (org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false); LoggerContext context = (org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false);
String log4jConfigLocation = cli.getLog4jConfigFile();
File file = new File(log4jConfigLocation);
context.setConfigLocation(file.toURI());
System.out.println("Config set from "+file.toURI());
CopyingApp app = new CopyingApp(cli); CopyingApp app = new CopyingApp(cli);
try { try {
@ -79,6 +75,7 @@ public class CopyingApp {
Configuration config = configs.xml(cli.getConfigFile()); Configuration config = configs.xml(cli.getConfigFile());
loadDrivers(config);
String hardLimitSeconds = config.getString("hardLimitSeconds"); String hardLimitSeconds = config.getString("hardLimitSeconds");
if(hardLimitSeconds != null) { if(hardLimitSeconds != null) {
TimeLimiter hardLimit = new TimeLimiter(Integer.decode(hardLimitSeconds).intValue(),true); TimeLimiter hardLimit = new TimeLimiter(Integer.decode(hardLimitSeconds).intValue(),true);
@ -108,14 +105,14 @@ public class CopyingApp {
log.info(String.format("%s - Setting Row count interval to default of 100 rows.",jobName)); log.info(String.format("%s - Setting Row count interval to default of 100 rows.",jobName));
} }
Integer pollTimeout = null; Integer pollTimeout = null;
try { try {
pollTimeout = new Integer(config.getString("pollTimeout")); pollTimeout = new Integer(config.getString("pollTimeout"));
log.info(String.format("%s - Setting Poll timeout to %s milliseconds", jobName, pollTimeout)); log.info(String.format("%s - Setting Poll timeout to %s milliseconds", jobName, pollTimeout));
} catch(Exception e) { } catch(Exception e) {
pollTimeout = new Integer(1000); // If we don't have a new setting, use the old default pollTimeout = new Integer(1000); // If we don't have a new setting, use the old default
log.info(String.format("%s - Setting poll timeout to default of 1 second.",jobName)); log.info(String.format("%s - Setting poll timeout to default of 1 second.",jobName));
} }
@ -151,7 +148,7 @@ public class CopyingApp {
pollTimeout, pollTimeout,
identifySourceSQL, identifySourceSQL,
identifyDestinationSQL identifyDestinationSQL
); );
j.start(); j.start();
j.join(); j.join();
@ -182,7 +179,7 @@ public class CopyingApp {
pollTimeout, pollTimeout,
identifySourceSQL, identifySourceSQL,
identifyDestinationSQL identifyDestinationSQL
); );
j.start(); j.start();
j.join(); j.join();
} else { } else {
@ -244,4 +241,21 @@ public class CopyingApp {
return c; return c;
} }
// Even with JDBC 4, some drivers don't play nicely with whatever
// the classloaders are up to. So this allows us to force it the
// old fashioned way, and works around the
// "But it works fine when it's the /only/ driver!"
// cross-database problem
private void loadDrivers(Configuration config) {
String[] drivers = config.get(String[].class, "drivers.driver");
for(String d:drivers) {
try {
Class.forName(d);
log.info("Preloaded driver "+d);
} catch(ClassNotFoundException e) {
log.error("Could not preload driver "+d,e);
}
}
}
} }

View file

@ -12,7 +12,7 @@ public class CopyingAppCommandParser {
private String configFile; private String configFile;
@Parameter(names = {"-log4j","--log4j"}, description = "Log4J config file for this run") @Parameter(names = {"-log4j","--log4j"}, description = "Log4J config file for this run")
private String log4jConfigFile = "/etc/ppl/default_log4j_config.properties"; private String log4jConfigFile = "/etc/ujetl/default_log4j_config.properties";
public CopyingAppCommandParser(String[] args) { public CopyingAppCommandParser(String[] args) {
super(); super();
@ -23,8 +23,4 @@ public class CopyingAppCommandParser {
return configFile; return configFile;
} }
public String getLog4jConfigFile() {
return log4jConfigFile;
}
} }

View file

@ -0,0 +1,37 @@
package com.rasilon.ujetl;
import org.apache.commons.configuration2.Configuration;
import org.apache.commons.configuration2.builder.fluent.Configurations;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.commons.beanutils.PropertyUtils; // Why does config need this?
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.MethodOrderer.Alphanumeric;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
/**
* @author derryh
*
*/
public class TestConfig {
@Test
public void test001VerifyArrayOfDrivers() {
try {
Configurations configs = new Configurations();
Configuration config = configs.xml("TEST_config_live.xml");
String[] drivers = config.get(String[].class, "drivers.driver");
int ndrivers =drivers.length;
if(ndrivers != 3){
fail("Expected 3 drivers, but found "+ndrivers);
}
} catch(Exception e) {
fail(e.toString());
}
}
}

View file

@ -42,7 +42,7 @@ public class TestJob {
dest, dest,
"jUnit Test Config", "jUnit Test Config",
"jUnit Test Job", "jUnit Test Job",
"SELECT -1 AS key", "SELECT -1 AS \"key\"",
"SELECT id,dat FROM src WHERE id > ?", "SELECT id,dat FROM src WHERE id > ?",
"INSERT INTO dest VALUES(?,?)", "INSERT INTO dest VALUES(?,?)",
null, null,

View file

@ -13,15 +13,12 @@ public class TestParser {
public void test001Parset() { public void test001Parset() {
try { try {
String[] args = { String[] args = {
"--log4j",
"log4j_test_banana.xml",
"--config", "--config",
"config_test_banana.xml" "config_test_banana.xml"
}; };
CopyingAppCommandParser p = new CopyingAppCommandParser(args); CopyingAppCommandParser p = new CopyingAppCommandParser(args);
assertEquals(p.getConfigFile(),"config_test_banana.xml"); assertEquals(p.getConfigFile(),"config_test_banana.xml");
assertEquals(p.getLog4jConfigFile(),"log4j_test_banana.xml");
} catch(Exception e) { } catch(Exception e) {
fail(e.toString()); fail(e.toString());

View file

@ -42,7 +42,7 @@ public class TestPrePost {
dest, dest,
"jUnit Test Config", "jUnit Test Config",
"jUnit Test Job", "jUnit Test Job",
"SELECT -1 AS key", "SELECT -1 AS \"key\"",
"SELECT id,dat FROM src WHERE id > ?", "SELECT id,dat FROM src WHERE id > ?",
"INSERT INTO tmp_dest VALUES(?,?)", "INSERT INTO tmp_dest VALUES(?,?)",
"CREATE TEMP TABLE tmp_dest(id bigint not null primary key, dat varchar);", "CREATE TEMP TABLE tmp_dest(id bigint not null primary key, dat varchar);",

View file

@ -4,6 +4,11 @@
<nRowsToLog>10000</nRowsToLog> <nRowsToLog>10000</nRowsToLog>
<blockSize>1000</blockSize> <blockSize>1000</blockSize>
<pollTimeout>500</pollTimeout> <pollTimeout>500</pollTimeout>
<drivers>
<driver>org.postgresql.Driver</driver>
<driver>org.h2.Driver</driver>
<driver>org.relique.jdbc.csv.CsvDriver</driver>
</drivers>
<source> <source>
<dsn>jdbc:postgresql://localhost:5432/test</dsn> <dsn>jdbc:postgresql://localhost:5432/test</dsn>
<username>test</username> <username>test</username>