You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-18 13:54:11 +03:00
Merge branch 'develop' into rpm-simplify
This commit is contained in:
116
.drone.jsonnet
116
.drone.jsonnet
@@ -1,13 +1,11 @@
|
|||||||
local platforms = {
|
local platforms = {
|
||||||
develop: ['opensuse/leap:15', 'centos:7', 'centos:8', 'debian:9', 'debian:10', 'ubuntu:16.04', 'ubuntu:18.04', 'ubuntu:20.04'],
|
develop: ['opensuse/leap:15', 'centos:7', 'centos:8', 'debian:9', 'debian:10', 'ubuntu:16.04', 'ubuntu:18.04', 'ubuntu:20.04'],
|
||||||
proper_python: ['opensuse/leap:15', 'centos:7', 'centos:8', 'debian:9', 'debian:10', 'ubuntu:16.04', 'ubuntu:18.04', 'ubuntu:20.04'],
|
|
||||||
'develop-1.4': ['centos:7', 'centos:8', 'debian:9', 'debian:10', 'ubuntu:16.04', 'ubuntu:18.04', 'ubuntu:20.04'],
|
'develop-1.4': ['centos:7', 'centos:8', 'debian:9', 'debian:10', 'ubuntu:16.04', 'ubuntu:18.04', 'ubuntu:20.04'],
|
||||||
};
|
};
|
||||||
|
|
||||||
local codebase_map = {
|
local codebase_map = {
|
||||||
// "develop": "git clone --recurse-submodules --branch mariadb-10.5.3 --depth 1 https://github.com/MariaDB/server .",
|
// "develop": "git clone --recurse-submodules --branch mariadb-10.5.4 --depth 1 https://github.com/MariaDB/server .",
|
||||||
proper_python: 'git clone --recurse-submodules --branch drrtuy-10.5-cs --depth 1 https://github.com/MariaDB/server .',
|
develop: 'git clone --recurse-submodules --branch bb-10.5-release --depth 1 https://github.com/MariaDB/server .',
|
||||||
develop: 'git clone --recurse-submodules --branch bb-10.5-cs --depth 1 https://github.com/MariaDB/server .',
|
|
||||||
'develop-1.4': 'git clone --recurse-submodules --branch 10.4-enterprise --depth 1 https://github.com/mariadb-corporation/MariaDBEnterprise .',
|
'develop-1.4': 'git clone --recurse-submodules --branch 10.4-enterprise --depth 1 https://github.com/mariadb-corporation/MariaDBEnterprise .',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -21,7 +19,6 @@ local deb_build_deps = 'apt update && apt install --yes --no-install-recommends
|
|||||||
local platformMap(branch, platform) =
|
local platformMap(branch, platform) =
|
||||||
local branch_cmakeflags_map = {
|
local branch_cmakeflags_map = {
|
||||||
develop: ' -DBUILD_CONFIG=mysql_release -DWITH_WSREP=OFF',
|
develop: ' -DBUILD_CONFIG=mysql_release -DWITH_WSREP=OFF',
|
||||||
proper_python: ' -DBUILD_CONFIG=mysql_release -DWITH_WSREP=OFF',
|
|
||||||
'develop-1.4': ' -DBUILD_CONFIG=enterprise',
|
'develop-1.4': ' -DBUILD_CONFIG=enterprise',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -39,36 +36,89 @@ local platformMap(branch, platform) =
|
|||||||
platform_map[platform];
|
platform_map[platform];
|
||||||
|
|
||||||
local Pipeline(branch, platform, event) = {
|
local Pipeline(branch, platform, event) = {
|
||||||
|
local pkg_format = if (std.split(platform, ':')[0] == 'centos' || std.split(platform, ':')[0] == 'opensuse/leap') then 'rpm' else 'deb',
|
||||||
|
local init = if (pkg_format == 'rpm') then '/usr/lib/systemd/systemd' else 'systemd',
|
||||||
|
local img = if (std.split(platform, ':')[0] == 'centos') then platform else 'romcheck/' + std.strReplace(platform, '/', '-'),
|
||||||
|
|
||||||
local pipeline = self,
|
local pipeline = self,
|
||||||
_volumes:: {
|
_volumes:: {
|
||||||
mdb: {
|
mdb: {
|
||||||
name: 'mdb',
|
name: 'mdb',
|
||||||
path: '/mdb',
|
path: '/mdb',
|
||||||
},
|
},
|
||||||
|
docker: {
|
||||||
|
name: 'docker',
|
||||||
|
path: '/var/run/docker.sock',
|
||||||
},
|
},
|
||||||
tests:: {
|
},
|
||||||
name: 'tests',
|
smoke:: {
|
||||||
image: platform,
|
name: 'smoke',
|
||||||
|
image: 'docker',
|
||||||
|
volumes: [pipeline._volumes.docker],
|
||||||
commands: [
|
commands: [
|
||||||
(if platform == 'centos:7' then 'yum install -y sysvinit-tools' else ''),
|
'docker run -e DEBIAN_FRONTEND=noninteractive -e MCS_USE_S3_STORAGE=0 --name smoke --privileged --detach --volume /sys/fs/cgroup:/sys/fs/cgroup:ro ' + img + ' ' + init + ' --unit=basic.target',
|
||||||
(if platform == 'centos:8' then 'yum install -y diffutils' else ''),
|
'docker cp /drone/src/result smoke:/',
|
||||||
'yum install -y lz4 wget git rsyslog',
|
if (std.split(platform, ':')[0] == 'centos') then 'docker exec -t smoke bash -c "yum install -y git which rsyslog hostname && yum install -y /result/*.' + pkg_format + '"' else '',
|
||||||
"sed -i '/OmitLocalLogging/d' /etc/rsyslog.conf",
|
if (std.split(platform, ':')[0] == 'debian' || std.split(platform, ':')[0] == 'ubuntu') then 'docker exec -t smoke bash -c "apt update && apt install -y git rsyslog hostname && apt install -y -f /result/*.' + pkg_format + '"' else '',
|
||||||
"sed -i 's/off/on/' /etc/rsyslog.conf",
|
if (std.split(platform, '/')[0] == 'opensuse') then 'docker exec -t smoke bash -c "zypper install -y git which hostname rsyslog && zypper install -y --allow-unsigned-rpm /result/*.' + pkg_format + '"' else '',
|
||||||
'rm -f /etc/rsyslog.d/listen.conf',
|
// "docker exec -t smoke sed -i '/\\[mariadb\\]/a plugin_maturity=stable' /etc/" + (if pkg_format == 'deb' then 'mysql/mariadb.conf.d/50-' else 'my.cnf.d/') + 'server.cnf',
|
||||||
'rsyslogd',
|
'docker exec -t smoke systemctl start mariadb',
|
||||||
'yum install -y result/*.rpm',
|
'docker exec -t smoke systemctl start mariadb-columnstore',
|
||||||
'kill $(pidof rsyslogd) && while pidof rsyslogd; do sleep 2; done',
|
'docker exec -t smoke mysql -e "create database if not exists test; create table test.t1 (a int) engine=Columnstore; insert into test.t1 values (1); select * from test.t1"',
|
||||||
'rsyslogd',
|
'docker exec -t smoke systemctl restart mariadb',
|
||||||
'bash -o pipefail ./build/columnstore_startup.sh',
|
'docker exec -t smoke systemctl restart mariadb-columnstore',
|
||||||
'git clone --recurse-submodules --branch ' + branch + ' --depth 1 https://github.com/mariadb-corporation/mariadb-columnstore-regression-test',
|
'sleep 5',
|
||||||
'wget -qO- https://cspkg.s3.amazonaws.com/testData.tar.lz4 | lz4 -dc - | tar xf - -C mariadb-columnstore-regression-test/',
|
'docker exec -t smoke mysql -e "insert into test.t1 values (2); select * from test.t1"',
|
||||||
'cd mariadb-columnstore-regression-test/mysql/queries/nightly/alltest',
|
|
||||||
'./go.sh --sm_unit_test_dir=/drone/src/storage-manager' + (if event == 'pull_request' then ' --tests=test000.sh' else ''),
|
|
||||||
'cat go.log',
|
|
||||||
'test -f testErrorLogs.tgz && mv testErrorLogs.tgz /drone/src/result/ || echo no-errors-archive',
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
regression:: {
|
||||||
|
name: 'regression',
|
||||||
|
image: 'docker:git',
|
||||||
|
// failure: 'ignore',
|
||||||
|
volumes: [pipeline._volumes.docker, pipeline._volumes.mdb],
|
||||||
|
commands: [
|
||||||
|
'docker run -e DEBIAN_FRONTEND=noninteractive -e MCS_USE_S3_STORAGE=0 --name regression --privileged --detach --volume /sys/fs/cgroup:/sys/fs/cgroup:ro ' + img + ' ' + init + ' --unit=basic.target',
|
||||||
|
'docker cp /drone/src/result regression:/',
|
||||||
|
'docker cp /mdb/' + builddir + '/storage/columnstore/columnstore/storage-manager regression:/',
|
||||||
|
if (std.split(platform, ':')[0] == 'centos') then 'docker exec -t regression bash -c "yum install -y diffutils tar lz4 wget git which rsyslog hostname && yum install -y /result/*.' + pkg_format + '"' else '',
|
||||||
|
if (std.split(platform, ':')[0] == 'debian' || std.split(platform, ':')[0] == 'ubuntu') then 'docker exec -t regression bash -c "apt update && apt install -y tar liblz4-tool wget git rsyslog hostname && apt install -y -f /result/*.' + pkg_format + '"' else '',
|
||||||
|
if (std.split(platform, '/')[0] == 'opensuse') then 'docker exec -t regression bash -c "zypper install -y gzip tar lz4 wget git which hostname rsyslog && zypper install -y --allow-unsigned-rpm /result/*.' + pkg_format + '"' else '',
|
||||||
|
'docker exec -t regression systemctl start mariadb',
|
||||||
|
'docker exec -t regression systemctl start mariadb-columnstore',
|
||||||
|
'docker exec -t regression mysql -e "create database if not exists test; create table test.t1 (a int) engine=Columnstore; insert into test.t1 values (1); select * from test.t1"',
|
||||||
|
'git clone --recurse-submodules --branch ' + branch + ' --depth 1 https://github.com/mariadb-corporation/mariadb-columnstore-regression-test',
|
||||||
|
'docker cp mariadb-columnstore-regression-test regression:/',
|
||||||
|
'docker exec -t regression bash -c "wget -qO- https://cspkg.s3.amazonaws.com/testData.tar.lz4 | lz4 -dc - | tar xf - -C mariadb-columnstore-regression-test/"',
|
||||||
|
// 'docker exec -t --workdir /mariadb-columnstore-regression-test/mysql/queries/nightly/alltest regression ./go.sh --sm_unit_test_dir=/storage-manager' + (if event == 'pull_request' then ' --tests=test000.sh,test001.sh' else ''),
|
||||||
|
'docker exec -t --workdir /mariadb-columnstore-regression-test/mysql/queries/nightly/alltest regression ./go.sh --sm_unit_test_dir=/storage-manager' + (if event == 'pull_request' then ' --tests=test000.sh' else ''),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
smokelog:: {
|
||||||
|
name: 'smokelog',
|
||||||
|
image: 'docker',
|
||||||
|
volumes: [pipeline._volumes.docker],
|
||||||
|
commands: [
|
||||||
|
'docker exec -t smoke journalctl -ru mariadb --no-pager || true',
|
||||||
|
'docker exec -t smoke cat /var/log/mariadb/columnstore/debug.log || true',
|
||||||
|
'docker stop smoke && docker rm smoke || true',
|
||||||
|
],
|
||||||
|
when: {
|
||||||
|
status: ['success', 'failure'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
regressionlog: {
|
||||||
|
name: 'regressionlog',
|
||||||
|
image: 'docker',
|
||||||
|
volumes: [pipeline._volumes.docker],
|
||||||
|
commands: [
|
||||||
|
'docker exec -t --workdir /mariadb-columnstore-regression-test/mysql/queries/nightly/alltest regression cat go.log',
|
||||||
|
'docker cp regression:/mariadb-columnstore-regression-test/mysql/queries/nightly/alltest/testErrorLogs.tgz /drone/src/result/ || true',
|
||||||
|
'docker stop regression && docker rm regression || true',
|
||||||
|
],
|
||||||
|
when: {
|
||||||
|
status: ['success', 'failure'],
|
||||||
|
},
|
||||||
|
},
|
||||||
kind: 'pipeline',
|
kind: 'pipeline',
|
||||||
type: 'docker',
|
type: 'docker',
|
||||||
name: std.join(' ', [branch, platform, event]),
|
name: std.join(' ', [branch, platform, event]),
|
||||||
@@ -91,6 +141,7 @@ local Pipeline(branch, platform, event) = {
|
|||||||
commands: [
|
commands: [
|
||||||
'mkdir -p /mdb/' + builddir + ' && cd /mdb/' + builddir,
|
'mkdir -p /mdb/' + builddir + ' && cd /mdb/' + builddir,
|
||||||
codebase_map[branch],
|
codebase_map[branch],
|
||||||
|
'git rev-parse HEAD',
|
||||||
'git config cmake.update-submodules no',
|
'git config cmake.update-submodules no',
|
||||||
'rm -rf storage/columnstore/columnstore',
|
'rm -rf storage/columnstore/columnstore',
|
||||||
'cp -r /drone/src /mdb/' + builddir + '/storage/columnstore/columnstore',
|
'cp -r /drone/src /mdb/' + builddir + '/storage/columnstore/columnstore',
|
||||||
@@ -132,13 +183,17 @@ local Pipeline(branch, platform, event) = {
|
|||||||
'echo "engine: $DRONE_COMMIT" > buildinfo.txt',
|
'echo "engine: $DRONE_COMMIT" > buildinfo.txt',
|
||||||
'echo "server: $$(git rev-parse HEAD)" >> buildinfo.txt',
|
'echo "server: $$(git rev-parse HEAD)" >> buildinfo.txt',
|
||||||
'echo "buildNo: $DRONE_BUILD_NUMBER" >> buildinfo.txt',
|
'echo "buildNo: $DRONE_BUILD_NUMBER" >> buildinfo.txt',
|
||||||
'cp ' + (if (std.split(platform, ':')[0] == 'centos' || std.split(platform, ':')[0] == 'opensuse/leap') then '*.rpm' else '../*.deb') + ' buildinfo.txt /drone/src/result/',
|
'cp ' + (if pkg_format == 'deb' then '../' else '') + '*.' + pkg_format + ' buildinfo.txt /drone/src/result/',
|
||||||
'ls -l /drone/src/result',
|
'ls -l /drone/src/result',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
] +
|
] +
|
||||||
(if branch == 'develop-1.4' && std.split(platform, ':')[0] == 'centos' then [pipeline.tests] else []) +
|
(if branch == 'develop' then [pipeline.smoke] else []) +
|
||||||
|
(if branch == 'develop' then [pipeline.smokelog] else []) +
|
||||||
|
(if branch == 'develop' then [pipeline.regression] else []) +
|
||||||
|
(if branch == 'develop' then [pipeline.regressionlog] else []) +
|
||||||
[
|
[
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'publish',
|
name: 'publish',
|
||||||
image: 'plugins/s3',
|
image: 'plugins/s3',
|
||||||
@@ -159,8 +214,7 @@ local Pipeline(branch, platform, event) = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
volumes: [pipeline._volumes.mdb { temp: {} }, pipeline._volumes.docker { host: { path: '/var/run/docker.sock' } }],
|
||||||
volumes: [pipeline._volumes.mdb { temp: {} }],
|
|
||||||
trigger: {
|
trigger: {
|
||||||
event: [event],
|
event: [event],
|
||||||
branch: [branch],
|
branch: [branch],
|
||||||
@@ -200,11 +254,11 @@ local FinalPipeline(branch, event) = {
|
|||||||
|
|
||||||
[
|
[
|
||||||
Pipeline(b, p, e)
|
Pipeline(b, p, e)
|
||||||
for b in ['develop', 'develop-1.4', 'proper_python']
|
for b in ['develop', 'develop-1.4']
|
||||||
for p in platforms[b]
|
for p in platforms[b]
|
||||||
for e in ['pull_request', 'cron', 'custom']
|
for e in ['pull_request', 'cron', 'custom']
|
||||||
] + [
|
] + [
|
||||||
FinalPipeline(b, e)
|
FinalPipeline(b, e)
|
||||||
for b in ['develop', 'develop-1.4', 'proper_python']
|
for b in ['develop', 'develop-1.4']
|
||||||
for e in ['pull_request', 'cron', 'custom']
|
for e in ['pull_request', 'cron', 'custom']
|
||||||
]
|
]
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -162,3 +162,5 @@ gitversionEngine
|
|||||||
mcsconfig.h
|
mcsconfig.h
|
||||||
storage-manager/testS3Connection
|
storage-manager/testS3Connection
|
||||||
storage-manager/unit_tests
|
storage-manager/unit_tests
|
||||||
|
.drone.yml
|
||||||
|
result/
|
||||||
|
|||||||
@@ -56,11 +56,11 @@ if (EXISTS "/etc/debian_version")
|
|||||||
set(DEBIAN_VERSION_NUMBER "${CMAKE_MATCH_1}")
|
set(DEBIAN_VERSION_NUMBER "${CMAKE_MATCH_1}")
|
||||||
endif ()
|
endif ()
|
||||||
if ("${DEBIAN_VERSION_NUMBER}" EQUAL "8")
|
if ("${DEBIAN_VERSION_NUMBER}" EQUAL "8")
|
||||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, libsnappy1, libjemalloc1")
|
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, libsnappy1, libjemalloc1, MariaDB-server, python3")
|
||||||
elseif ("${DEBIAN_VERSION_NUMBER}" EQUAL "9")
|
elseif ("${DEBIAN_VERSION_NUMBER}" EQUAL "9")
|
||||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, libsnappy1v5, libreadline5, libjemalloc1")
|
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, libsnappy1v5, libreadline5, libjemalloc1, MariaDB-server, python3")
|
||||||
else()
|
else()
|
||||||
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools, libjemalloc1")
|
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools, libjemalloc1, MariaDB-server, python3")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set(CPACK_DEBIAN_COLUMNSTORE-ENGINE_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/build/debian/storageEngine/postinst;${CMAKE_CURRENT_SOURCE_DIR}/build/debian/storageEngine/prerm;")
|
set(CPACK_DEBIAN_COLUMNSTORE-ENGINE_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/build/debian/storageEngine/postinst;${CMAKE_CURRENT_SOURCE_DIR}/build/debian/storageEngine/prerm;")
|
||||||
|
|||||||
@@ -77,13 +77,13 @@ IF (EXISTS "/etc/SuSE-release")
|
|||||||
set(SUSE_VERSION_NUMBER "${CMAKE_MATCH_1}")
|
set(SUSE_VERSION_NUMBER "${CMAKE_MATCH_1}")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
if (${REDHAT_VERSION_NUMBER} EQUAL 6)
|
if (${REDHAT_VERSION_NUMBER} EQUAL 6)
|
||||||
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "MariaDB-columnstore-shared" "snappy" "net-tools" "MariaDB-server")
|
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "MariaDB-columnstore-shared" "snappy" "net-tools" "MariaDB-server" "python3")
|
||||||
# Disable auto require as this will also try to pull Boost via RPM
|
# Disable auto require as this will also try to pull Boost via RPM
|
||||||
SET(CPACK_RPM_PACKAGE_AUTOREQPROV " no")
|
SET(CPACK_RPM_PACKAGE_AUTOREQPROV " no")
|
||||||
elseif (${SUSE_VERSION_NUMBER} EQUAL 12)
|
elseif (${SUSE_VERSION_NUMBER} EQUAL 12)
|
||||||
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost-devel >= 1.54.0" "libsnappy1" "jemalloc" "net-tools" "MariaDB-server")
|
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost-devel >= 1.54.0" "libsnappy1" "jemalloc" "net-tools" "MariaDB-server" "python3")
|
||||||
else ()
|
else ()
|
||||||
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost >= 1.53.0" "snappy" "jemalloc" "net-tools" "MariaDB-server")
|
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost >= 1.53.0" "snappy" "jemalloc" "net-tools" "MariaDB-server" "python3")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
SET(CPACK_RPM_columnstore-engine_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preInstall_storage_engine.sh)
|
SET(CPACK_RPM_columnstore-engine_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preInstall_storage_engine.sh)
|
||||||
|
|||||||
@@ -281,14 +281,14 @@ public:
|
|||||||
|
|
||||||
/** @brief Is it required to debug
|
/** @brief Is it required to debug
|
||||||
*/
|
*/
|
||||||
const bool isDebug( const DebugLevel level ) const
|
bool isDebug( const DebugLevel level ) const
|
||||||
{
|
{
|
||||||
return level <= fDebugLevel;
|
return level <= fDebugLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @brief Get debug level
|
/** @brief Get debug level
|
||||||
*/
|
*/
|
||||||
const DebugLevel getDebugLevel() const
|
DebugLevel getDebugLevel() const
|
||||||
{
|
{
|
||||||
return fDebugLevel;
|
return fDebugLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public:
|
|||||||
|
|
||||||
/** @brief get the logging flag
|
/** @brief get the logging flag
|
||||||
*/
|
*/
|
||||||
const bool get_Logging() const
|
bool get_Logging() const
|
||||||
{
|
{
|
||||||
return fLogging;
|
return fLogging;
|
||||||
}
|
}
|
||||||
@@ -153,7 +153,7 @@ public:
|
|||||||
|
|
||||||
/** @brief get the logending flag
|
/** @brief get the logending flag
|
||||||
*/
|
*/
|
||||||
const bool get_Logending() const
|
bool get_Logending() const
|
||||||
{
|
{
|
||||||
return fLogending;
|
return fLogending;
|
||||||
}
|
}
|
||||||
@@ -169,7 +169,7 @@ public:
|
|||||||
|
|
||||||
/** @brief get the isFromCol flag
|
/** @brief get the isFromCol flag
|
||||||
*/
|
*/
|
||||||
const bool get_IsFromCol() const
|
bool get_IsFromCol() const
|
||||||
{
|
{
|
||||||
return fIsFromCol;
|
return fIsFromCol;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,19 +90,19 @@ public:
|
|||||||
|
|
||||||
/** @brief get the data for the column
|
/** @brief get the data for the column
|
||||||
*/
|
*/
|
||||||
const bool get_isnull() const
|
bool get_isnull() const
|
||||||
{
|
{
|
||||||
return fisNULL;
|
return fisNULL;
|
||||||
}
|
}
|
||||||
/** @brief get the fIsFromCol data for the column
|
/** @brief get the fIsFromCol data for the column
|
||||||
*/
|
*/
|
||||||
const bool get_isFromCol() const
|
bool get_isFromCol() const
|
||||||
{
|
{
|
||||||
return fIsFromCol;
|
return fIsFromCol;
|
||||||
}
|
}
|
||||||
/** @brief get the fFuncScale data for the column
|
/** @brief get the fFuncScale data for the column
|
||||||
*/
|
*/
|
||||||
const uint32_t get_funcScale() const
|
uint32_t get_funcScale() const
|
||||||
{
|
{
|
||||||
return fFuncScale;
|
return fFuncScale;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ public:
|
|||||||
}
|
}
|
||||||
/** @brief get the logging flag
|
/** @brief get the logging flag
|
||||||
*/
|
*/
|
||||||
inline const bool get_Logging() const
|
inline bool get_Logging() const
|
||||||
{
|
{
|
||||||
return fLogging;
|
return fLogging;
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ public:
|
|||||||
|
|
||||||
/** @brief get the logging flag
|
/** @brief get the logging flag
|
||||||
*/
|
*/
|
||||||
inline const bool get_Logending() const
|
inline bool get_Logending() const
|
||||||
{
|
{
|
||||||
return fLogending;
|
return fLogending;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ public:
|
|||||||
|
|
||||||
/** @brief Is it required to debug
|
/** @brief Is it required to debug
|
||||||
*/
|
*/
|
||||||
inline const bool isDebug( const DebugLevel level ) const
|
inline bool isDebug( const DebugLevel level ) const
|
||||||
{
|
{
|
||||||
return level <= fDebugLevel;
|
return level <= fDebugLevel;
|
||||||
}
|
}
|
||||||
@@ -202,7 +202,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Get debug level
|
* @brief Get debug level
|
||||||
*/
|
*/
|
||||||
inline const DebugLevel getDebugLevel() const
|
inline DebugLevel getDebugLevel() const
|
||||||
{
|
{
|
||||||
return fDebugLevel;
|
return fDebugLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* accessor
|
* accessor
|
||||||
*/
|
*/
|
||||||
virtual const uint8_t aggOp() const
|
virtual uint8_t aggOp() const
|
||||||
{
|
{
|
||||||
return fAggOp;
|
return fAggOp;
|
||||||
}
|
}
|
||||||
@@ -192,7 +192,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* ASC flag
|
* ASC flag
|
||||||
*/
|
*/
|
||||||
inline virtual const bool asc() const
|
inline virtual bool asc() const
|
||||||
{
|
{
|
||||||
return fAsc;
|
return fAsc;
|
||||||
}
|
}
|
||||||
@@ -214,6 +214,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* fData: SQL representation of this object
|
* fData: SQL representation of this object
|
||||||
*/
|
*/
|
||||||
|
using ReturnedColumn::data;
|
||||||
virtual void data(const std::string& data)
|
virtual void data(const std::string& data)
|
||||||
{
|
{
|
||||||
fData = data;
|
fData = data;
|
||||||
@@ -245,6 +246,7 @@ public:
|
|||||||
* Do a deep, strict (as opposed to semantic) equivalence test.
|
* Do a deep, strict (as opposed to semantic) equivalence test.
|
||||||
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
|
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
|
||||||
*/
|
*/
|
||||||
|
using ReturnedColumn::operator=;
|
||||||
virtual bool operator==(const AggregateColumn& t) const;
|
virtual bool operator==(const AggregateColumn& t) const;
|
||||||
|
|
||||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||||
@@ -259,6 +261,7 @@ public:
|
|||||||
* Do a deep, strict (as opposed to semantic) equivalence test.
|
* Do a deep, strict (as opposed to semantic) equivalence test.
|
||||||
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
|
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
|
||||||
*/
|
*/
|
||||||
|
using ReturnedColumn::operator!=;
|
||||||
virtual bool operator!=(const AggregateColumn& t) const;
|
virtual bool operator!=(const AggregateColumn& t) const;
|
||||||
|
|
||||||
/** @brief push back arg to group by column list*/
|
/** @brief push back arg to group by column list*/
|
||||||
@@ -306,6 +309,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
static AggOp agname2num(const std::string&);
|
static AggOp agname2num(const std::string&);
|
||||||
|
|
||||||
|
using ReturnedColumn::hasAggregate;
|
||||||
virtual bool hasAggregate();
|
virtual bool hasAggregate();
|
||||||
virtual bool hasWindowFunc()
|
virtual bool hasWindowFunc()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* get asc flag
|
* get asc flag
|
||||||
*/
|
*/
|
||||||
inline const bool asc() const
|
inline bool asc() const
|
||||||
{
|
{
|
||||||
return fAsc;
|
return fAsc;
|
||||||
}
|
}
|
||||||
@@ -164,6 +164,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool operator!=(const ArithmeticColumn& t) const;
|
bool operator!=(const ArithmeticColumn& t) const;
|
||||||
|
|
||||||
|
using ReturnedColumn::hasAggregate;
|
||||||
virtual bool hasAggregate();
|
virtual bool hasAggregate();
|
||||||
virtual bool hasWindowFunc();
|
virtual bool hasWindowFunc();
|
||||||
|
|
||||||
@@ -272,6 +273,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ParseTree* fExpression;
|
ParseTree* fExpression;
|
||||||
|
using TreeNode::evaluate;
|
||||||
void evaluate(rowgroup::Row& row) {}
|
void evaluate(rowgroup::Row& row) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -106,38 +106,46 @@ public:
|
|||||||
/***********************************************************
|
/***********************************************************
|
||||||
* F&E framework *
|
* F&E framework *
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
|
using Operator::evaluate;
|
||||||
inline virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop);
|
inline virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop);
|
||||||
|
|
||||||
|
using Operator::getStrVal;
|
||||||
virtual const std::string& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual const std::string& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
return TreeNode::getStrVal(fTimeZone);
|
return TreeNode::getStrVal(fTimeZone);
|
||||||
}
|
}
|
||||||
|
using Operator::getIntVal;
|
||||||
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
return TreeNode::getIntVal();
|
return TreeNode::getIntVal();
|
||||||
}
|
}
|
||||||
|
using Operator::getUintVal;
|
||||||
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
return TreeNode::getUintVal();
|
return TreeNode::getUintVal();
|
||||||
}
|
}
|
||||||
|
using Operator::getFloatVal;
|
||||||
virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
return TreeNode::getFloatVal();
|
return TreeNode::getFloatVal();
|
||||||
}
|
}
|
||||||
|
using Operator::getDoubleVal;
|
||||||
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
return TreeNode::getDoubleVal();
|
return TreeNode::getDoubleVal();
|
||||||
}
|
}
|
||||||
|
using Operator::getLongDoubleVal;
|
||||||
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
return TreeNode::getLongDoubleVal();
|
return TreeNode::getLongDoubleVal();
|
||||||
}
|
}
|
||||||
|
using Operator::getDecimalVal;
|
||||||
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
@@ -156,26 +164,31 @@ public:
|
|||||||
|
|
||||||
return TreeNode::getDecimalVal();
|
return TreeNode::getDecimalVal();
|
||||||
}
|
}
|
||||||
|
using Operator::getDateIntVal;
|
||||||
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
return TreeNode::getDateIntVal();
|
return TreeNode::getDateIntVal();
|
||||||
}
|
}
|
||||||
|
using Operator::getDatetimeIntVal;
|
||||||
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
return TreeNode::getDatetimeIntVal();
|
return TreeNode::getDatetimeIntVal();
|
||||||
}
|
}
|
||||||
|
using Operator::getTimestampIntVal;
|
||||||
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
return TreeNode::getTimestampIntVal();
|
return TreeNode::getTimestampIntVal();
|
||||||
}
|
}
|
||||||
|
using Operator::getTimeIntVal;
|
||||||
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
return TreeNode::getTimeIntVal();
|
return TreeNode::getTimeIntVal();
|
||||||
}
|
}
|
||||||
|
using Operator::getBoolVal;
|
||||||
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
evaluate(row, isNull, lop, rop);
|
evaluate(row, isNull, lop, rop);
|
||||||
|
|||||||
@@ -173,6 +173,26 @@ CalpontSelectExecutionPlan::~CalpontSelectExecutionPlan()
|
|||||||
|
|
||||||
fFilters = NULL;
|
fFilters = NULL;
|
||||||
fHaving = NULL;
|
fHaving = NULL;
|
||||||
|
|
||||||
|
if (!fDynamicParseTreeVec.empty())
|
||||||
|
{
|
||||||
|
for (auto& parseTree : fDynamicParseTreeVec)
|
||||||
|
{
|
||||||
|
if (parseTree)
|
||||||
|
{
|
||||||
|
// 'delete fFilters;' above has already deleted objects pointed
|
||||||
|
// to by parseTree->left()/right()/data(), so we set the
|
||||||
|
// pointers to NULL here before calling 'delete parseTree;'
|
||||||
|
parseTree->left((ParseTree*) (NULL));
|
||||||
|
parseTree->right((ParseTree*) (NULL));
|
||||||
|
parseTree->data((TreeNode*) (NULL));
|
||||||
|
delete parseTree;
|
||||||
|
parseTree = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fDynamicParseTreeVec.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -537,6 +557,26 @@ void CalpontSelectExecutionPlan::unserialize(messageqcpp::ByteStream& b)
|
|||||||
fHaving = 0;
|
fHaving = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!fDynamicParseTreeVec.empty())
|
||||||
|
{
|
||||||
|
for (auto& parseTree : fDynamicParseTreeVec)
|
||||||
|
{
|
||||||
|
if (parseTree)
|
||||||
|
{
|
||||||
|
// 'delete fFilters;' above has already deleted objects pointed
|
||||||
|
// to by parseTree->left()/right()/data(), so we set the
|
||||||
|
// pointers to NULL here before calling 'delete parseTree;'
|
||||||
|
parseTree->left((ParseTree*) (NULL));
|
||||||
|
parseTree->right((ParseTree*) (NULL));
|
||||||
|
parseTree->data((TreeNode*) (NULL));
|
||||||
|
delete parseTree;
|
||||||
|
parseTree = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fDynamicParseTreeVec.clear();
|
||||||
|
}
|
||||||
|
|
||||||
messageqcpp::ByteStream::quadbyte size;
|
messageqcpp::ByteStream::quadbyte size;
|
||||||
messageqcpp::ByteStream::quadbyte i;
|
messageqcpp::ByteStream::quadbyte i;
|
||||||
|
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ public:
|
|||||||
{
|
{
|
||||||
fDistinctUnionNum = distinctUnionNum;
|
fDistinctUnionNum = distinctUnionNum;
|
||||||
}
|
}
|
||||||
const uint8_t distinctUnionNum() const
|
uint8_t distinctUnionNum() const
|
||||||
{
|
{
|
||||||
return fDistinctUnionNum;
|
return fDistinctUnionNum;
|
||||||
}
|
}
|
||||||
@@ -574,7 +574,7 @@ public:
|
|||||||
{
|
{
|
||||||
fHasOrderBy = hasOrderBy;
|
fHasOrderBy = hasOrderBy;
|
||||||
}
|
}
|
||||||
const bool hasOrderBy() const
|
bool hasOrderBy() const
|
||||||
{
|
{
|
||||||
return fHasOrderBy;
|
return fHasOrderBy;
|
||||||
}
|
}
|
||||||
@@ -583,7 +583,7 @@ public:
|
|||||||
{
|
{
|
||||||
fSpecHandlerProcessed = hand;
|
fSpecHandlerProcessed = hand;
|
||||||
}
|
}
|
||||||
const bool specHandlerProcessed() const
|
bool specHandlerProcessed() const
|
||||||
{
|
{
|
||||||
return fSpecHandlerProcessed;
|
return fSpecHandlerProcessed;
|
||||||
}
|
}
|
||||||
@@ -772,6 +772,12 @@ public:
|
|||||||
return ((fSessionID & 0x80000000) != 0);
|
return ((fSessionID & 0x80000000) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void setDynamicParseTreeVec(
|
||||||
|
const std::vector<execplan::ParseTree*>& dynamicParseTreeVec)
|
||||||
|
{
|
||||||
|
fDynamicParseTreeVec = dynamicParseTreeVec;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Protected stuff
|
* Protected stuff
|
||||||
*/
|
*/
|
||||||
@@ -922,6 +928,8 @@ private:
|
|||||||
bool fIsDML;
|
bool fIsDML;
|
||||||
|
|
||||||
std::string fTimeZone;
|
std::string fTimeZone;
|
||||||
|
|
||||||
|
std::vector<execplan::ParseTree*> fDynamicParseTreeVec;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ CalpontSystemCatalog::CatalogMap CalpontSystemCatalog::fCatalogMap;
|
|||||||
/*static*/
|
/*static*/
|
||||||
uint32_t CalpontSystemCatalog::fModuleID = numeric_limits<uint32_t>::max();
|
uint32_t CalpontSystemCatalog::fModuleID = numeric_limits<uint32_t>::max();
|
||||||
|
|
||||||
const CalpontSystemCatalog::OID CalpontSystemCatalog::lookupTableOID(const TableName& tablename)
|
CalpontSystemCatalog::OID CalpontSystemCatalog::lookupTableOID(const TableName& tablename)
|
||||||
{
|
{
|
||||||
TableName aTableName;
|
TableName aTableName;
|
||||||
aTableName.schema = tablename.schema;
|
aTableName.schema = tablename.schema;
|
||||||
@@ -511,7 +511,7 @@ const CalpontSystemCatalog::OID CalpontSystemCatalog::lookupTableOID(const Table
|
|||||||
return (OID)0;
|
return (OID)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CalpontSystemCatalog::OID CalpontSystemCatalog::lookupOID(const TableColName& tableColName)
|
CalpontSystemCatalog::OID CalpontSystemCatalog::lookupOID(const TableColName& tableColName)
|
||||||
{
|
{
|
||||||
if (tableColName.schema.length() == 0 || tableColName.table.length() == 0 || tableColName.column.length() == 0)
|
if (tableColName.schema.length() == 0 || tableColName.table.length() == 0 || tableColName.column.length() == 0)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -1583,7 +1583,7 @@ const CalpontSystemCatalog::TableColName CalpontSystemCatalog::dictColName(const
|
|||||||
|
|
||||||
return tableColName;
|
return tableColName;
|
||||||
}
|
}
|
||||||
const uint64_t CalpontSystemCatalog::nextAutoIncrValue ( TableName aTableName)
|
uint64_t CalpontSystemCatalog::nextAutoIncrValue ( TableName aTableName)
|
||||||
{
|
{
|
||||||
transform( aTableName.schema.begin(), aTableName.schema.end(), aTableName.schema.begin(), to_lower() );
|
transform( aTableName.schema.begin(), aTableName.schema.end(), aTableName.schema.begin(), to_lower() );
|
||||||
transform( aTableName.table.begin(), aTableName.table.end(), aTableName.table.begin(), to_lower() );
|
transform( aTableName.table.begin(), aTableName.table.end(), aTableName.table.begin(), to_lower() );
|
||||||
@@ -2897,7 +2897,7 @@ const vector< pair<CalpontSystemCatalog::OID, CalpontSystemCatalog::TableName> >
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* SQL statement: select objectid from systable */
|
/* SQL statement: select objectid from systable */
|
||||||
const int CalpontSystemCatalog::getTableCount ()
|
int CalpontSystemCatalog::getTableCount ()
|
||||||
{
|
{
|
||||||
int tableCnt = 0;
|
int tableCnt = 0;
|
||||||
|
|
||||||
@@ -4020,7 +4020,7 @@ const CalpontSystemCatalog::ROPair CalpontSystemCatalog::indexRID(const IndexNam
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const int CalpontSystemCatalog::colNumbers(const TableName& tableName)
|
int CalpontSystemCatalog::colNumbers(const TableName& tableName)
|
||||||
{
|
{
|
||||||
DEBUG << "Enter colNumbers: " << tableName.schema << "|" << tableName.table << endl;
|
DEBUG << "Enter colNumbers: " << tableName.schema << "|" << tableName.table << endl;
|
||||||
|
|
||||||
@@ -4891,7 +4891,7 @@ void CalpontSystemCatalog::updateColInfo(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const int CalpontSystemCatalog::colPosition (const OID& oid)
|
int CalpontSystemCatalog::colPosition (const OID& oid)
|
||||||
{
|
{
|
||||||
DEBUG << "Enter colPosition: " << oid << endl;
|
DEBUG << "Enter colPosition: " << oid << endl;
|
||||||
ColType col = colType (oid);
|
ColType col = colType (oid);
|
||||||
|
|||||||
@@ -550,13 +550,13 @@ public:
|
|||||||
*
|
*
|
||||||
* For a unique table_name return the internal OID
|
* For a unique table_name return the internal OID
|
||||||
*/
|
*/
|
||||||
const OID lookupTableOID(const TableName& tableName);
|
OID lookupTableOID(const TableName& tableName);
|
||||||
|
|
||||||
/** looks up a column's OID in the System Catalog
|
/** looks up a column's OID in the System Catalog
|
||||||
*
|
*
|
||||||
* For a unique table_name.column_name return the internal OID
|
* For a unique table_name.column_name return the internal OID
|
||||||
*/
|
*/
|
||||||
const OID lookupOID(const TableColName& tableColName);
|
OID lookupOID(const TableColName& tableColName);
|
||||||
|
|
||||||
/** returns the column type attribute(s) for a column
|
/** returns the column type attribute(s) for a column
|
||||||
*
|
*
|
||||||
@@ -588,7 +588,7 @@ public:
|
|||||||
* 0: Autoincrement does not exist for this table
|
* 0: Autoincrement does not exist for this table
|
||||||
* Throws runtime_error if no such table found
|
* Throws runtime_error if no such table found
|
||||||
*/
|
*/
|
||||||
const uint64_t nextAutoIncrValue ( TableName tableName);
|
uint64_t nextAutoIncrValue ( TableName tableName);
|
||||||
|
|
||||||
/** returns the rid of next autoincrement value for the table oid
|
/** returns the rid of next autoincrement value for the table oid
|
||||||
*
|
*
|
||||||
@@ -606,13 +606,13 @@ public:
|
|||||||
*
|
*
|
||||||
* return the bitmap file object number for a given OID:
|
* return the bitmap file object number for a given OID:
|
||||||
*/
|
*/
|
||||||
const OID colBitmap(const OID& oid) const;
|
OID colBitmap(const OID& oid) const;
|
||||||
|
|
||||||
/** return the current SCN
|
/** return the current SCN
|
||||||
*
|
*
|
||||||
* returns the current System Change Number (for versioning support)
|
* returns the current System Change Number (for versioning support)
|
||||||
*/
|
*/
|
||||||
const SCN scn(void) const;
|
SCN scn(void) const;
|
||||||
|
|
||||||
/** return the RID's of the indexes for a table
|
/** return the RID's of the indexes for a table
|
||||||
*
|
*
|
||||||
@@ -624,7 +624,7 @@ public:
|
|||||||
*
|
*
|
||||||
* returns the total number of columns for a table
|
* returns the total number of columns for a table
|
||||||
*/
|
*/
|
||||||
const int colNumbers(const TableName& tableName);
|
int colNumbers(const TableName& tableName);
|
||||||
|
|
||||||
/** return the RID's of the colindexes for a table
|
/** return the RID's of the colindexes for a table
|
||||||
*
|
*
|
||||||
@@ -648,7 +648,7 @@ public:
|
|||||||
*
|
*
|
||||||
* returns a RID of the constraint for a ConstrainName fron table SYSCONSTRAINT
|
* returns a RID of the constraint for a ConstrainName fron table SYSCONSTRAINT
|
||||||
*/
|
*/
|
||||||
const RID constraintRID(const std::string constraintName);
|
RID constraintRID(const std::string constraintName);
|
||||||
|
|
||||||
/** return the list of IndexName for a given TableColName
|
/** return the list of IndexName for a given TableColName
|
||||||
*
|
*
|
||||||
@@ -666,7 +666,7 @@ public:
|
|||||||
*
|
*
|
||||||
* returns the RID of the colconstraints for a column
|
* returns the RID of the colconstraints for a column
|
||||||
*/
|
*/
|
||||||
const RID constraintColRID(const TableColName& tableColName);
|
RID constraintColRID(const TableColName& tableColName);
|
||||||
|
|
||||||
/** return the value for the given RID and column name from table SYSCONSTRAINTCOL
|
/** return the value for the given RID and column name from table SYSCONSTRAINTCOL
|
||||||
*
|
*
|
||||||
@@ -812,7 +812,7 @@ public:
|
|||||||
/** sessionid access and mutator methods
|
/** sessionid access and mutator methods
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const uint32_t sessionID() const
|
uint32_t sessionID() const
|
||||||
{
|
{
|
||||||
return fSessionID;
|
return fSessionID;
|
||||||
}
|
}
|
||||||
@@ -823,7 +823,7 @@ public:
|
|||||||
/** identity access and mutator methods
|
/** identity access and mutator methods
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const int identity() const
|
int identity() const
|
||||||
{
|
{
|
||||||
return fIdentity;
|
return fIdentity;
|
||||||
}
|
}
|
||||||
@@ -836,7 +836,7 @@ public:
|
|||||||
*
|
*
|
||||||
* return the column position for a given OID
|
* return the column position for a given OID
|
||||||
*/
|
*/
|
||||||
const int colPosition (const OID& oid);
|
int colPosition (const OID& oid);
|
||||||
/** return primary key name for the given table */
|
/** return primary key name for the given table */
|
||||||
const std::string primaryKeyName (const TableName& tableName );
|
const std::string primaryKeyName (const TableName& tableName );
|
||||||
/** return the table info
|
/** return the table info
|
||||||
@@ -849,7 +849,7 @@ public:
|
|||||||
/** return the list of tables for a given schema */
|
/** return the list of tables for a given schema */
|
||||||
const std::vector< std::pair<OID, TableName> > getTables (const std::string schema = "");
|
const std::vector< std::pair<OID, TableName> > getTables (const std::string schema = "");
|
||||||
/** return the number of tables in the whole database */
|
/** return the number of tables in the whole database */
|
||||||
const int getTableCount ();
|
int getTableCount ();
|
||||||
/** return the constraint info for a given constraint */
|
/** return the constraint info for a given constraint */
|
||||||
const ConstraintInfo constraintInfo (const IndexName& constraintName);
|
const ConstraintInfo constraintInfo (const IndexName& constraintName);
|
||||||
/** return the constraintName list for a given referencePKName */
|
/** return the constraintName list for a given referencePKName */
|
||||||
|
|||||||
@@ -239,6 +239,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* F&E
|
* F&E
|
||||||
*/
|
*/
|
||||||
|
using ReturnedColumn::evaluate;
|
||||||
virtual void evaluate(rowgroup::Row& row) {}
|
virtual void evaluate(rowgroup::Row& row) {}
|
||||||
/**
|
/**
|
||||||
* F&E
|
* F&E
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public:
|
|||||||
fSub = sub;
|
fSub = sub;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool notExists() const
|
bool notExists() const
|
||||||
{
|
{
|
||||||
return fNotExists;
|
return fNotExists;
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
fNotExists = notExists;
|
fNotExists = notExists;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool correlated() const
|
bool correlated() const
|
||||||
{
|
{
|
||||||
return fCorrelated;
|
return fCorrelated;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ public:
|
|||||||
virtual void serialize(messageqcpp::ByteStream&) const;
|
virtual void serialize(messageqcpp::ByteStream&) const;
|
||||||
virtual void unserialize(messageqcpp::ByteStream&);
|
virtual void unserialize(messageqcpp::ByteStream&);
|
||||||
|
|
||||||
|
using ReturnedColumn::hasAggregate;
|
||||||
virtual bool hasAggregate();
|
virtual bool hasAggregate();
|
||||||
virtual bool hasWindowFunc();
|
virtual bool hasWindowFunc();
|
||||||
virtual void setDerivedTable();
|
virtual void setDerivedTable();
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ public:
|
|||||||
* @return true iff every member of t is a duplicate copy of every member of this;
|
* @return true iff every member of t is a duplicate copy of every member of this;
|
||||||
* false otherwise
|
* false otherwise
|
||||||
*/
|
*/
|
||||||
|
using AggregateColumn::operator==;
|
||||||
virtual bool operator==(const GroupConcatColumn& t) const;
|
virtual bool operator==(const GroupConcatColumn& t) const;
|
||||||
|
|
||||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||||
@@ -134,6 +135,7 @@ public:
|
|||||||
* @return false iff every member of t is a duplicate copy of every member of this;
|
* @return false iff every member of t is a duplicate copy of every member of this;
|
||||||
* true otherwise
|
* true otherwise
|
||||||
*/
|
*/
|
||||||
|
using AggregateColumn::operator!=;
|
||||||
virtual bool operator!=(const GroupConcatColumn& t) const;
|
virtual bool operator!=(const GroupConcatColumn& t) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public:
|
|||||||
{
|
{
|
||||||
fVal = val;
|
fVal = val;
|
||||||
}
|
}
|
||||||
const int intervalType() const
|
int intervalType() const
|
||||||
{
|
{
|
||||||
return fIntervalType;
|
return fIntervalType;
|
||||||
}
|
}
|
||||||
@@ -90,6 +90,7 @@ public:
|
|||||||
return new IntervalColumn (*this);
|
return new IntervalColumn (*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using ReturnedColumn::hasAggregate;
|
||||||
virtual bool hasAggregate()
|
virtual bool hasAggregate()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ public:
|
|||||||
//result_t evaluate(result_t op1, result_t op2);
|
//result_t evaluate(result_t op1, result_t op2);
|
||||||
|
|
||||||
// F&E framework
|
// F&E framework
|
||||||
|
using Operator::getBoolVal;
|
||||||
inline virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
inline virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
switch (fOp)
|
switch (fOp)
|
||||||
@@ -167,6 +168,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using TreeNode::evaluate;
|
||||||
inline virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
inline virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
fResult.boolVal = getBoolVal(row, isNull, lop, rop);
|
fResult.boolVal = getBoolVal(row, isNull, lop, rop);
|
||||||
|
|||||||
@@ -156,53 +156,66 @@ public:
|
|||||||
{
|
{
|
||||||
fOp = op;
|
fOp = op;
|
||||||
}
|
}
|
||||||
|
using TreeNode::evaluate;
|
||||||
virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) {}
|
virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) {}
|
||||||
|
|
||||||
// The following methods should be pure virtual. Currently too many instanslization exists.
|
// The following methods should be pure virtual. Currently too many instanslization exists.
|
||||||
|
using TreeNode::getStrVal;
|
||||||
virtual const std::string& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual const std::string& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.strVal;
|
return fResult.strVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getIntVal;
|
||||||
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.intVal;
|
return fResult.intVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getUintVal;
|
||||||
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.uintVal;
|
return fResult.uintVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getFloatVal;
|
||||||
virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.floatVal;
|
return fResult.floatVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getDoubleVal;
|
||||||
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.doubleVal;
|
return fResult.doubleVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getLongDoubleVal;
|
||||||
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.longDoubleVal;
|
return fResult.longDoubleVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getDecimalVal;
|
||||||
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.decimalVal;
|
return fResult.decimalVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getDateIntVal;
|
||||||
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.intVal;
|
return fResult.intVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getDatetimeIntVal;
|
||||||
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.intVal;
|
return fResult.intVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getTimestampIntVal;
|
||||||
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.intVal;
|
return fResult.intVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getTimeIntVal;
|
||||||
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.intVal;
|
return fResult.intVal;
|
||||||
}
|
}
|
||||||
|
using TreeNode::getBoolVal;
|
||||||
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||||
{
|
{
|
||||||
return fResult.boolVal;
|
return fResult.boolVal;
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ public:
|
|||||||
/***********************************************************
|
/***********************************************************
|
||||||
* F&E framework *
|
* F&E framework *
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
|
using Operator::getBoolVal;
|
||||||
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop);
|
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop);
|
||||||
void setOpType(Type& l, Type& r);
|
void setOpType(Type& l, Type& r);
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Accessor and mutator
|
* Accessor and mutator
|
||||||
*/
|
*/
|
||||||
const uint32_t pseudoType() const
|
uint32_t pseudoType() const
|
||||||
{
|
{
|
||||||
return fPseudoType;
|
return fPseudoType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public:
|
|||||||
fData = data;
|
fData = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const bool returnAll() const
|
virtual bool returnAll() const
|
||||||
{
|
{
|
||||||
return fReturnAll;
|
return fReturnAll;
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ public:
|
|||||||
fReturnAll = returnAll;
|
fReturnAll = returnAll;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t sessionID() const
|
uint32_t sessionID() const
|
||||||
{
|
{
|
||||||
return fSessionID;
|
return fSessionID;
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public:
|
|||||||
fSessionID = sessionID;
|
fSessionID = sessionID;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const int32_t sequence() const
|
inline int32_t sequence() const
|
||||||
{
|
{
|
||||||
return fSequence;
|
return fSequence;
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ public:
|
|||||||
fDistinct = distinct;
|
fDistinct = distinct;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t expressionId() const
|
uint32_t expressionId() const
|
||||||
{
|
{
|
||||||
return fExpressionId;
|
return fExpressionId;
|
||||||
}
|
}
|
||||||
@@ -177,7 +177,7 @@ public:
|
|||||||
fJoinInfo = joinInfo;
|
fJoinInfo = joinInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const bool asc() const
|
virtual bool asc() const
|
||||||
{
|
{
|
||||||
return fAsc;
|
return fAsc;
|
||||||
}
|
}
|
||||||
@@ -186,7 +186,7 @@ public:
|
|||||||
fAsc = asc;
|
fAsc = asc;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const bool nullsFirst() const
|
virtual bool nullsFirst() const
|
||||||
{
|
{
|
||||||
return fNullsFirst;
|
return fNullsFirst;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ public:
|
|||||||
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
|
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
|
||||||
*/
|
*/
|
||||||
bool operator!=(const RowColumn& t) const;
|
bool operator!=(const RowColumn& t) const;
|
||||||
|
using ReturnedColumn::hasAggregate;
|
||||||
virtual bool hasAggregate()
|
virtual bool hasAggregate()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -162,6 +163,7 @@ public:
|
|||||||
{
|
{
|
||||||
return new SubSelect();
|
return new SubSelect();
|
||||||
}
|
}
|
||||||
|
using ReturnedColumn::hasAggregate;
|
||||||
virtual bool hasAggregate()
|
virtual bool hasAggregate()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public:
|
|||||||
fSub = sub;
|
fSub = sub;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool correlated() const
|
bool correlated() const
|
||||||
{
|
{
|
||||||
return fCorrelated;
|
return fCorrelated;
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ public:
|
|||||||
fData = data;
|
fData = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint64_t returnedColPos() const
|
uint64_t returnedColPos() const
|
||||||
{
|
{
|
||||||
return fReturnedColPos;
|
return fReturnedColPos;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,12 +143,12 @@ void SessionManager::reset()
|
|||||||
dbrm.sessionmanager_reset();
|
dbrm.sessionmanager_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t SessionManager::getUnique32()
|
uint32_t SessionManager::getUnique32()
|
||||||
{
|
{
|
||||||
return dbrm.getUnique32();
|
return dbrm.getUnique32();
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool SessionManager::checkActiveTransaction( const SID sessionId, bool& bIsDbrmUp, SIDTIDEntry& blocker )
|
bool SessionManager::checkActiveTransaction( const SID sessionId, bool& bIsDbrmUp, SIDTIDEntry& blocker )
|
||||||
{
|
{
|
||||||
bIsDbrmUp = true;
|
bIsDbrmUp = true;
|
||||||
int arrayLenth = 0;
|
int arrayLenth = 0;
|
||||||
@@ -176,7 +176,7 @@ const bool SessionManager::checkActiveTransaction( const SID sessionId, bool& bI
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool SessionManager::isTransactionActive(const SID sessionId, bool& bIsDbrmUp)
|
bool SessionManager::isTransactionActive(const SID sessionId, bool& bIsDbrmUp)
|
||||||
{
|
{
|
||||||
bIsDbrmUp = true;
|
bIsDbrmUp = true;
|
||||||
int arrayLenth = 0;
|
int arrayLenth = 0;
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ public:
|
|||||||
* object on the PM.
|
* object on the PM.
|
||||||
* @return A "unique" uint32_t.
|
* @return A "unique" uint32_t.
|
||||||
*/
|
*/
|
||||||
const uint32_t getUnique32();
|
uint32_t getUnique32();
|
||||||
|
|
||||||
/** @brief Returns the number of active transactions. Only useful in testing.
|
/** @brief Returns the number of active transactions. Only useful in testing.
|
||||||
*
|
*
|
||||||
@@ -206,8 +206,8 @@ public:
|
|||||||
|
|
||||||
std::string getTxnIDFilename() const;
|
std::string getTxnIDFilename() const;
|
||||||
|
|
||||||
const bool checkActiveTransaction(const SID sessionId, bool& bIsDbrmUp, BRM::SIDTIDEntry& blocker);
|
bool checkActiveTransaction(const SID sessionId, bool& bIsDbrmUp, BRM::SIDTIDEntry& blocker);
|
||||||
const bool isTransactionActive(const SID sessionId, bool& bIsDbrmUp);
|
bool isTransactionActive(const SID sessionId, bool& bIsDbrmUp);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BRM::DBRM dbrm;
|
BRM::DBRM dbrm;
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public:
|
|||||||
{
|
{
|
||||||
fTimeZone = timeZone;
|
fTimeZone = timeZone;
|
||||||
}
|
}
|
||||||
inline const bool isColumnStore() const
|
inline bool isColumnStore() const
|
||||||
{
|
{
|
||||||
return fisColumnStore;
|
return fisColumnStore;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,8 +150,14 @@ SimpleFilter::SimpleFilter(const SimpleFilter& rhs) :
|
|||||||
SimpleFilter::~SimpleFilter()
|
SimpleFilter::~SimpleFilter()
|
||||||
{
|
{
|
||||||
//delete fOp;
|
//delete fOp;
|
||||||
|
if (fLhs != NULL)
|
||||||
delete fLhs;
|
delete fLhs;
|
||||||
|
|
||||||
|
if (fRhs != NULL)
|
||||||
delete fRhs;
|
delete fRhs;
|
||||||
|
|
||||||
|
fLhs = NULL;
|
||||||
|
fRhs = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ public:
|
|||||||
fTimeZone = timeZone;
|
fTimeZone = timeZone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using Filter::data;
|
||||||
virtual const std::string data() const;
|
virtual const std::string data() const;
|
||||||
|
|
||||||
/** assign fLhs
|
/** assign fLhs
|
||||||
@@ -191,7 +192,7 @@ public:
|
|||||||
{
|
{
|
||||||
fIndexFlag = indexFlag;
|
fIndexFlag = indexFlag;
|
||||||
}
|
}
|
||||||
const int indexFlag() const
|
int indexFlag() const
|
||||||
{
|
{
|
||||||
return fIndexFlag;
|
return fIndexFlag;
|
||||||
}
|
}
|
||||||
@@ -201,7 +202,7 @@ public:
|
|||||||
{
|
{
|
||||||
fJoinFlag = joinFlag;
|
fJoinFlag = joinFlag;
|
||||||
}
|
}
|
||||||
const int joinFlag() const
|
int joinFlag() const
|
||||||
{
|
{
|
||||||
return fJoinFlag;
|
return fJoinFlag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ public:
|
|||||||
* @return true iff every member of t is a duplicate copy of every member of this;
|
* @return true iff every member of t is a duplicate copy of every member of this;
|
||||||
* false otherwise
|
* false otherwise
|
||||||
*/
|
*/
|
||||||
|
using AggregateColumn::operator==;
|
||||||
virtual bool operator==(const UDAFColumn& t) const;
|
virtual bool operator==(const UDAFColumn& t) const;
|
||||||
|
|
||||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||||
@@ -118,6 +119,7 @@ public:
|
|||||||
* @return false iff every member of t is a duplicate copy of every member of this;
|
* @return false iff every member of t is a duplicate copy of every member of this;
|
||||||
* true otherwise
|
* true otherwise
|
||||||
*/
|
*/
|
||||||
|
using AggregateColumn::operator!=;
|
||||||
virtual bool operator!=(const UDAFColumn& t) const;
|
virtual bool operator!=(const UDAFColumn& t) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ public:
|
|||||||
// util function for connector to use.
|
// util function for connector to use.
|
||||||
void addToPartition(std::vector<SRCP>& groupByList);
|
void addToPartition(std::vector<SRCP>& groupByList);
|
||||||
|
|
||||||
|
using ReturnedColumn::hasAggregate;
|
||||||
virtual bool hasAggregate()
|
virtual bool hasAggregate()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public:
|
|||||||
return COLUMN_COMMAND;
|
return COLUMN_COMMAND;
|
||||||
}
|
}
|
||||||
// @bug 1098
|
// @bug 1098
|
||||||
const uint8_t getBOP() const
|
uint8_t getBOP() const
|
||||||
{
|
{
|
||||||
return BOP;
|
return BOP;
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
{
|
{
|
||||||
return filterString;
|
return filterString;
|
||||||
}
|
}
|
||||||
const uint16_t getFilterCount() const
|
uint16_t getFilterCount() const
|
||||||
{
|
{
|
||||||
return filterCount;
|
return filterCount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,14 +68,17 @@ public:
|
|||||||
{
|
{
|
||||||
return fTableOids.empty() ? 0 : fTableOids.front();
|
return fTableOids.empty() ? 0 : fTableOids.front();
|
||||||
}
|
}
|
||||||
|
using JobStep::alias;
|
||||||
std::string alias() const
|
std::string alias() const
|
||||||
{
|
{
|
||||||
return fAliases.empty() ? "" : fAliases.front();
|
return fAliases.empty() ? "" : fAliases.front();
|
||||||
}
|
}
|
||||||
|
using JobStep::view;
|
||||||
std::string view() const
|
std::string view() const
|
||||||
{
|
{
|
||||||
return fViews.empty() ? "" : fViews.front();
|
return fViews.empty() ? "" : fViews.front();
|
||||||
}
|
}
|
||||||
|
using JobStep::schema;
|
||||||
std::string schema() const
|
std::string schema() const
|
||||||
{
|
{
|
||||||
return fSchemas.empty() ? "" : fSchemas.front();
|
return fSchemas.empty() ? "" : fSchemas.front();
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
void createCommand(messageqcpp::ByteStream& bs) const;
|
void createCommand(messageqcpp::ByteStream& bs) const;
|
||||||
void runCommand(messageqcpp::ByteStream& bs) const;
|
void runCommand(messageqcpp::ByteStream& bs) const;
|
||||||
uint16_t getWidth();
|
uint16_t getWidth();
|
||||||
const uint8_t getBOP() const
|
uint8_t getBOP() const
|
||||||
{
|
{
|
||||||
return fBOP;
|
return fBOP;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ public:
|
|||||||
EXPORT GroupConcatAgUM(rowgroup::SP_GroupConcat&);
|
EXPORT GroupConcatAgUM(rowgroup::SP_GroupConcat&);
|
||||||
EXPORT ~GroupConcatAgUM();
|
EXPORT ~GroupConcatAgUM();
|
||||||
|
|
||||||
|
using rowgroup::GroupConcatAg::merge;
|
||||||
void initialize();
|
void initialize();
|
||||||
void processRow(const rowgroup::Row&);
|
void processRow(const rowgroup::Row&);
|
||||||
EXPORT void merge(const rowgroup::Row&, int64_t);
|
EXPORT void merge(const rowgroup::Row&, int64_t);
|
||||||
@@ -147,6 +148,7 @@ public:
|
|||||||
void processRow(const rowgroup::Row&);
|
void processRow(const rowgroup::Row&);
|
||||||
|
|
||||||
void merge(GroupConcator*);
|
void merge(GroupConcator*);
|
||||||
|
using GroupConcator::getResult;
|
||||||
void getResult(uint8_t* buff, const std::string& sep);
|
void getResult(uint8_t* buff, const std::string& sep);
|
||||||
|
|
||||||
const std::string toString() const;
|
const std::string toString() const;
|
||||||
@@ -172,11 +174,13 @@ public:
|
|||||||
GroupConcatOrderBy();
|
GroupConcatOrderBy();
|
||||||
virtual ~GroupConcatOrderBy();
|
virtual ~GroupConcatOrderBy();
|
||||||
|
|
||||||
|
using ordering::IdbOrderBy::initialize;
|
||||||
void initialize(const rowgroup::SP_GroupConcat&);
|
void initialize(const rowgroup::SP_GroupConcat&);
|
||||||
void processRow(const rowgroup::Row&);
|
void processRow(const rowgroup::Row&);
|
||||||
uint64_t getKeyLength() const;
|
uint64_t getKeyLength() const;
|
||||||
|
|
||||||
void merge(GroupConcator*);
|
void merge(GroupConcator*);
|
||||||
|
using GroupConcator::getResult;
|
||||||
void getResult(uint8_t* buff, const std::string& sep);
|
void getResult(uint8_t* buff, const std::string& sep);
|
||||||
|
|
||||||
const std::string toString() const;
|
const std::string toString() const;
|
||||||
|
|||||||
@@ -364,6 +364,11 @@ struct JobInfo
|
|||||||
bool isDML;
|
bool isDML;
|
||||||
std::string timeZone;
|
std::string timeZone;
|
||||||
|
|
||||||
|
// This is for tracking any dynamically allocated ParseTree objects
|
||||||
|
// in simpleScalarFilterToParseTree() for later deletion in
|
||||||
|
// ~csep() or csep.unserialize()
|
||||||
|
std::vector<execplan::ParseTree*> dynamicParseTreeVec;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//defaults okay
|
//defaults okay
|
||||||
//JobInfo(const JobInfo& rhs);
|
//JobInfo(const JobInfo& rhs);
|
||||||
|
|||||||
@@ -3269,6 +3269,12 @@ void doOR(ParseTree* n, JobInfo& jobInfo, bool tryCombine)
|
|||||||
ccp->left(parseTree->left());
|
ccp->left(parseTree->left());
|
||||||
ccp->right(parseTree->right());
|
ccp->right(parseTree->right());
|
||||||
ccp->data(parseTree->data());
|
ccp->data(parseTree->data());
|
||||||
|
jobInfo.dynamicParseTreeVec.push_back(parseTree);
|
||||||
|
}
|
||||||
|
else if (parseTree)
|
||||||
|
{
|
||||||
|
delete parseTree;
|
||||||
|
parseTree = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -192,7 +192,10 @@ void ssfInHaving(ParseTree* pt, void* obj)
|
|||||||
pt->right(parseTree->right());
|
pt->right(parseTree->right());
|
||||||
pt->data(parseTree->data());
|
pt->data(parseTree->data());
|
||||||
|
|
||||||
|
jobInfo->dynamicParseTreeVec.push_back(parseTree);
|
||||||
// don't delete the parseTree, it has been placed in the plan.
|
// don't delete the parseTree, it has been placed in the plan.
|
||||||
|
// Instead, we use the dynamicParseTreeVec above for deletion
|
||||||
|
// in ~csep() or csep.unserialize().
|
||||||
// delete parseTree;
|
// delete parseTree;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -627,7 +630,10 @@ void doSimpleScalarFilter(ParseTree* p, JobInfo& jobInfo)
|
|||||||
// create job steps for each simple filter
|
// create job steps for each simple filter
|
||||||
JLF_ExecPlanToJobList::walkTree(parseTree, jobInfo);
|
JLF_ExecPlanToJobList::walkTree(parseTree, jobInfo);
|
||||||
|
|
||||||
|
jobInfo.dynamicParseTreeVec.push_back(parseTree);
|
||||||
// don't delete the parseTree, it has been placed in the plan.
|
// don't delete the parseTree, it has been placed in the plan.
|
||||||
|
// Instead, we use the dynamicParseTreeVec above for deletion
|
||||||
|
// in ~csep() or csep.unserialize().
|
||||||
// delete parseTree;
|
// delete parseTree;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public:
|
|||||||
errInfo = sp;
|
errInfo = sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const uint32_t status() const
|
virtual uint32_t status() const
|
||||||
{
|
{
|
||||||
return errInfo->errCode;
|
return errInfo->errCode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2003,6 +2003,7 @@ SJLP makeJobList_(
|
|||||||
jl->addQuery(querySteps);
|
jl->addQuery(querySteps);
|
||||||
jl->addProject(projectSteps);
|
jl->addProject(projectSteps);
|
||||||
jl->addDelivery(deliverySteps);
|
jl->addDelivery(deliverySteps);
|
||||||
|
csep->setDynamicParseTreeVec(jobInfo.dynamicParseTreeVec);
|
||||||
|
|
||||||
dynamic_cast<TupleJobList*>(jl)->setDeliveryFlag(true);
|
dynamic_cast<TupleJobList*>(jl)->setDeliveryFlag(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class LimitedOrderBy : public ordering::IdbOrderBy
|
|||||||
public:
|
public:
|
||||||
LimitedOrderBy();
|
LimitedOrderBy();
|
||||||
virtual ~LimitedOrderBy();
|
virtual ~LimitedOrderBy();
|
||||||
|
using ordering::IdbOrderBy::initialize;
|
||||||
void initialize(const rowgroup::RowGroup&,
|
void initialize(const rowgroup::RowGroup&,
|
||||||
const JobInfo&,
|
const JobInfo&,
|
||||||
bool invertRules = false,
|
bool invertRules = false,
|
||||||
|
|||||||
@@ -460,6 +460,7 @@ public:
|
|||||||
*
|
*
|
||||||
* The main loop for the receive-side thread. Don't call it directly.
|
* The main loop for the receive-side thread. Don't call it directly.
|
||||||
*/
|
*/
|
||||||
|
using PrimitiveMsg::receivePrimitiveMessages;
|
||||||
void receivePrimitiveMessages(uint64_t i = 0);
|
void receivePrimitiveMessages(uint64_t i = 0);
|
||||||
|
|
||||||
/** @brief Add a filter when the column is a 4-byte float type
|
/** @brief Add a filter when the column is a 4-byte float type
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ SJSTEP& SubQueryTransformer::makeSubQueryStep(execplan::CalpontSelectExecutionPl
|
|||||||
fSubJobList->addQuery(querySteps);
|
fSubJobList->addQuery(querySteps);
|
||||||
fSubJobList->addDelivery(deliverySteps);
|
fSubJobList->addDelivery(deliverySteps);
|
||||||
fSubJobList->putEngineComm(DistributedEngineComm::instance(fOutJobInfo->rm));
|
fSubJobList->putEngineComm(DistributedEngineComm::instance(fOutJobInfo->rm));
|
||||||
|
csep->setDynamicParseTreeVec(fSubJobInfo->dynamicParseTreeVec);
|
||||||
|
|
||||||
// Get the correlated steps
|
// Get the correlated steps
|
||||||
fCorrelatedSteps = fSubJobInfo->correlateSteps;
|
fCorrelatedSteps = fSubJobInfo->correlateSteps;
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ public:
|
|||||||
uint32_t nextBand(messageqcpp::ByteStream& bs);
|
uint32_t nextBand(messageqcpp::ByteStream& bs);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
using TupleConstantStep::fillInConstants;
|
||||||
void fillInConstants();
|
void fillInConstants();
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -159,6 +160,7 @@ public:
|
|||||||
However (for now), it's ok, because it's only called in one place and
|
However (for now), it's ok, because it's only called in one place and
|
||||||
doesn't need to be virtual there.
|
doesn't need to be virtual there.
|
||||||
*/
|
*/
|
||||||
|
using TupleConstantStep::initialize;
|
||||||
void initialize(const rowgroup::RowGroup& rgIn, const JobInfo& jobInfo);
|
void initialize(const rowgroup::RowGroup& rgIn, const JobInfo& jobInfo);
|
||||||
|
|
||||||
const std::string toString() const;
|
const std::string toString() const;
|
||||||
@@ -175,6 +177,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void execute() {}
|
void execute() {}
|
||||||
|
using TupleConstantStep::fillInConstants;
|
||||||
void fillInConstants() {}
|
void fillInConstants() {}
|
||||||
void constructContanstRow(const JobInfo& jobInfo) {}
|
void constructContanstRow(const JobInfo& jobInfo) {}
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ public:
|
|||||||
{
|
{
|
||||||
fCorrelatedSide = c;
|
fCorrelatedSide = c;
|
||||||
}
|
}
|
||||||
|
using JobStep::tupleId;
|
||||||
uint64_t tupleId() const
|
uint64_t tupleId() const
|
||||||
{
|
{
|
||||||
return fTupleId2;
|
return fTupleId2;
|
||||||
@@ -234,7 +234,7 @@ public:
|
|||||||
{
|
{
|
||||||
return largeRG;
|
return largeRG;
|
||||||
}
|
}
|
||||||
const uint32_t getSmallKey() const
|
uint32_t getSmallKey() const
|
||||||
{
|
{
|
||||||
return smallSideKeys[0][0];
|
return smallSideKeys[0][0];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public:
|
|||||||
bool deliverStringTableRowGroup() const;
|
bool deliverStringTableRowGroup() const;
|
||||||
|
|
||||||
void initialize(const rowgroup::RowGroup& rgIn, const JobInfo& jobInfo);
|
void initialize(const rowgroup::RowGroup& rgIn, const JobInfo& jobInfo);
|
||||||
|
using ExpressionStep::expressionFilter;
|
||||||
void expressionFilter(const execplan::ParseTree* filter, JobInfo& jobInfo);
|
void expressionFilter(const execplan::ParseTree* filter, JobInfo& jobInfo);
|
||||||
|
|
||||||
virtual bool stringTableFriendly()
|
virtual bool stringTableFriendly()
|
||||||
|
|||||||
@@ -35,9 +35,16 @@ add_definitions(-DMYSQL_DYNAMIC_PLUGIN)
|
|||||||
set_source_files_properties(ha_mcs.cpp PROPERTIES COMPILE_FLAGS "-fno-implicit-templates")
|
set_source_files_properties(ha_mcs.cpp PROPERTIES COMPILE_FLAGS "-fno-implicit-templates")
|
||||||
|
|
||||||
if (COMMAND mysql_add_plugin)
|
if (COMMAND mysql_add_plugin)
|
||||||
|
IF(RPM|DEB)
|
||||||
mysql_add_plugin(columnstore ${libcalmysql_SRCS} STORAGE_ENGINE MODULE_ONLY DEFAULT
|
mysql_add_plugin(columnstore ${libcalmysql_SRCS} STORAGE_ENGINE MODULE_ONLY DEFAULT
|
||||||
LINK_LIBRARIES ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool
|
LINK_LIBRARIES ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool
|
||||||
COMPONENT columnstore-engine)
|
COMPONENT columnstore-engine)
|
||||||
|
ELSE()
|
||||||
|
mysql_add_plugin(columnstore ${libcalmysql_SRCS} STORAGE_ENGINE MODULE_ONLY DISABLED
|
||||||
|
LINK_LIBRARIES ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool
|
||||||
|
COMPONENT columnstore-engine)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
else ()
|
else ()
|
||||||
add_library(ha_columnstore SHARED ${libcalmysql_SRCS})
|
add_library(ha_columnstore SHARED ${libcalmysql_SRCS})
|
||||||
SET_TARGET_PROPERTIES(ha_columnstore PROPERTIES PREFIX "")
|
SET_TARGET_PROPERTIES(ha_columnstore PROPERTIES PREFIX "")
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ const string format(int64_t v, CalpontSystemCatalog::ColType& ct)
|
|||||||
return oss.str();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
const int64_t IDB_format(char* str, CalpontSystemCatalog::ColType& ct, uint8_t& rf)
|
int64_t IDB_format(char* str, CalpontSystemCatalog::ColType& ct, uint8_t& rf)
|
||||||
{
|
{
|
||||||
int64_t v = 0;
|
int64_t v = 0;
|
||||||
bool pushWarning = false;
|
bool pushWarning = false;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fGwip;
|
return fGwip;
|
||||||
}
|
}
|
||||||
const bool correlated() const
|
bool correlated() const
|
||||||
{
|
{
|
||||||
return fCorrelated;
|
return fCorrelated;
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ public:
|
|||||||
execplan::ParseTree* transform_between();
|
execplan::ParseTree* transform_between();
|
||||||
execplan::ParseTree* transform_in();
|
execplan::ParseTree* transform_in();
|
||||||
execplan::ParseTree* buildParseTree(execplan::PredicateOperator* op);
|
execplan::ParseTree* buildParseTree(execplan::PredicateOperator* op);
|
||||||
const uint64_t returnedColPos() const
|
uint64_t returnedColPos() const
|
||||||
{
|
{
|
||||||
return fReturnedColPos;
|
return fReturnedColPos;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,6 @@
|
|||||||
MariaDB service engineers. Incorrect settings can render your system
|
MariaDB service engineers. Incorrect settings can render your system
|
||||||
unusable and will require a service call to correct.
|
unusable and will require a service call to correct.
|
||||||
-->
|
-->
|
||||||
<ClusterManager>0.0.0.0</ClusterManager>
|
|
||||||
<ConfigRevision>1</ConfigRevision>
|
|
||||||
<NextNodeId>2</NextNodeId>
|
|
||||||
<NextDBRootId>2</NextDBRootId>
|
|
||||||
<ExeMgr1>
|
<ExeMgr1>
|
||||||
<IPAddr>127.0.0.1</IPAddr>
|
<IPAddr>127.0.0.1</IPAddr>
|
||||||
<Port>8601</Port>
|
<Port>8601</Port>
|
||||||
|
|||||||
@@ -22,13 +22,6 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-ddlproc.service.in" "${CMAKE_CUR
|
|||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.service" @ONLY)
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.service" @ONLY)
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-storagemanager.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-storagemanager.service" @ONLY)
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-storagemanager.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-storagemanager.service" @ONLY)
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-stop-controllernode.sh.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-stop-controllernode.sh" @ONLY)
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-stop-controllernode.sh.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-stop-controllernode.sh" @ONLY)
|
||||||
|
|
||||||
IF(RPM MATCHES "(rhel|centos)8|(sles|suse)15|fedora")
|
|
||||||
SET(PYTHON_SHEBANG "#!/usr/bin/env python3")
|
|
||||||
ELSE()
|
|
||||||
SET(PYTHON_SHEBANG "#!/usr/bin/env python")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.py.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.py")
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.py.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.py")
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-start-storagemanager.py.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-start-storagemanager.py")
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-start-storagemanager.py.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-start-storagemanager.py")
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +1,48 @@
|
|||||||
${PYTHON_SHEBANG}
|
#!/usr/bin/env python3
|
||||||
from __future__ import absolute_import, division, print_function
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
if sys.version_info < (3,0):
|
import configparser
|
||||||
import ConfigParser
|
|
||||||
else:
|
|
||||||
import configparser
|
api_config_file = '/etc/columnstore/cmapi_server.conf'
|
||||||
|
|
||||||
|
|
||||||
|
def get_key():
|
||||||
|
cmapi_config = configparser.ConfigParser()
|
||||||
|
try:
|
||||||
|
cmapi_config.read(api_config_file)
|
||||||
|
except FileNotFoundError:
|
||||||
|
return ''
|
||||||
|
|
||||||
|
if 'Authentication' not in cmapi_config.sections():
|
||||||
|
return ''
|
||||||
|
return cmapi_config['Authentication'].get('x-api-key', '')
|
||||||
|
|
||||||
|
|
||||||
|
def get_version():
|
||||||
|
return '0.4.0'
|
||||||
|
|
||||||
|
|
||||||
|
def get_port():
|
||||||
|
return '8640'
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if sys.version_info < (3,0):
|
|
||||||
sm_config = ConfigParser.ConfigParser()
|
|
||||||
else:
|
|
||||||
sm_config = configparser.ConfigParser()
|
sm_config = configparser.ConfigParser()
|
||||||
|
|
||||||
sm_config.read('/etc/columnstore/storagemanager.cnf')
|
sm_config.read('/etc/columnstore/storagemanager.cnf')
|
||||||
cs_config = ET.parse('/etc/columnstore/Columnstore.xml')
|
cs_config = ET.parse('/etc/columnstore/Columnstore.xml')
|
||||||
config_root = cs_config.getroot()
|
config_root = cs_config.getroot()
|
||||||
|
|
||||||
if sys.version_info < (3,0):
|
|
||||||
storage = sm_config.get('ObjectStorage', 'service')
|
storage = sm_config.get('ObjectStorage', 'service')
|
||||||
if storage is None:
|
if storage is None:
|
||||||
storage = 'LocalStorage'
|
storage = 'LocalStorage'
|
||||||
bucket = sm_config.get('S3', 'bucket')
|
bucket = sm_config.get('S3', 'bucket')
|
||||||
if bucket is None:
|
if bucket is None:
|
||||||
bucket = 'some_bucket'
|
bucket = 'some_bucket'
|
||||||
else:
|
|
||||||
storage = sm_config.get('ObjectStorage', 'service', fallback='LocalStorage')
|
|
||||||
bucket = sm_config.get('S3', 'bucket', fallback='some_bucket')
|
|
||||||
|
|
||||||
dbrmroot = config_root.find('./SystemConfig/DBRMRoot').text
|
dbrmroot = config_root.find('./SystemConfig/DBRMRoot').text
|
||||||
loadbrm = '/usr/bin/load_brm'
|
loadbrm = '/usr/bin/load_brm'
|
||||||
@@ -60,14 +73,41 @@ if __name__ == '__main__':
|
|||||||
if pmCount > 1:
|
if pmCount > 1:
|
||||||
# load multinode dbrm
|
# load multinode dbrm
|
||||||
try:
|
try:
|
||||||
brm_saves_current = subprocess.check_output(['cat', brm])
|
import requests
|
||||||
|
requests.packages.urllib3.disable_warnings()
|
||||||
|
except ImportError as e:
|
||||||
|
print('requests Python module does not exist. \
|
||||||
|
Please install CMAPI first.', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
try:
|
||||||
|
primary_address = config_root.find('./DBRM_Controller/IPAddr').text
|
||||||
|
api_key = get_key()
|
||||||
|
if len(api_key) == 0:
|
||||||
|
print('Failed to find API key in {}.'.format(api_config_file), \
|
||||||
|
file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
headers = {'x-api-key': api_key}
|
||||||
|
api_version = get_version()
|
||||||
|
api_port = get_port()
|
||||||
|
elems = ['em', 'journal', 'vbbm', 'vss']
|
||||||
|
for e in elems:
|
||||||
|
print("Pulling {} from the primary node.".format(e))
|
||||||
|
url = "https://{}:{}/cmapi/{}/node/meta/{}".format(primary_address, \
|
||||||
|
api_port, api_version, e)
|
||||||
|
r = requests.get(url, verify=False, headers=headers, timeout=2)
|
||||||
|
if (r.status_code != 200):
|
||||||
|
raise RuntimeError("Error requesting {} from the primary \
|
||||||
|
node.".format(e))
|
||||||
|
current_name = '{}_{}'.format(dbrmroot, e)
|
||||||
|
print ("Saving {} to {}".format(e, current_name))
|
||||||
|
path = Path(current_name)
|
||||||
|
path.write_bytes(r.content)
|
||||||
|
except:
|
||||||
|
print('Failed to load meta data from the primary \
|
||||||
|
node {}.'.format(primary_address), file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if not brm_saves_current:
|
brm_saves_current = b"BRM_saves\n"
|
||||||
# local dbrm empty, need to pull from main node
|
|
||||||
pass
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
# will happen when brm file does not exist
|
|
||||||
print('{} does not exist.'.format(brm), file=sys.stderr)
|
|
||||||
else:
|
else:
|
||||||
# load local dbrm
|
# load local dbrm
|
||||||
try:
|
try:
|
||||||
@@ -82,7 +122,7 @@ brm_saves_current.decode("utf-8").replace("BRM_saves", ""))
|
|||||||
try:
|
try:
|
||||||
retcode = subprocess.call(cmd, shell=True)
|
retcode = subprocess.call(cmd, shell=True)
|
||||||
if retcode < 0:
|
if retcode < 0:
|
||||||
pass
|
print('{} exits with {}.'.format(cmd, retcode))
|
||||||
|
sys.exit(1)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
pass
|
sys.exit(1)
|
||||||
|
|||||||
@@ -1,33 +1,15 @@
|
|||||||
${PYTHON_SHEBANG}
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import configparser
|
||||||
if sys.version_info < (3,0):
|
|
||||||
import ConfigParser
|
|
||||||
else:
|
|
||||||
import configparser
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if sys.version_info < (3,0):
|
|
||||||
config = ConfigParser.ConfigParser()
|
|
||||||
else:
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
|
|
||||||
config.read('/etc/columnstore/storagemanager.cnf')
|
config.read('/etc/columnstore/storagemanager.cnf')
|
||||||
|
|
||||||
if sys.version_info < (3,0):
|
|
||||||
storage = config.get('ObjectStorage', 'service')
|
|
||||||
if storage is None:
|
|
||||||
storage = 'LocalStorage'
|
|
||||||
bucket = config.get('S3', 'bucket')
|
|
||||||
if bucket is None:
|
|
||||||
bucket = 'some_bucket'
|
|
||||||
else:
|
|
||||||
storage = config.get('ObjectStorage', 'service', fallback='LocalStorage')
|
storage = config.get('ObjectStorage', 'service', fallback='LocalStorage')
|
||||||
bucket = config.get('S3', 'bucket', fallback='some_bucket')
|
bucket = config.get('S3', 'bucket', fallback='some_bucket')
|
||||||
|
|
||||||
|
|
||||||
if storage.lower() == 's3' and not bucket.lower() == 'some_bucket':
|
if storage.lower() == 's3' and not bucket.lower() == 'some_bucket':
|
||||||
print("Using S3 storage.")
|
print("Using S3 storage.")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
/*
|
/*
|
||||||
* @brief access methods
|
* @brief access methods
|
||||||
*/
|
*/
|
||||||
inline const uint16_t getAlarmID() const
|
inline uint16_t getAlarmID() const
|
||||||
{
|
{
|
||||||
return alarmID;
|
return alarmID;
|
||||||
}
|
}
|
||||||
@@ -76,25 +76,25 @@ public:
|
|||||||
}
|
}
|
||||||
void setComponentID (const std::string&);
|
void setComponentID (const std::string&);
|
||||||
|
|
||||||
inline const uint16_t getSeverity() const
|
inline uint16_t getSeverity() const
|
||||||
{
|
{
|
||||||
return severity;
|
return severity;
|
||||||
}
|
}
|
||||||
void setSeverity (const uint16_t);
|
void setSeverity (const uint16_t);
|
||||||
|
|
||||||
inline const bool getState () const
|
inline bool getState () const
|
||||||
{
|
{
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
void setState (const bool);
|
void setState (const bool);
|
||||||
|
|
||||||
inline const uint16_t getCtnThreshold() const
|
inline uint16_t getCtnThreshold() const
|
||||||
{
|
{
|
||||||
return ctnThreshold;
|
return ctnThreshold;
|
||||||
}
|
}
|
||||||
void setCtnThreshold (const uint16_t);
|
void setCtnThreshold (const uint16_t);
|
||||||
|
|
||||||
inline const uint16_t getOccurrence() const
|
inline uint16_t getOccurrence() const
|
||||||
{
|
{
|
||||||
return occurrence;
|
return occurrence;
|
||||||
}
|
}
|
||||||
@@ -106,19 +106,19 @@ public:
|
|||||||
}
|
}
|
||||||
void setReceiveTime (const time_t);
|
void setReceiveTime (const time_t);
|
||||||
|
|
||||||
inline const uint32_t getLastIssueTime() const
|
inline uint32_t getLastIssueTime() const
|
||||||
{
|
{
|
||||||
return lastIssueTime;
|
return lastIssueTime;
|
||||||
}
|
}
|
||||||
void setLastIssueTime (const uint32_t);
|
void setLastIssueTime (const uint32_t);
|
||||||
|
|
||||||
inline const uint16_t getPid () const
|
inline uint16_t getPid () const
|
||||||
{
|
{
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
void setPid (const uint16_t);
|
void setPid (const uint16_t);
|
||||||
|
|
||||||
inline const uint16_t getTid () const
|
inline uint16_t getTid () const
|
||||||
{
|
{
|
||||||
return tid;
|
return tid;
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ public:
|
|||||||
}
|
}
|
||||||
void setTimestamp (const std::string&);
|
void setTimestamp (const std::string&);
|
||||||
|
|
||||||
inline const time_t getTimestampSeconds () const
|
inline time_t getTimestampSeconds () const
|
||||||
{
|
{
|
||||||
return timestampseconds;
|
return timestampseconds;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief retrieve the Disk Block at lbid, ver from the Disk Block Buffer Cache
|
* @brief retrieve the Disk Block at lbid, ver from the Disk Block Buffer Cache
|
||||||
**/
|
**/
|
||||||
inline const int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, FileBuffer& fb)
|
inline int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, FileBuffer& fb)
|
||||||
{
|
{
|
||||||
return fBCCBrp->read(lbid, ver, fb);
|
return fBCCBrp->read(lbid, ver, fb);
|
||||||
}
|
}
|
||||||
@@ -88,12 +88,12 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief retrieve the Disk Block at lbid, ver from the Disk Block Buffer Cache
|
* @brief retrieve the Disk Block at lbid, ver from the Disk Block Buffer Cache
|
||||||
**/
|
**/
|
||||||
inline const int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, void* bufferPtr)
|
inline int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, void* bufferPtr)
|
||||||
{
|
{
|
||||||
return fBCCBrp->read(lbid, ver, bufferPtr);
|
return fBCCBrp->read(lbid, ver, bufferPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const int getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, const BRM::VER_t txn, const int compType,
|
inline int getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, const BRM::VER_t txn, const int compType,
|
||||||
void* bufferPtr, bool flg, bool& wasCached, bool* wasVersioned = NULL, bool insertIntoCache = true,
|
void* bufferPtr, bool flg, bool& wasCached, bool* wasVersioned = NULL, bool insertIntoCache = true,
|
||||||
bool readFromCache = true)
|
bool readFromCache = true)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ int BlockRequestProcessor::check(BRM::LBID_t lbid, const BRM::QueryContext& ver,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int BlockRequestProcessor::getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, BRM::VER_t txn,
|
int BlockRequestProcessor::getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, BRM::VER_t txn,
|
||||||
int compType, void* bufferPtr, bool vbFlg, bool& wasCached, bool* versioned, bool insertIntoCache,
|
int compType, void* bufferPtr, bool vbFlg, bool& wasCached, bool* versioned, bool insertIntoCache,
|
||||||
bool readFromCache)
|
bool readFromCache)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public:
|
|||||||
return fbMgr.findPtr(HashObject_t(lbid, ver, flg));
|
return fbMgr.findPtr(HashObject_t(lbid, ver, flg));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, FileBuffer& fb)
|
inline int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, FileBuffer& fb)
|
||||||
{
|
{
|
||||||
return (fbMgr.find(HashObject_t(lbid, ver, 0), fb) ? 1 : 0);
|
return (fbMgr.find(HashObject_t(lbid, ver, 0), fb) ? 1 : 0);
|
||||||
}
|
}
|
||||||
@@ -98,12 +98,12 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief retrieve the lbid@ver disk block from the block cache
|
* @brief retrieve the lbid@ver disk block from the block cache
|
||||||
**/
|
**/
|
||||||
inline const int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, void* bufferPtr)
|
inline int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, void* bufferPtr)
|
||||||
{
|
{
|
||||||
return (fbMgr.find(HashObject_t(lbid, ver, 0), bufferPtr) ? 1 : 0);
|
return (fbMgr.find(HashObject_t(lbid, ver, 0), bufferPtr) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, BRM::VER_t txn, int compType,
|
int getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, BRM::VER_t txn, int compType,
|
||||||
void* bufferPtr, bool flg, bool& wasCached, bool* wasVersioned, bool insertIntoCache,
|
void* bufferPtr, bool flg, bool& wasCached, bool* wasVersioned, bool insertIntoCache,
|
||||||
bool readFromCache);
|
bool readFromCache);
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public:
|
|||||||
return fByteData;
|
return fByteData;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const uint32_t datLen() const
|
inline uint32_t datLen() const
|
||||||
{
|
{
|
||||||
return fDataLen;
|
return fDataLen;
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief return the lbid value of disk bloc
|
* @brief return the lbid value of disk bloc
|
||||||
**/
|
**/
|
||||||
inline const BRM::LBID_t Lbid() const
|
inline BRM::LBID_t Lbid() const
|
||||||
{
|
{
|
||||||
return fLbid;
|
return fLbid;
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief return the version of this disk block. ignored for range retrievals
|
* @brief return the version of this disk block. ignored for range retrievals
|
||||||
**/
|
**/
|
||||||
inline const BRM::VER_t Verid() const
|
inline BRM::VER_t Verid() const
|
||||||
{
|
{
|
||||||
return fVerid;
|
return fVerid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setReportingFrequency(const uint32_t d);
|
void setReportingFrequency(const uint32_t d);
|
||||||
const uint32_t ReportingFrequency() const
|
uint32_t ReportingFrequency() const
|
||||||
{
|
{
|
||||||
return fReportFrequency;
|
return fReportFrequency;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief lbid requested
|
* @brief lbid requested
|
||||||
**/
|
**/
|
||||||
const BRM::LBID_t Lbid() const
|
BRM::LBID_t Lbid() const
|
||||||
{
|
{
|
||||||
return fLBID;
|
return fLBID;
|
||||||
}
|
}
|
||||||
@@ -146,17 +146,17 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief VBBM flag of the LBID/Ver
|
* @brief VBBM flag of the LBID/Ver
|
||||||
**/
|
**/
|
||||||
const bool Flg() const
|
bool Flg() const
|
||||||
{
|
{
|
||||||
return fFlg;
|
return fFlg;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BRM::VER_t Txn() const
|
BRM::VER_t Txn() const
|
||||||
{
|
{
|
||||||
return fTxn;
|
return fTxn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int CompType() const
|
int CompType() const
|
||||||
{
|
{
|
||||||
return fCompType;
|
return fCompType;
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief number of blocks requested
|
* @brief number of blocks requested
|
||||||
**/
|
**/
|
||||||
const uint32_t BlocksRequested() const
|
uint32_t BlocksRequested() const
|
||||||
{
|
{
|
||||||
return fLength;
|
return fLength;
|
||||||
}
|
}
|
||||||
@@ -180,11 +180,11 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief number of blocks read from disk
|
* @brief number of blocks read from disk
|
||||||
**/
|
**/
|
||||||
const uint32_t BlocksRead() const
|
uint32_t BlocksRead() const
|
||||||
{
|
{
|
||||||
return fblksRead;
|
return fblksRead;
|
||||||
}
|
}
|
||||||
const uint32_t BlocksLoaded() const
|
uint32_t BlocksLoaded() const
|
||||||
{
|
{
|
||||||
return fblksLoaded;
|
return fblksLoaded;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1368,7 +1368,7 @@ void ioManager::buildOidFileName(const BRM::OID_t oid, uint16_t dbRoot, const ui
|
|||||||
fFileOp.getFileNameForPrimProc(oid, file_name, dbRoot, partNum, segNum);
|
fFileOp.getFileNameForPrimProc(oid, file_name, dbRoot, partNum, segNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int ioManager::localLbidLookup(BRM::LBID_t lbid,
|
int ioManager::localLbidLookup(BRM::LBID_t lbid,
|
||||||
BRM::VER_t verid,
|
BRM::VER_t verid,
|
||||||
bool vbFlag,
|
bool vbFlag,
|
||||||
BRM::OID_t& oid,
|
BRM::OID_t& oid,
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public:
|
|||||||
return fConfig;
|
return fConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int localLbidLookup(BRM::LBID_t lbid,
|
int localLbidLookup(BRM::LBID_t lbid,
|
||||||
BRM::VER_t verid,
|
BRM::VER_t verid,
|
||||||
bool vbFlag,
|
bool vbFlag,
|
||||||
BRM::OID_t& oid,
|
BRM::OID_t& oid,
|
||||||
@@ -88,7 +88,7 @@ public:
|
|||||||
const uint16_t segNum,
|
const uint16_t segNum,
|
||||||
char* file_name);
|
char* file_name);
|
||||||
|
|
||||||
const uint32_t getExtentRows()
|
uint32_t getExtentRows()
|
||||||
{
|
{
|
||||||
return fdbrm.getExtentRows();
|
return fdbrm.getExtentRows();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -389,7 +389,7 @@ void BPPSeeder::sendErrorMsg(uint32_t id, uint16_t status, uint32_t step)
|
|||||||
{
|
{
|
||||||
|
|
||||||
ISMPacketHeader ism;
|
ISMPacketHeader ism;
|
||||||
PrimitiveHeader ph = {0};
|
PrimitiveHeader ph = {0,0,0,0,0,0};
|
||||||
|
|
||||||
ism.Status = status;
|
ism.Status = status;
|
||||||
ph.UniqueID = id;
|
ph.UniqueID = id;
|
||||||
|
|||||||
@@ -899,7 +899,7 @@ void ColumnCommand::enableFilters()
|
|||||||
* RETURN:
|
* RETURN:
|
||||||
* emptyVal - the value of empty row
|
* emptyVal - the value of empty row
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
const uint64_t ColumnCommand::getEmptyRowValue( const execplan::CalpontSystemCatalog::ColDataType dataType, const int width ) const
|
uint64_t ColumnCommand::getEmptyRowValue( const execplan::CalpontSystemCatalog::ColDataType dataType, const int width ) const
|
||||||
{
|
{
|
||||||
uint64_t emptyVal = 0;
|
uint64_t emptyVal = 0;
|
||||||
int offset;
|
int offset;
|
||||||
@@ -998,7 +998,7 @@ void ColumnCommand::getLBIDList(uint32_t loopCount, vector<int64_t>* lbids)
|
|||||||
lbids->push_back(i);
|
lbids->push_back(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int64_t ColumnCommand::getLastLbid()
|
int64_t ColumnCommand::getLastLbid()
|
||||||
{
|
{
|
||||||
if (!_isScan)
|
if (!_isScan)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ public:
|
|||||||
makeAbsRids = m;
|
makeAbsRids = m;
|
||||||
}
|
}
|
||||||
bool willPrefetch();
|
bool willPrefetch();
|
||||||
const uint64_t getEmptyRowValue( const execplan::CalpontSystemCatalog::ColDataType dataType, const int width ) const;
|
uint64_t getEmptyRowValue( const execplan::CalpontSystemCatalog::ColDataType dataType, const int width ) const;
|
||||||
const int64_t getLastLbid();
|
int64_t getLastLbid();
|
||||||
void getLBIDList(uint32_t loopCount, std::vector<int64_t>* lbids);
|
void getLBIDList(uint32_t loopCount, std::vector<int64_t>* lbids);
|
||||||
|
|
||||||
virtual SCommand duplicate();
|
virtual SCommand duplicate();
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// int fCacheCount;
|
// int fCacheCount;
|
||||||
const int ReadAheadBlocks() const
|
int ReadAheadBlocks() const
|
||||||
{
|
{
|
||||||
return fReadAheadBlocks;
|
return fReadAheadBlocks;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace storagemanager
|
|||||||
class CloudStorage
|
class CloudStorage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~CloudStorage(){};
|
||||||
/* These behave like syscalls. return code -1 means an error, and errno is set */
|
/* These behave like syscalls. return code -1 means an error, and errno is set */
|
||||||
virtual int getObject(const std::string &sourceKey, const std::string &destFile, size_t *size = NULL) = 0;
|
virtual int getObject(const std::string &sourceKey, const std::string &destFile, size_t *size = NULL) = 0;
|
||||||
virtual int getObject(const std::string &sourceKey, boost::shared_array<uint8_t> *data, size_t *size = NULL) = 0;
|
virtual int getObject(const std::string &sourceKey, boost::shared_array<uint8_t> *data, size_t *size = NULL) = 0;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ namespace storagemanager
|
|||||||
class ConfigListener
|
class ConfigListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~ConfigListener(){};
|
||||||
virtual void configListener() = 0;
|
virtual void configListener() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class Downloader : public ConfigListener
|
|||||||
{
|
{
|
||||||
Download(const std::string &source, const boost::filesystem::path &_dlPath, boost::mutex *, Downloader *);
|
Download(const std::string &source, const boost::filesystem::path &_dlPath, boost::mutex *, Downloader *);
|
||||||
Download(const std::string &source);
|
Download(const std::string &source);
|
||||||
~Download();
|
virtual ~Download();
|
||||||
void operator()();
|
void operator()();
|
||||||
boost::filesystem::path dlPath;
|
boost::filesystem::path dlPath;
|
||||||
const std::string key;
|
const std::string key;
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class Synchronizer : public boost::noncopyable , public ConfigListener
|
|||||||
|
|
||||||
struct Job : public ThreadPool::Job
|
struct Job : public ThreadPool::Job
|
||||||
{
|
{
|
||||||
|
virtual ~Job(){};
|
||||||
Job(Synchronizer *s, std::list<std::string>::iterator i);
|
Job(Synchronizer *s, std::list<std::string>::iterator i);
|
||||||
void operator()();
|
void operator()();
|
||||||
Synchronizer *sync;
|
Synchronizer *sync;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class ThreadPool : public boost::noncopyable
|
|||||||
class Job
|
class Job
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~Job(){};
|
||||||
virtual void operator()() = 0;
|
virtual void operator()() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,12 @@ namespace anyimpl
|
|||||||
virtual void move(void* const* src, void** dest) = 0;
|
virtual void move(void* const* src, void** dest) = 0;
|
||||||
virtual void* get_value(void** src) = 0;
|
virtual void* get_value(void** src) = 0;
|
||||||
virtual size_t get_size() = 0;
|
virtual size_t get_size() = 0;
|
||||||
|
protected:
|
||||||
|
~base_any_policy() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//inline base_any_policy::~base_any_policy() throw () {}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct typed_base_any_policy : base_any_policy
|
struct typed_base_any_policy : base_any_policy
|
||||||
{
|
{
|
||||||
@@ -38,11 +42,14 @@ namespace anyimpl
|
|||||||
{
|
{
|
||||||
return sizeof(T);
|
return sizeof(T);
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
~typed_base_any_policy() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct small_any_policy : typed_base_any_policy<T>
|
struct small_any_policy : typed_base_any_policy<T>
|
||||||
{
|
{
|
||||||
|
virtual ~small_any_policy() = default;
|
||||||
virtual void static_delete(void** x)
|
virtual void static_delete(void** x)
|
||||||
{
|
{
|
||||||
*x = 0;
|
*x = 0;
|
||||||
@@ -68,6 +75,7 @@ namespace anyimpl
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
struct big_any_policy : typed_base_any_policy<T>
|
struct big_any_policy : typed_base_any_policy<T>
|
||||||
{
|
{
|
||||||
|
virtual ~big_any_policy() = default;
|
||||||
virtual void static_delete(void** x)
|
virtual void static_delete(void** x)
|
||||||
{
|
{
|
||||||
if (*x)
|
if (*x)
|
||||||
|
|||||||
@@ -170,15 +170,15 @@ public:
|
|||||||
return getDoubleVal(row, fp, isNull, op_ct);
|
return getDoubleVal(row, fp, isNull, op_ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
const float floatNullVal() const
|
float floatNullVal() const
|
||||||
{
|
{
|
||||||
return fFloatNullVal;
|
return fFloatNullVal;
|
||||||
}
|
}
|
||||||
const double doubleNullVal() const
|
double doubleNullVal() const
|
||||||
{
|
{
|
||||||
return fDoubleNullVal;
|
return fDoubleNullVal;
|
||||||
}
|
}
|
||||||
const long double longDoubleNullVal() const
|
long double longDoubleNullVal() const
|
||||||
{
|
{
|
||||||
return fLongDoubleNullVal;
|
return fLongDoubleNullVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const void stringValue(execplan::SPTP& fp, rowgroup::Row& row, bool& isNull, std::string& fFloatStr)
|
void stringValue(execplan::SPTP& fp, rowgroup::Row& row, bool& isNull, std::string& fFloatStr)
|
||||||
{
|
{
|
||||||
// Bug3788, use the shorter of fixed or scientific notation for floating point values.
|
// Bug3788, use the shorter of fixed or scientific notation for floating point values.
|
||||||
// [ the default format in treenode.h is fixed-point notation ]
|
// [ the default format in treenode.h is fixed-point notation ]
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ class CompressedInetStreamSocket : public InetStreamSocket
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CompressedInetStreamSocket();
|
CompressedInetStreamSocket();
|
||||||
|
virtual ~CompressedInetStreamSocket(){};
|
||||||
|
|
||||||
|
using InetStreamSocket::operator=;
|
||||||
virtual Socket* clone() const;
|
virtual Socket* clone() const;
|
||||||
virtual const SBS read(const struct timespec* timeout = 0, bool* isTimeOut = NULL,
|
virtual const SBS read(const struct timespec* timeout = 0, bool* isTimeOut = NULL,
|
||||||
Stats* stats = NULL) const;
|
Stats* stats = NULL) const;
|
||||||
|
|||||||
@@ -1105,7 +1105,7 @@ const string InetStreamSocket::addr2String() const
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool InetStreamSocket::isSameAddr(const Socket* rhs) const
|
bool InetStreamSocket::isSameAddr(const Socket* rhs) const
|
||||||
{
|
{
|
||||||
const InetStreamSocket* issp = dynamic_cast<const InetStreamSocket*>(rhs);
|
const InetStreamSocket* issp = dynamic_cast<const InetStreamSocket*>(rhs);
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public:
|
|||||||
/** test if this socket is open
|
/** test if this socket is open
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
inline virtual const bool isOpen() const;
|
inline virtual bool isOpen() const;
|
||||||
|
|
||||||
/** read a message from the socket
|
/** read a message from the socket
|
||||||
*
|
*
|
||||||
@@ -180,7 +180,7 @@ public:
|
|||||||
fSyncProto = use;
|
fSyncProto = use;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int getConnectionNum() const
|
int getConnectionNum() const
|
||||||
{
|
{
|
||||||
return fSocketParms.sd();
|
return fSocketParms.sd();
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ public:
|
|||||||
/** compare 2 addresses
|
/** compare 2 addresses
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual const bool isSameAddr(const Socket* rhs) const;
|
virtual bool isSameAddr(const Socket* rhs) const;
|
||||||
|
|
||||||
/** ping an ip address
|
/** ping an ip address
|
||||||
*
|
*
|
||||||
@@ -255,7 +255,7 @@ private:
|
|||||||
void doCopy(const InetStreamSocket& rhs);
|
void doCopy(const InetStreamSocket& rhs);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const bool InetStreamSocket::isOpen() const
|
inline bool InetStreamSocket::isOpen() const
|
||||||
{
|
{
|
||||||
return (fSocketParms.sd() >= 0);
|
return (fSocketParms.sd() >= 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public:
|
|||||||
/** test if the socket is open
|
/** test if the socket is open
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
inline virtual const bool isOpen() const;
|
inline virtual bool isOpen() const;
|
||||||
|
|
||||||
/** get the socket params
|
/** get the socket params
|
||||||
*
|
*
|
||||||
@@ -150,7 +150,7 @@ public:
|
|||||||
fSocket->syncProto(use);
|
fSocket->syncProto(use);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT virtual const int getConnectionNum() const;
|
EXPORT virtual int getConnectionNum() const;
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
EXPORT void setSockID(uint32_t id)
|
EXPORT void setSockID(uint32_t id)
|
||||||
@@ -175,7 +175,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief compare 2 addresses
|
* @brief compare 2 addresses
|
||||||
*/
|
*/
|
||||||
virtual const bool isSameAddr(const IOSocket* rhs) const
|
virtual bool isSameAddr(const IOSocket* rhs) const
|
||||||
{
|
{
|
||||||
return fSocket->isSameAddr(rhs->fSocket);
|
return fSocket->isSameAddr(rhs->fSocket);
|
||||||
}
|
}
|
||||||
@@ -235,7 +235,7 @@ inline void IOSocket::close()
|
|||||||
{
|
{
|
||||||
if (fSocket) fSocket->close();
|
if (fSocket) fSocket->close();
|
||||||
}
|
}
|
||||||
inline const bool IOSocket::isOpen() const
|
inline bool IOSocket::isOpen() const
|
||||||
{
|
{
|
||||||
return (fSocket && fSocket->isOpen());
|
return (fSocket && fSocket->isOpen());
|
||||||
}
|
}
|
||||||
@@ -274,7 +274,7 @@ inline void IOSocket::setSocketImpl(Socket* socket)
|
|||||||
delete fSocket;
|
delete fSocket;
|
||||||
fSocket = socket;
|
fSocket = socket;
|
||||||
}
|
}
|
||||||
inline const int IOSocket::getConnectionNum() const
|
inline int IOSocket::getConnectionNum() const
|
||||||
{
|
{
|
||||||
return fSocket->getConnectionNum();
|
return fSocket->getConnectionNum();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fOtherEnd;
|
return fOtherEnd;
|
||||||
}
|
}
|
||||||
EXPORT const bool isAvailable() const
|
EXPORT bool isAvailable() const
|
||||||
{
|
{
|
||||||
return fIsAvailable;
|
return fIsAvailable;
|
||||||
}
|
}
|
||||||
@@ -267,7 +267,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief compare the addresses of 2 MessageQueueClient
|
* @brief compare the addresses of 2 MessageQueueClient
|
||||||
*/
|
*/
|
||||||
inline const bool isSameAddr(const MessageQueueClient& rhs) const;
|
inline bool isSameAddr(const MessageQueueClient& rhs) const;
|
||||||
|
|
||||||
bool isConnected()
|
bool isConnected()
|
||||||
{
|
{
|
||||||
@@ -316,7 +316,7 @@ inline const std::string MessageQueueClient::addr2String() const
|
|||||||
{
|
{
|
||||||
return fClientSock.addr2String();
|
return fClientSock.addr2String();
|
||||||
}
|
}
|
||||||
inline const bool MessageQueueClient::isSameAddr(const MessageQueueClient& rhs) const
|
inline bool MessageQueueClient::isSameAddr(const MessageQueueClient& rhs) const
|
||||||
{
|
{
|
||||||
return fClientSock.isSameAddr(&rhs.fClientSock);
|
return fClientSock.isSameAddr(&rhs.fClientSock);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public:
|
|||||||
/** test if this socket is open
|
/** test if this socket is open
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual const bool isOpen() const = 0;
|
virtual bool isOpen() const = 0;
|
||||||
|
|
||||||
/** get the SocketParms
|
/** get the SocketParms
|
||||||
*
|
*
|
||||||
@@ -158,7 +158,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void syncProto(bool use) = 0;
|
virtual void syncProto(bool use) = 0;
|
||||||
|
|
||||||
virtual const int getConnectionNum() const = 0;
|
virtual int getConnectionNum() const = 0;
|
||||||
|
|
||||||
/** return the address as a string
|
/** return the address as a string
|
||||||
*
|
*
|
||||||
@@ -168,7 +168,7 @@ public:
|
|||||||
/** compare 2 addresses
|
/** compare 2 addresses
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual const bool isSameAddr(const Socket* rhs) const = 0;
|
virtual bool isSameAddr(const Socket* rhs) const = 0;
|
||||||
|
|
||||||
virtual bool isConnected() const = 0;
|
virtual bool isConnected() const = 0;
|
||||||
virtual bool hasData() const = 0;
|
virtual bool hasData() const = 0;
|
||||||
|
|||||||
@@ -1096,9 +1096,12 @@ public:
|
|||||||
const std::vector<SP_ROWAGG_FUNC_t>& funct);
|
const std::vector<SP_ROWAGG_FUNC_t>& funct);
|
||||||
|
|
||||||
void setInputOutput(const RowGroup& pRowGroupIn, RowGroup* pRowGroupOut);
|
void setInputOutput(const RowGroup& pRowGroupIn, RowGroup* pRowGroupOut);
|
||||||
|
using RowAggregationDistinct::addRowGroup;
|
||||||
void addRowGroup(const RowGroup* pRowGroupIn);
|
void addRowGroup(const RowGroup* pRowGroupIn);
|
||||||
|
|
||||||
|
using RowAggregationDistinct::doDistinctAggregation;
|
||||||
virtual void doDistinctAggregation();
|
virtual void doDistinctAggregation();
|
||||||
|
using RowAggregationDistinct::doDistinctAggregation_rowVec;
|
||||||
virtual void doDistinctAggregation_rowVec(std::vector<std::vector<Row::Pointer> >& inRows);
|
virtual void doDistinctAggregation_rowVec(std::vector<std::vector<Row::Pointer> >& inRows);
|
||||||
|
|
||||||
inline virtual RowAggregationMultiDistinct* clone() const
|
inline virtual RowAggregationMultiDistinct* clone() const
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ void PriorityThreadPool::threadFcn(const Priority preferredQueue) throw()
|
|||||||
void PriorityThreadPool::sendErrorMsg(uint32_t id, uint32_t step, primitiveprocessor::SP_UM_IOSOCK sock)
|
void PriorityThreadPool::sendErrorMsg(uint32_t id, uint32_t step, primitiveprocessor::SP_UM_IOSOCK sock)
|
||||||
{
|
{
|
||||||
ISMPacketHeader ism;
|
ISMPacketHeader ism;
|
||||||
PrimitiveHeader ph = {};
|
PrimitiveHeader ph = {0,0,0,0,0,0};
|
||||||
|
|
||||||
ism.Status = logging::primitiveServerErr;
|
ism.Status = logging::primitiveServerErr;
|
||||||
ph.UniqueID = id;
|
ph.UniqueID = id;
|
||||||
|
|||||||
@@ -3257,7 +3257,7 @@ boost::shared_array<SIDTIDEntry> DBRM::SIDTIDMap(int& len)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t DBRM::getUnique32()
|
uint32_t DBRM::getUnique32()
|
||||||
{
|
{
|
||||||
#ifdef BRM_INFO
|
#ifdef BRM_INFO
|
||||||
|
|
||||||
@@ -3306,7 +3306,7 @@ const uint32_t DBRM::getUnique32()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint64_t DBRM::getUnique64()
|
uint64_t DBRM::getUnique64()
|
||||||
{
|
{
|
||||||
#ifdef BRM_INFO
|
#ifdef BRM_INFO
|
||||||
|
|
||||||
|
|||||||
@@ -791,8 +791,8 @@ public:
|
|||||||
|
|
||||||
/* Note, these pull #s from two separate sequences. That is, they both
|
/* Note, these pull #s from two separate sequences. That is, they both
|
||||||
return 0, then 1, 2, 3, etc. */
|
return 0, then 1, 2, 3, etc. */
|
||||||
EXPORT const uint32_t getUnique32();
|
EXPORT uint32_t getUnique32();
|
||||||
EXPORT const uint64_t getUnique64();
|
EXPORT uint64_t getUnique64();
|
||||||
|
|
||||||
/* New table lock interface */
|
/* New table lock interface */
|
||||||
/* returns a unique ID (> 0) for the lock on success, 0 on failure.
|
/* returns a unique ID (> 0) for the lock on success, 0 on failure.
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ public:
|
|||||||
* TableInfo::fSyncUpdatesTI mutex should be locked when calling this
|
* TableInfo::fSyncUpdatesTI mutex should be locked when calling this
|
||||||
* function (see fColumnLocks discussion).
|
* function (see fColumnLocks discussion).
|
||||||
*/
|
*/
|
||||||
const int getColumnLocker(const int& columnId) const
|
int getColumnLocker(const int& columnId) const
|
||||||
{
|
{
|
||||||
return fColumnLocks[columnId].locker;
|
return fColumnLocks[columnId].locker;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -272,6 +272,7 @@ public:
|
|||||||
virtual ~ColumnBufferManagerDctnry();
|
virtual ~ColumnBufferManagerDctnry();
|
||||||
|
|
||||||
virtual int rowsExtentCheck( int nRows, int& nRows2 );
|
virtual int rowsExtentCheck( int nRows, int& nRows2 );
|
||||||
|
using ColumnBufferManager::writeToFileExtentCheck;
|
||||||
virtual int writeToFileExtentCheck(uint32_t startOffset, uint32_t writeSize);
|
virtual int writeToFileExtentCheck(uint32_t startOffset, uint32_t writeSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ int Dctnry::createDctnry( const OID& dctnryOID, int colWidth,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = BRMWrapper::getInstance()->allocateDictStoreExtent(
|
rc = BRMWrapper::getInstance()->allocateDictStoreExtent(
|
||||||
(const OID)m_dctnryOID, m_dbRoot, m_partition, m_segment,
|
(OID)m_dctnryOID, m_dbRoot, m_partition, m_segment,
|
||||||
startLbid, allocSize);
|
startLbid, allocSize);
|
||||||
|
|
||||||
if (rc != NO_ERROR)
|
if (rc != NO_ERROR)
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Mutator to enable/disable debug logging to console.
|
* @brief Mutator to enable/disable debug logging to console.
|
||||||
*/
|
*/
|
||||||
const void setDebugConsole ( bool debug )
|
void setDebugConsole ( bool debug )
|
||||||
{
|
{
|
||||||
fDebugConsole = debug;
|
fDebugConsole = debug;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ void Cache::clear()
|
|||||||
* RETURN:
|
* RETURN:
|
||||||
* NO_ERROR if success, other otherwise
|
* NO_ERROR if success, other otherwise
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
const int Cache::flushCache()
|
int Cache::flushCache()
|
||||||
{
|
{
|
||||||
bool bHasReadBlock = false;
|
bool bHasReadBlock = false;
|
||||||
BlockBuffer* curBuf;
|
BlockBuffer* curBuf;
|
||||||
@@ -216,7 +216,7 @@ void Cache::freeMemory()
|
|||||||
* RETURN:
|
* RETURN:
|
||||||
* NO_ERROR if success, other otherwise
|
* NO_ERROR if success, other otherwise
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
const int Cache::getListSize( const CacheListType listType )
|
int Cache::getListSize( const CacheListType listType )
|
||||||
{
|
{
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ void Cache::init( const int totalBlock, const int chkPoint, const int pctFree )
|
|||||||
* RETURN:
|
* RETURN:
|
||||||
* NO_ERROR if success, other otherwise
|
* NO_ERROR if success, other otherwise
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
const int Cache::insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const unsigned char* buf )
|
int Cache::insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const unsigned char* buf )
|
||||||
{
|
{
|
||||||
BlockBuffer* buffer;
|
BlockBuffer* buffer;
|
||||||
vector<BlockBuffer*>::iterator it;
|
vector<BlockBuffer*>::iterator it;
|
||||||
@@ -322,7 +322,7 @@ const int Cache::insertLRUList( CommBlock& cb, const uint64_t lbid, const uint6
|
|||||||
* RETURN:
|
* RETURN:
|
||||||
* NO_ERROR if success, other otherwise
|
* NO_ERROR if success, other otherwise
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
const int Cache::loadCacheBlock( const CacheKey& key, unsigned char* buf )
|
int Cache::loadCacheBlock( const CacheKey& key, unsigned char* buf )
|
||||||
{
|
{
|
||||||
BlockBuffer* buffer;
|
BlockBuffer* buffer;
|
||||||
CacheMapIt iter;
|
CacheMapIt iter;
|
||||||
@@ -356,7 +356,7 @@ const int Cache::loadCacheBlock( const CacheKey& key, unsigned char* buf )
|
|||||||
* RETURN:
|
* RETURN:
|
||||||
* NO_ERROR if success, other otherwise
|
* NO_ERROR if success, other otherwise
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
const int Cache::modifyCacheBlock( const CacheKey& key, const unsigned char* buf )
|
int Cache::modifyCacheBlock( const CacheKey& key, const unsigned char* buf )
|
||||||
{
|
{
|
||||||
BlockBuffer* buffer;
|
BlockBuffer* buffer;
|
||||||
CacheMapIt iter;
|
CacheMapIt iter;
|
||||||
@@ -437,7 +437,7 @@ void Cache::printCacheList()
|
|||||||
* RETURN:
|
* RETURN:
|
||||||
* NO_ERROR if success, other otherwise
|
* NO_ERROR if success, other otherwise
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
const int Cache::processCacheMap( CacheMap* map, BlockBuffer* buffer, OpType opType )
|
int Cache::processCacheMap( CacheMap* map, BlockBuffer* buffer, OpType opType )
|
||||||
{
|
{
|
||||||
RETURN_ON_NULL( buffer, ERR_NULL_BLOCK );
|
RETURN_ON_NULL( buffer, ERR_NULL_BLOCK );
|
||||||
CacheMapIt iter;
|
CacheMapIt iter;
|
||||||
|
|||||||
@@ -100,16 +100,16 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Check whether cache key exists
|
* @brief Check whether cache key exists
|
||||||
*/
|
*/
|
||||||
static const bool cacheKeyExist( CacheMap* map, const OID oid, const uint64_t lbid )
|
static bool cacheKeyExist( CacheMap* map, const OID oid, const uint64_t lbid )
|
||||||
{
|
{
|
||||||
CacheKey key = getCacheKey( oid, lbid );
|
CacheKey key = getCacheKey( oid, lbid );
|
||||||
return map->find(key) == map->end() ? false : true;
|
return map->find(key) == map->end() ? false : true;
|
||||||
}
|
}
|
||||||
static const bool cacheKeyExist( CacheMap* map, BlockBuffer* buffer )
|
static bool cacheKeyExist( CacheMap* map, BlockBuffer* buffer )
|
||||||
{
|
{
|
||||||
return cacheKeyExist( map, (*buffer).cb.file.oid, (*buffer).block.lbid );
|
return cacheKeyExist( map, (*buffer).cb.file.oid, (*buffer).block.lbid );
|
||||||
}
|
}
|
||||||
static const bool cacheKeyExist( const OID oid, const uint64_t lbid )
|
static bool cacheKeyExist( const OID oid, const uint64_t lbid )
|
||||||
{
|
{
|
||||||
return cacheKeyExist( m_lruList, oid, lbid ) || cacheKeyExist( m_writeList, oid, lbid );
|
return cacheKeyExist( m_lruList, oid, lbid ) || cacheKeyExist( m_writeList, oid, lbid );
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Flush the write cache
|
* @brief Flush the write cache
|
||||||
*/
|
*/
|
||||||
EXPORT static const int flushCache();
|
EXPORT static int flushCache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the cache key
|
* @brief Get the cache key
|
||||||
@@ -142,7 +142,7 @@ public:
|
|||||||
return getCacheKey( (*buffer).cb.file.oid, (*buffer).block.lbid );
|
return getCacheKey( (*buffer).cb.file.oid, (*buffer).block.lbid );
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT static const int getListSize( const CacheListType listType );
|
EXPORT static int getListSize( const CacheListType listType );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Init the buffers
|
* @brief Init the buffers
|
||||||
@@ -156,8 +156,8 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Insert into LRU list
|
* @brief Insert into LRU list
|
||||||
*/
|
*/
|
||||||
EXPORT static const int insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const unsigned char* buf );
|
EXPORT static int insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const unsigned char* buf );
|
||||||
static const int insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const DataBlock& block )
|
static int insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const DataBlock& block )
|
||||||
{
|
{
|
||||||
return insertLRUList( cb, lbid, fbo, block.data );
|
return insertLRUList( cb, lbid, fbo, block.data );
|
||||||
}
|
}
|
||||||
@@ -170,20 +170,20 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Load cache block to a buffer
|
* @brief Load cache block to a buffer
|
||||||
*/
|
*/
|
||||||
static const int loadCacheBlock( const CacheKey& key, DataBlock& block )
|
static int loadCacheBlock( const CacheKey& key, DataBlock& block )
|
||||||
{
|
{
|
||||||
return loadCacheBlock( key, block.data );
|
return loadCacheBlock( key, block.data );
|
||||||
}
|
}
|
||||||
EXPORT static const int loadCacheBlock( const CacheKey& key, unsigned char* buf );
|
EXPORT static int loadCacheBlock( const CacheKey& key, unsigned char* buf );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Modify a cache block
|
* @brief Modify a cache block
|
||||||
*/
|
*/
|
||||||
static const int modifyCacheBlock( const CacheKey& key, const DataBlock& block )
|
static int modifyCacheBlock( const CacheKey& key, const DataBlock& block )
|
||||||
{
|
{
|
||||||
return modifyCacheBlock( key, block.data );
|
return modifyCacheBlock( key, block.data );
|
||||||
}
|
}
|
||||||
EXPORT static const int modifyCacheBlock( const CacheKey& key, const unsigned char* buf );
|
EXPORT static int modifyCacheBlock( const CacheKey& key, const unsigned char* buf );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Print
|
* @brief Print
|
||||||
@@ -194,14 +194,14 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Insert/Delete an element in cache map
|
* @brief Insert/Delete an element in cache map
|
||||||
*/
|
*/
|
||||||
EXPORT static const int processCacheMap( CacheMap* map, BlockBuffer* buffer, OpType opType );
|
EXPORT static int processCacheMap( CacheMap* map, BlockBuffer* buffer, OpType opType );
|
||||||
|
|
||||||
// accessory
|
// accessory
|
||||||
static const int getTotalBlock()
|
static int getTotalBlock()
|
||||||
{
|
{
|
||||||
return m_cacheParam->totalBlock;
|
return m_cacheParam->totalBlock;
|
||||||
}
|
}
|
||||||
static const bool getUseCache()
|
static bool getUseCache()
|
||||||
{
|
{
|
||||||
return m_useCache;
|
return m_useCache;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ int DbFileOp::readDBFile( CommBlock& cb,
|
|||||||
* NO_ERROR if success
|
* NO_ERROR if success
|
||||||
* other number if something wrong
|
* other number if something wrong
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
const int DbFileOp::readSubBlockEntry( IDBDataFile* pFile, DataBlock* block,
|
int DbFileOp::readSubBlockEntry( IDBDataFile* pFile, DataBlock* block,
|
||||||
const uint64_t lbid, const int sbid,
|
const uint64_t lbid, const int sbid,
|
||||||
const int entryNo, const int width,
|
const int entryNo, const int width,
|
||||||
void* pStruct )
|
void* pStruct )
|
||||||
@@ -229,7 +229,7 @@ const int DbFileOp::readSubBlockEntry( IDBDataFile* pFile, DataBlock* block,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const int DbFileOp::readSubBlockEntry( CommBlock& cb, DataBlock* block,
|
int DbFileOp::readSubBlockEntry( CommBlock& cb, DataBlock* block,
|
||||||
const uint64_t lbid, const int sbid,
|
const uint64_t lbid, const int sbid,
|
||||||
const int entryNo, const int width,
|
const int entryNo, const int width,
|
||||||
void* pStruct )
|
void* pStruct )
|
||||||
@@ -406,7 +406,7 @@ int DbFileOp::writeDBFileFbo(IDBDataFile* pFile, const unsigned char* writeBuf,
|
|||||||
* NO_ERROR if success
|
* NO_ERROR if success
|
||||||
* other number if something wrong
|
* other number if something wrong
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
const int DbFileOp::writeSubBlockEntry( IDBDataFile* pFile, DataBlock* block,
|
int DbFileOp::writeSubBlockEntry( IDBDataFile* pFile, DataBlock* block,
|
||||||
const uint64_t lbid, const int sbid,
|
const uint64_t lbid, const int sbid,
|
||||||
const int entryNo, const int width,
|
const int entryNo, const int width,
|
||||||
void* pStruct )
|
void* pStruct )
|
||||||
@@ -417,7 +417,7 @@ const int DbFileOp::writeSubBlockEntry( IDBDataFile* pFile, DataBlock* block,
|
|||||||
return writeDBFile( pFile, block->data, lbid );
|
return writeDBFile( pFile, block->data, lbid );
|
||||||
}
|
}
|
||||||
|
|
||||||
const int DbFileOp::writeSubBlockEntry( CommBlock& cb, DataBlock* block,
|
int DbFileOp::writeSubBlockEntry( CommBlock& cb, DataBlock* block,
|
||||||
const uint64_t lbid, const int sbid,
|
const uint64_t lbid, const int sbid,
|
||||||
const int entryNo, const int width,
|
const int entryNo, const int width,
|
||||||
void* pStruct )
|
void* pStruct )
|
||||||
@@ -438,7 +438,7 @@ const int DbFileOp::writeSubBlockEntry( CommBlock& cb, DataBlock* block,
|
|||||||
* NO_ERROR if success
|
* NO_ERROR if success
|
||||||
* other number if something wrong
|
* other number if something wrong
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
const int DbFileOp::writeVB( IDBDataFile* pFile, const OID oid, const uint64_t lbid )
|
int DbFileOp::writeVB( IDBDataFile* pFile, const OID oid, const uint64_t lbid )
|
||||||
{
|
{
|
||||||
if ( !BRMWrapper::getUseVb() )
|
if ( !BRMWrapper::getUseVb() )
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public:
|
|||||||
* @brief Get an entry within a subblock and also populate block buffer
|
* @brief Get an entry within a subblock and also populate block buffer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
EXPORT const int readSubBlockEntry(IDBDataFile* pFile,
|
EXPORT int readSubBlockEntry(IDBDataFile* pFile,
|
||||||
DataBlock* block,
|
DataBlock* block,
|
||||||
const uint64_t lbid,
|
const uint64_t lbid,
|
||||||
const int sbid,
|
const int sbid,
|
||||||
@@ -113,7 +113,7 @@ public:
|
|||||||
const int width,
|
const int width,
|
||||||
void* pStruct ) ;
|
void* pStruct ) ;
|
||||||
|
|
||||||
EXPORT const int readSubBlockEntry(CommBlock& cb,
|
EXPORT int readSubBlockEntry(CommBlock& cb,
|
||||||
DataBlock* block,
|
DataBlock* block,
|
||||||
const uint64_t lbid,
|
const uint64_t lbid,
|
||||||
const int sbid,
|
const int sbid,
|
||||||
@@ -196,7 +196,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Write a sub block entry directly to a DB file
|
* @brief Write a sub block entry directly to a DB file
|
||||||
*/
|
*/
|
||||||
EXPORT const int writeSubBlockEntry(IDBDataFile* pFile,
|
EXPORT int writeSubBlockEntry(IDBDataFile* pFile,
|
||||||
DataBlock* block,
|
DataBlock* block,
|
||||||
const uint64_t lbid,
|
const uint64_t lbid,
|
||||||
const int sbid,
|
const int sbid,
|
||||||
@@ -204,7 +204,7 @@ public:
|
|||||||
const int width,
|
const int width,
|
||||||
void* pStruct );
|
void* pStruct );
|
||||||
|
|
||||||
EXPORT const int writeSubBlockEntry(CommBlock& cb,
|
EXPORT int writeSubBlockEntry(CommBlock& cb,
|
||||||
DataBlock* block,
|
DataBlock* block,
|
||||||
const uint64_t lbid,
|
const uint64_t lbid,
|
||||||
const int sbid,
|
const int sbid,
|
||||||
@@ -215,7 +215,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Write to version buffer
|
* @brief Write to version buffer
|
||||||
*/
|
*/
|
||||||
EXPORT const int writeVB( IDBDataFile* pFile,
|
EXPORT int writeVB( IDBDataFile* pFile,
|
||||||
const OID oid,
|
const OID oid,
|
||||||
const uint64_t lbid );
|
const uint64_t lbid );
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ public:
|
|||||||
|
|
||||||
/** @brief get the CurrentDBRootIdx
|
/** @brief get the CurrentDBRootIdx
|
||||||
*/
|
*/
|
||||||
inline const int getCurrentDBRootIdx()
|
inline int getCurrentDBRootIdx()
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(fDBRootExtTrkMutex);
|
boost::mutex::scoped_lock lock(fDBRootExtTrkMutex);
|
||||||
return fCurrentDBRootIdx;
|
return fCurrentDBRootIdx;
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ int FileOp::createFile(FID fid,
|
|||||||
BRM::LBID_t startLbid;
|
BRM::LBID_t startLbid;
|
||||||
uint32_t startBlock;
|
uint32_t startBlock;
|
||||||
RETURN_ON_ERROR( BRMWrapper::getInstance()->allocateColExtentExactFile(
|
RETURN_ON_ERROR( BRMWrapper::getInstance()->allocateColExtentExactFile(
|
||||||
(const OID)fid, (uint32_t)width, dbRootx, partitionx, segment, colDataType,
|
(OID)fid, (uint32_t)width, dbRootx, partitionx, segment, colDataType,
|
||||||
startLbid, allocSize, startBlock) );
|
startLbid, allocSize, startBlock) );
|
||||||
|
|
||||||
// We allocate a full extent from BRM, but only write an abbreviated 256K
|
// We allocate a full extent from BRM, but only write an abbreviated 256K
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Is it required to debug
|
* @brief Is it required to debug
|
||||||
*/
|
*/
|
||||||
const bool isDebug( const DebugLevel level ) const
|
bool isDebug( const DebugLevel level ) const
|
||||||
{
|
{
|
||||||
return level <= m_debugLevel;
|
return level <= m_debugLevel;
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Get debug level
|
* @brief Get debug level
|
||||||
*/
|
*/
|
||||||
const DebugLevel getDebugLevel() const
|
DebugLevel getDebugLevel() const
|
||||||
{
|
{
|
||||||
return m_debugLevel;
|
return m_debugLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user