Browse Source

Merge pull request #3994 in DEC/decision-webui-dcm from final/11.0 to persist/11.0

* commit '9093ac8099394d7db4ae474267df1a150d6c2d59':
  DEC-21782 feat: 适配dremio数据源
  DEC-21809 fix: 【迭代】【连接池配置优化】最大空闲连接数未删除
  DEC-21782 feat: 适配dremio数据源
  DEC-21498 fix: 【FR配合】连接池配置优化
persist/11.0
superman 3 years ago
parent
commit
831591105e
  1. 11
      src/modules/constants/constant.ts
  2. 49
      src/modules/pages/connection/connection_jdbc/connection_jdbc.ts
  3. 161
      src/modules/pages/maintain/forms/components/form.jdbc.ts

11
src/modules/constants/constant.ts

@ -583,6 +583,17 @@ export const DATA_BASE_TYPES = [
type: 'jdbc', type: 'jdbc',
hasSchema: true, hasSchema: true,
kerberos: true, kerberos: true,
}, {
text: 'dremio',
databaseType: 'dremio',
driver: 'com.dremio.jdbc.Driver',
drivers: ['com.dremio.jdbc.Driver'],
url: 'jdbc:dremio:direct=hostname:31010',
commonly: false,
internal: true,
type: 'jdbc',
hasSchema: true,
kerberos: false,
}, { }, {
text: 'Presto', text: 'Presto',
databaseType: 'presto', databaseType: 'presto',

49
src/modules/pages/connection/connection_jdbc/connection_jdbc.ts

@ -97,10 +97,31 @@ export class ConnectionJdbc extends BI.Widget {
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'),
value: url, value: url,
}, },
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'),
value: connectionPoolAttr.maxActive,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'),
value: connectionPoolAttr.testOnBorrow ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
value: api.getPlain(connectionPoolAttr.validationQuery || ''),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'),
value: connectionPoolAttr.maxWait,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
{ {
type: Collapse.xtype, type: Collapse.xtype,
width: 70, width: 70,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Advanced_Setting'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_More_Setting'),
listeners: [ listeners: [
{ {
eventName: EVENT_CHANGE, eventName: EVENT_CHANGE,
@ -124,37 +145,11 @@ export class ConnectionJdbc extends BI.Widget {
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
value: connectionPoolAttr.initialSize, value: connectionPoolAttr.initialSize,
}, },
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'),
value: connectionPoolAttr.maxActive,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'),
value: connectionPoolAttr.maxIdle,
},
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'),
value: connectionPoolAttr.minIdle, value: connectionPoolAttr.minIdle,
}, },
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'),
value: connectionPoolAttr.maxWait,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Validation_Query'),
value: api.getPlain(connectionPoolAttr.validationQuery || ''),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'),
value: connectionPoolAttr.testOnBorrow ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'),

161
src/modules/pages/maintain/forms/components/form.jdbc.ts

@ -54,7 +54,6 @@ export class FormJdbc extends BI.Widget {
url: null, url: null,
initialSize: null, initialSize: null,
maxActive: null, maxActive: null,
maxIdle: null,
maxWait: null, maxWait: null,
validationQuery: null, validationQuery: null,
testOnBorrow: null, testOnBorrow: null,
@ -87,7 +86,6 @@ export class FormJdbc extends BI.Widget {
const { const {
initialSize, initialSize,
maxActive, maxActive,
maxIdle,
maxWait, maxWait,
validationQuery, validationQuery,
testOnBorrow, testOnBorrow,
@ -437,50 +435,6 @@ export class FormJdbc extends BI.Widget {
}], }],
}], }],
}, },
{
type: Collapse.xtype,
bgap: -15,
width: 70,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Advanced_Setting'),
listeners: [
{
eventName: EVENT_CHANGE,
action: (isCollapse: boolean) => {
this.advancedSet.setVisible(!isCollapse);
},
},
],
},
{
type: BI.VerticalLayout.xtype,
vgap,
tgap: -15,
invisible: true,
ref: (_ref: VerticalLayout) => {
this.advancedSet = _ref;
},
items: [
{
type: FormItem.xtype,
tgap: 15,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
forms: [{
type: TextChecker.xtype,
$value: 'initial-size',
width: 300,
allowBlank: false,
value: initialSize,
validationChecker: [{
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'),
checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
ref: (_ref: TextChecker) => {
this.form.initialSize = _ref;
},
}],
},
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'),
@ -503,41 +457,34 @@ export class FormJdbc extends BI.Widget {
}, },
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'),
forms: [{ forms: [{
type: TextChecker.xtype, type: BI.TextValueCombo.xtype,
$value: 'max-idle', $value: 'check',
width: 300, width: 300,
allowBlank: false, allowBlank: true,
value: maxIdle, value: testOnBorrow,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'), items: this.getBooleanItem(),
validationChecker: [{ watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'),
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), ref: (_ref: TextValueCombo) => {
checker: (value: string) => this.checkInteger(value), this.form.testOnBorrow = _ref;
autoFix: true,
}, valueRangeConfig],
ref: (_ref: TextChecker) => {
this.form.maxIdle = _ref;
}, },
}], }],
}, },
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
forms: [{ forms: [{
type: TextChecker.xtype, type: BI.TextAreaEditor.xtype,
$value: 'min-idle', $value: 'validation-query',
cls: 'bi-border',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query_Watermark'),
value: api.getPlain(validationQuery || ''),
width: 300, width: 300,
allowBlank: false, height: 100,
value: minIdle, ref: (_ref: TextAreaEditor) => {
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), this.form.validationQuery = _ref;
validationChecker: [{
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'),
checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
ref: (_ref: TextChecker) => {
this.form.minIdle = _ref;
}, },
}], }],
}, },
@ -569,36 +516,67 @@ export class FormJdbc extends BI.Widget {
}, },
], ],
}, },
{
type: Collapse.xtype,
bgap: -15,
width: 70,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_More_Setting'),
listeners: [
{
eventName: EVENT_CHANGE,
action: (isCollapse: boolean) => {
this.advancedSet.setVisible(!isCollapse);
},
},
],
},
{
type: BI.VerticalLayout.xtype,
vgap,
tgap: -15,
invisible: true,
ref: (_ref: VerticalLayout) => {
this.advancedSet = _ref;
},
items: [
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'), tgap: 15,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
forms: [{ forms: [{
type: BI.TextAreaEditor.xtype, type: TextChecker.xtype,
$value: 'validation-query', $value: 'initial-size',
cls: 'bi-border',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
value: api.getPlain(validationQuery || ''),
width: 300, width: 300,
height: 100, allowBlank: false,
ref: (_ref: TextAreaEditor) => { value: initialSize,
this.form.validationQuery = _ref; validationChecker: [{
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'),
checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
ref: (_ref: TextChecker) => {
this.form.initialSize = _ref;
}, },
}], }],
}, },
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'),
forms: [{ forms: [{
type: BI.TextValueCombo.xtype, type: TextChecker.xtype,
$value: 'check', $value: 'min-idle',
width: 300, width: 300,
allowBlank: true, allowBlank: false,
value: testOnBorrow, value: minIdle,
items: this.getBooleanItem(), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'),
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'), validationChecker: [{
ref: (_ref: TextValueCombo) => { errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'),
this.form.testOnBorrow = _ref; checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
ref: (_ref: TextChecker) => {
this.form.minIdle = _ref;
}, },
}], }],
}, },
@ -862,7 +840,6 @@ export class FormJdbc extends BI.Widget {
connectionPoolAttr: { connectionPoolAttr: {
initialSize: this.form.initialSize.getValue(), initialSize: this.form.initialSize.getValue(),
maxActive: this.form.maxActive.getValue(), maxActive: this.form.maxActive.getValue(),
maxIdle: this.form.maxIdle.getValue(),
minIdle: this.form.minIdle.getValue(), minIdle: this.form.minIdle.getValue(),
maxWait: this.form.maxWait.getValue(), maxWait: this.form.maxWait.getValue(),
validationQuery: api.getCipher(this.form.validationQuery.getValue()), validationQuery: api.getCipher(this.form.validationQuery.getValue()),

Loading…
Cancel
Save