Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ProActive
scheduling
Commits
a7cf51e4
Unverified
Commit
a7cf51e4
authored
Jul 18, 2020
by
Fabien Viale
Committed by
GitHub
Jul 18, 2020
Browse files
Merge pull request #21 from ow2-proactive/master
synchronize fork
parents
3b3de1bf
b67f2c8d
Changes
8
Hide whitespace changes
Inline
Side-by-side
config/pca/database.properties
0 → 100644
View file @
a7cf51e4
# Database connection settings.
# To change the database provider, change the driver (hibernate.connection.driver_class),
# the URL (hibernate.connection.url), and don't forget the dialect (hibernate.dialect)
hibernate.connection.driver_class
=
org.hsqldb.jdbc.JDBCDriver
hibernate.connection.url
=
jdbc:hsqldb:hsql://localhost:9001/pca
hibernate.dialect
=
org.hibernate.dialect.HSQLDialect
# Username and password
hibernate.connection.username
=
pca
hibernate.connection.password
=
# The classname of a custom org.hibernate.connection.ConnectionProvider which provides JDBC connections to Hibernate
hibernate.connection.provider_class
=
org.hibernate.hikaricp.internal.HikariCPConnectionProvider
# JDBC connection pool configuration
# https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby
hibernate.hikari.connectionTimeout
=
60000
hibernate.hikari.maximumPoolSize
=
20
hibernate.hikari.transactionIsolation
=
TRANSACTION_READ_COMMITTED
hibernate.hikari.poolName
=
pca
# Enable Hibernate's automatic session context management
hibernate.current_session_context_class
=
thread
# Disable the second-level cache
hibernate.cache.use_second_level_cache
=
false
# Echo all executed SQL to stdout
hibernate.show_sql
=
false
# Behavior of the database schema on startup : validate | update | create | create-drop
hibernate.hbm2ddl.auto
=
update
# Use stream method for binary object: use to store bigger object
hibernate.jdbc.use_streams_for_binary
=
true
scheduler/scheduler-server/src/main/java/org/ow2/proactive/scheduler/util/SchedulerHsqldbStarter.java
View file @
a7cf51e4
...
...
@@ -54,6 +54,8 @@ public class SchedulerHsqldbStarter {
private
Path
hibernateCatalogConfiguration
;
private
Path
hibernatePcaConfiguration
;
public
SchedulerHsqldbStarter
()
throws
IOException
{
this
.
hsqldbServer
=
createHsqldbServer
();
configureCatalogs
(
hsqldbServer
,
schedulerHome
);
...
...
@@ -102,10 +104,13 @@ public class SchedulerHsqldbStarter {
"catalog"
,
databaseFileName
);
hibernatePcaConfiguration
=
Paths
.
get
(
schedulerHome
,
schedulerConfigurationFolderName
,
"pca"
,
databaseFileName
);
server
.
addCatalog
(
schedulerDbPath
,
hibernateRmConfiguration
);
server
.
addCatalog
(
schedulerDbPath
,
hibernateSchedulerConfiguration
);
server
.
addCatalog
(
schedulerDbPath
,
hibernateNotificationServiceConfiguration
);
server
.
addCatalog
(
schedulerDbPath
,
hibernateCatalogConfiguration
);
server
.
addCatalog
(
schedulerDbPath
,
hibernatePcaConfiguration
);
}
public
boolean
isServerModeRequired
()
throws
IOException
{
...
...
scheduler/scheduler-server/src/test/java/org/ow2/proactive/scheduler/util/SchedulerHsqldbStarterTest.java
View file @
a7cf51e4
...
...
@@ -59,11 +59,11 @@ public class SchedulerHsqldbStarterTest extends ProActiveTestClean {
@Test
public
void
testConfigureCatalogs
()
throws
Exception
{
verify
(
hsqldbServerMock
,
times
(
4
)).
addCatalog
(
Mockito
.<
Path
>
any
(),
Mockito
.<
Path
>
any
());
verify
(
hsqldbServerMock
,
times
(
5
)).
addCatalog
(
Mockito
.<
Path
>
any
(),
Mockito
.<
Path
>
any
());
schedulerHsqldbStarter
.
configureCatalogs
(
hsqldbServerMock
,
"/scheduler/home/"
);
verify
(
hsqldbServerMock
,
times
(
8
)).
addCatalog
(
Mockito
.<
Path
>
any
(),
Mockito
.<
Path
>
any
());
verify
(
hsqldbServerMock
,
times
(
10
)).
addCatalog
(
Mockito
.<
Path
>
any
(),
Mockito
.<
Path
>
any
());
}
@Test
...
...
tools/hsqldb-connection/db-connect.bat
0 → 100755
View file @
a7cf51e4
@rem ##########################################################################
@rem
@rem A Simple Shell Command To access HSQLDB CLI and connect by default to scheduler DB
@rem If you would like to connect to another ProActive DB, please configure the sqltool.rc file before running the script
@rem
@rem ##########################################################################
set
DIRNAME
=
%~dp0
if
"
%DIRNAME%
"
==
""
set
DIRNAME
=
.
set
APP_BASE_NAME
=
%~n0
set
APP_HOME
=
%DIRNAME%
..
@rem================================================
IF
exist
"
%APP_HOME%
/jre"
(
set
JAVA_HOME
=
"
%APP_HOME%
/jre"
)
@rem================================================
@rem Find java.exe
if
defined
JAVA_HOME
goto
findJavaFromJavaHome
set
JAVA_EXE
=
java
.exe
%JAVA_EXE%
-version
>
NUL
2
>&
1
if
"
%ERRORLEVEL%
"
==
"0"
goto
execute
echo
.
echo
ERROR
:
JAVA_HOME
is
not
set
and
no
'java'
command
could
be
found
in
your
PATH
.
echo
.
echo
Please
set
the
JAVA_HOME
variable
in
your
environment
to
match
the
echo
location
of
your
Java
installation
.
:findJavaFromJavaHome
set
JAVA_HOME
=
%JAVA
_HOME:
"=
%
set JAVA_EXE=
%JAVA_HOME%
/bin/java.exe
if exist "
%JAVA_EXE%
" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory:
%JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
:execute
@rem Execute DB connection script
"
%JAVA_EXE%
" -jar sqltool-2.4.1.jar --rcFile=sqltool.rc scheduler
tools/hsqldb-connection/db-connect.sh
0 → 100755
View file @
a7cf51e4
#!/usr/bin/env bash
##############################################################################
##
## A Simple Shell Command To access HSQLDB CLI and connect by default to scheduler DB
## If you would like to connect to another ProActive DB, please configure the sqltool.rc file before running the script
##
##############################################################################
SAVED
=
"
`
pwd
`
"
cd
"
`
dirname
\"
$PRG
\"
`
/.."
>
&-
APP_HOME
=
"
`
pwd
-P
`
"
cd
"
$SAVED
"
>
&-
################################################################
# if local JVM exists redefine JAVA_HOME
if
[
-d
"
$APP_HOME
/jre"
]
;
then
JAVA_HOME
=
$APP_HOME
/jre
if
[
-d
"
$APP_HOME
/jre/Contents/Home"
]
;
then
# macos
JAVA_HOME
=
$APP_HOME
/jre/Contents/Home
fi
fi
################################################################
# Determine the Java command to use to start the JVM.
if
[
-n
"
$JAVA_HOME
"
]
;
then
if
[
-x
"
$JAVA_HOME
/jre/sh/java"
]
;
then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD
=
"
$JAVA_HOME
/jre/sh/java"
else
JAVACMD
=
"
$JAVA_HOME
/bin/java"
fi
if
[
!
-x
"
$JAVACMD
"
]
;
then
die
"ERROR: JAVA_HOME is set to an invalid directory:
$JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD
=
"java"
which java
>
/dev/null 2>&1
||
die
"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
exec
"
$JAVACMD
"
-jar
sqltool-2.4.1.jar
--rcFile
=
sqltool.rc scheduler
tools/hsqldb-connection/hsqldb-2.4.1.jar
0 → 100644
View file @
a7cf51e4
File added
tools/hsqldb-connection/sqltool-2.4.1.jar
0 → 100644
View file @
a7cf51e4
File added
tools/hsqldb-connection/sqltool.rc
0 → 100644
View file @
a7cf51e4
urlid scheduler
url jdbc:hsqldb:hsql://localhost:9001/scheduler
username scheduler
password
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment