From 5fc0f040ee1d6cbd0c9acdd76ff9fcd2acc6034b Mon Sep 17 00:00:00 2001 From: Denis Sinelnikov Date: Thu, 4 Jan 2024 16:40:06 +0400 Subject: [PATCH 1/4] CB-4377. Error text is more detailed to export large sql result --- .../src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java | 2 ++ .../service/data/transfer/impl/WebServiceDataTransfer.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java index 8284290fed..0651ca0fbe 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java @@ -86,6 +86,8 @@ public String createLobFile(DBCSession session) throws DBCException, IOException } if (binaryValue.length > fileSizeLimit.longValue()) { throw new DBQuotaException( + "Please increase the resourceQuotas parameters " + + "if you need in the runtime conf file located at /workspace/.data. \n" + "Data export quota exceeded", CBConstants.QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), binaryValue.length); } Path file = DATA_EXPORT_FOLDER.resolve(exportFileName); diff --git a/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java b/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java index 01131528b3..d2f2f0792d 100644 --- a/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java +++ b/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java @@ -215,6 +215,8 @@ public void fetchRow(DBCSession session, DBCResultSet resultSet) throws DBCExcep super.fetchRow(session, resultSet); if (fileSizeLimit != null && getBytesWritten() > fileSizeLimit.longValue()) { throw new DBQuotaException( + "Please increase the resourceQuotas parameters " + + "if you need in the runtime conf file located at /workspace/.data. \n" + "Data export quota exceeded", QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), getBytesWritten()); } } From 12d12115107e879f0406de1984e26de17d65cfee Mon Sep 17 00:00:00 2001 From: Denis Sinelnikov Date: Thu, 4 Jan 2024 16:50:45 +0400 Subject: [PATCH 2/4] CB-4377. Error text is more detailed to export large sql result --- .../io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java | 6 +++--- .../service/data/transfer/impl/WebServiceDataTransfer.java | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java index 0651ca0fbe..d75db06c6f 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java @@ -86,9 +86,9 @@ public String createLobFile(DBCSession session) throws DBCException, IOException } if (binaryValue.length > fileSizeLimit.longValue()) { throw new DBQuotaException( - "Please increase the resourceQuotas parameters " + - "if you need in the runtime conf file located at /workspace/.data. \n" + - "Data export quota exceeded", CBConstants.QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), binaryValue.length); + "Data export quota exceeded", CBConstants.QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), binaryValue.length + + "\n Please increase the resourceQuotas parameters in configuration" + ); } Path file = DATA_EXPORT_FOLDER.resolve(exportFileName); Files.write(file, binaryValue); diff --git a/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java b/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java index d2f2f0792d..037e26075c 100644 --- a/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java +++ b/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java @@ -215,9 +215,8 @@ public void fetchRow(DBCSession session, DBCResultSet resultSet) throws DBCExcep super.fetchRow(session, resultSet); if (fileSizeLimit != null && getBytesWritten() > fileSizeLimit.longValue()) { throw new DBQuotaException( - "Please increase the resourceQuotas parameters " + - "if you need in the runtime conf file located at /workspace/.data. \n" + - "Data export quota exceeded", QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), getBytesWritten()); + "Data export quota exceeded", QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), getBytesWritten() + + "\n Please increase the resourceQuotas parameters in configuration"); } } }; From 9a441dcfa994e7f35554c657b0f89da177878617 Mon Sep 17 00:00:00 2001 From: Denis Sinelnikov Date: Tue, 9 Jan 2024 17:30:03 +0400 Subject: [PATCH 3/4] CB-4377. Fixed typo in error message --- .../src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java index d75db06c6f..dd55b627bd 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java @@ -87,7 +87,7 @@ public String createLobFile(DBCSession session) throws DBCException, IOException if (binaryValue.length > fileSizeLimit.longValue()) { throw new DBQuotaException( "Data export quota exceeded", CBConstants.QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), binaryValue.length + - "\n Please increase the resourceQuotas parameters in configuration" + "\n Please increase the resourceQuotas parameter in configuration" ); } Path file = DATA_EXPORT_FOLDER.resolve(exportFileName); From c1fbb4c3757b826a61086bb07f7219580cd2297d Mon Sep 17 00:00:00 2001 From: Denis Sinelnikov Date: Wed, 10 Jan 2024 10:02:17 +0400 Subject: [PATCH 4/4] CB-4377. Fixed typo in error message --- .../io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java | 4 ++-- .../service/data/transfer/impl/WebServiceDataTransfer.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java index dd55b627bd..3beb1f8b90 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLDataLOBReceiver.java @@ -86,8 +86,8 @@ public String createLobFile(DBCSession session) throws DBCException, IOException } if (binaryValue.length > fileSizeLimit.longValue()) { throw new DBQuotaException( - "Data export quota exceeded", CBConstants.QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), binaryValue.length + - "\n Please increase the resourceQuotas parameter in configuration" + "Data export quota exceeded \n Please increase the resourceQuotas parameter in configuration", + CBConstants.QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), binaryValue.length ); } Path file = DATA_EXPORT_FOLDER.resolve(exportFileName); diff --git a/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java b/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java index 037e26075c..1fc66c5b4e 100644 --- a/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java +++ b/server/bundles/io.cloudbeaver.service.data.transfer/src/io/cloudbeaver/service/data/transfer/impl/WebServiceDataTransfer.java @@ -215,8 +215,9 @@ public void fetchRow(DBCSession session, DBCResultSet resultSet) throws DBCExcep super.fetchRow(session, resultSet); if (fileSizeLimit != null && getBytesWritten() > fileSizeLimit.longValue()) { throw new DBQuotaException( - "Data export quota exceeded", QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), getBytesWritten() + - "\n Please increase the resourceQuotas parameters in configuration"); + "Data export quota exceeded \n Please increase the resourceQuotas parameter in configuration", + QUOTA_PROP_FILE_LIMIT, fileSizeLimit.longValue(), getBytesWritten() + ); } } };