Skip to content

Commit

Permalink
Merge branch 'devel' into CB-4836-jetty-cache-not-cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
dariamarutkina authored Mar 29, 2024
2 parents 4dfc7b2 + 8004db0 commit e5de49f
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<resource name="drivers/sqlite/xerial"/>
<resource name="drivers/mssql/new"/>
<resource name="drivers/trino"/>
<resource name="drivers/kyuubi"/>
</extension>

<!-- Bundles -->
Expand All @@ -36,6 +37,7 @@
<bundle id="drivers.sqlite.xerial" label="SQLite drivers"/>
<bundle id="drivers.mssql.new" label="SQL Server drivers"/>
<bundle id="drivers.trino" label="Trino drivers"/>
<bundle id="drivers.kyuubi" label="Apache Kyuubi drivers"/>
</extension>

<!-- Enabled drivers -->
Expand All @@ -55,6 +57,7 @@
<driver id="sqlserver:microsoft"/>
<driver id="generic:trino_jdbc"/>
<driver id="generic:duckdb_jdbc"/>
<driver id="generic:kyuubi_hive"/>
</extension>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public WebPropertyInfo[] getDriverProperties() throws DBWebException {
cfg.setUrl(driver.getSampleURL());
cfg.setHostName(DBConstants.HOST_LOCALHOST);
cfg.setHostPort(driver.getDefaultPort());
cfg.setDatabaseName(driver.getDefaultDatabase());
cfg.setUrl(driver.getConnectionURL(cfg));
DBPPropertyDescriptor[] properties = driver.getDataSourceProvider().getConnectionProperties(webSession.getProgressMonitor(), driver, cfg);
if (properties == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,16 @@ public WebSQLExecuteInfo updateResultsDataBatch(
isAutoCommitEnabled = txnManager.isAutoCommit();
if (txnManager.isSupportsTransactions() && isAutoCommitEnabled) {
txnManager.setAutoCommit(monitor, false);
savepoint = txnManager.setSavepoint(monitor, null);
revertToAutoCommit = true;
}
if (!txnManager.isAutoCommit() && txnManager.supportsSavepoints()) {
try {
savepoint = txnManager.setSavepoint(monitor, null);
} catch (Throwable e) {
// May be savepoints not supported
log.debug("Can't set savepoint", e);
}
}
}
try {
Map<String, Object> options = Collections.emptyMap();
Expand Down
25 changes: 25 additions & 0 deletions server/drivers/kyuubi/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>drivers.kyuubi</artifactId>
<version>1.0.0</version>
<parent>
<groupId>io.cloudbeaver</groupId>
<artifactId>drivers</artifactId>
<version>1.0.0</version>
<relativePath>../</relativePath>
</parent>

<properties>
<deps.output.dir>kyuubi</deps.output.dir>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.kyuubi</groupId>
<artifactId>kyuubi-hive-jdbc-shaded</artifactId>
<version>1.9.0</version>
</dependency>
</dependencies>

</project>
1 change: 1 addition & 0 deletions server/drivers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<module>h2</module>
<module>h2_v2</module>
<module>jaybird</module>
<module>kyuubi</module>
<module>mysql</module>
<module>mariadb</module>
<module>oracle</module>
Expand Down
2 changes: 1 addition & 1 deletion server/drivers/trino/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-jdbc</artifactId>
<version>422</version>
<version>438</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/

.wrapper {
overflow: hidden;
height: 100%;
width: 100%;
}

.table {
flex: 1 1 auto;
width: 100%;
}

.tableWrapper {
height: 100%;
}

.messageTitleBox {
display: flex;
align-items: center;

.messageTitle {
flex: 1;
}
}

.tableColumnHeader {
white-space: nowrap;
text-overflow: ellipsis;
}

.tableColumnHeaderMin {
width: 32px;
}

.timestamp {
width: 116px;
min-width: 116px;
}

.clearButton {
position: absolute !important;
top: 4px;
right: 16px;
z-index: 100;
}
82 changes: 26 additions & 56 deletions webapp/packages/plugin-log-viewer/src/LogViewer/LogViewerTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,12 @@
* you may not use this file except in compliance with the License.
*/
import { observer } from 'mobx-react-lite';
import styled, { css, use } from 'reshadow';

import { MenuBarSmallItem, Table, TableBody, TableColumnHeader, TableHeader, useStyles, useTranslate } from '@cloudbeaver/core-blocks';
import { Container, MenuBarSmallItem, s, Table, TableBody, TableColumnHeader, TableHeader, useS, useTranslate } from '@cloudbeaver/core-blocks';

import type { ILogEntry } from './ILogEntry';
import { LogEntry } from './LogEntry';

const styles = css`
wrapper {
overflow: hidden;
display: flex;
flex-direction: column;
height: 100%;
}
Table {
flex: 1 1 auto;
width: 100%;
}
table-wrapper {
overflow: auto;
}
message-title-box {
display: flex;
align-items: center;
& message-title {
flex: 1;
}
}
[|buttons] {
text-align: right;
}
TableColumnHeader {
white-space: nowrap;
text-overflow: ellipsis;
}
TableColumnHeader[min] {
width: 32px;
}
[|timestamp] {
width: 116px;
min-width: 116px;
}
`;
import styles from './LogViewerTable.m.css';

interface Props {
items: ILogEntry[];
Expand All @@ -60,22 +22,30 @@ interface Props {
}
export const LogViewerTable = observer<Props>(function LogViewerTable({ items, selectedItem, onItemSelect, onClear, className }) {
const translate = useTranslate();
const style = useStyles(styles);
const style = useS(styles);

return styled(style)(
<wrapper className={className}>
<table-wrapper>
<Table {...use({ expanded: !!selectedItem })}>
return (
<Container className={s(style, { wrapper: true }, className)}>
<MenuBarSmallItem
className={s(style, { clearButton: true })}
icon="trash"
viewBox="0 0 24 24"
title={translate('plugin_log_viewer_clear_log')}
onClick={onClear}
>
{translate('ui_clear')}
</MenuBarSmallItem>
<Container className={s(style, { tableWrapper: true })} overflow>
<Table className={s(style, { table: true })}>
<TableHeader fixed>
<TableColumnHeader min />
<TableColumnHeader {...use({ timestamp: true })}>{translate('plugin_log_viewer_entry_timestamp')}</TableColumnHeader>
<TableColumnHeader>
<message-title-box>
<message-title>{translate('plugin_log_viewer_entry_message')}</message-title>
<MenuBarSmallItem icon="trash" viewBox="0 0 24 24" title={translate('plugin_log_viewer_clear_log')} onClick={onClear}>
{translate('ui_clear')}
</MenuBarSmallItem>
</message-title-box>
<TableColumnHeader className={s(style, { tableColumnHeader: true, tableColumnHeaderMin: true })} min />
<TableColumnHeader className={s(style, { tableColumnHeader: true, timestamp: true })}>
{translate('plugin_log_viewer_entry_timestamp')}
</TableColumnHeader>
<TableColumnHeader className={s(style, { tableColumnHeader: true })}>
<div className={s(style, { messageTitleBox: true })}>
<div className={s(style, { messageTitle: true })}>{translate('plugin_log_viewer_entry_message')}</div>
</div>
</TableColumnHeader>
</TableHeader>
<TableBody>
Expand All @@ -84,7 +54,7 @@ export const LogViewerTable = observer<Props>(function LogViewerTable({ items, s
))}
</TableBody>
</Table>
</table-wrapper>
</wrapper>,
</Container>
</Container>
);
});

0 comments on commit e5de49f

Please sign in to comment.