Skip to content

Commit 94d9c6e

Browse files
committed
Support read-only mode for retrieving metadata, to speed up search.
1 parent 50f697f commit 94d9c6e

File tree

168 files changed

+1467
-540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+1467
-540
lines changed

dqops/src/integration-test/java/com/dqops/postgresql/checks/comparison/PostgresqlTableComparisonIntegrationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void setUp() {
9494
userDomainIdentity = UserDomainIdentityObjectMother.createAdminIdentity();
9595

9696
userHomeContextFactory = UserHomeContextFactoryObjectMother.createWithEmptyTemporaryContext();
97-
userHomeContext = userHomeContextFactory.openLocalUserHome(userDomainIdentity);
97+
userHomeContext = userHomeContextFactory.openLocalUserHome(userDomainIdentity, false);
9898
UserHomeContextObjectMother.addSampleTable(userHomeContext, comparedSampleTable);
9999
UserHomeContextObjectMother.addSampleTable(userHomeContext, referenceSampleTable);
100100
userHome = userHomeContext.getUserHome();

dqops/src/main/java/com/dqops/cli/commands/cloud/impl/CloudLoginServiceImpl.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public boolean logInToDqoCloud() {
163163
*/
164164
public void saveApiKeyInUserSettings(String apiKey) {
165165
DqoUserPrincipal userPrincipal = this.userPrincipalProvider.getLocalUserPrincipal();
166-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
166+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
167167
UserHome userHome = userHomeContext.getUserHome();
168168
LocalSettingsSpec localSettingsSpec = userHome.getSettings().getSpec();
169169
if (localSettingsSpec == null) {
@@ -202,7 +202,7 @@ public void disableCloudSync() {
202202
*/
203203
public void saveDisableCloudSync(boolean disableCloudSync) {
204204
DqoUserPrincipal userPrincipal = this.userPrincipalProvider.getLocalUserPrincipal();
205-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
205+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
206206
UserHome userHome = userHomeContext.getUserHome();
207207
LocalSettingsSpec localSettingsSpec = userHome.getSettings().getSpec();
208208
if (localSettingsSpec == null) {

dqops/src/main/java/com/dqops/cli/commands/column/impl/ColumnCliServiceImpl.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public CliOperationStatus loadColumns(String connectionName,
9999
HierarchyNodeTreeSearcherImpl hierarchyNodeTreeSearcher = new HierarchyNodeTreeSearcherImpl(hierarchyNodeTreeWalker);
100100

101101
DqoUserPrincipal userPrincipal = this.userPrincipalProvider.getLocalUserPrincipal();
102-
UserHomeContext userHomeContext = userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
102+
UserHomeContext userHomeContext = userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), true);
103103
UserHome userHome = userHomeContext.getUserHome();
104104
Collection <ColumnSpec> columnSpecs = hierarchyNodeTreeSearcher.findColumns(
105105
userHome, columnSearchFilters);
@@ -162,7 +162,7 @@ public CliOperationStatus addColumn(String connectionName, String tableName, Str
162162
CliOperationStatus cliOperationStatus = new CliOperationStatus();
163163

164164
DqoUserPrincipal userPrincipal = this.userPrincipalProvider.getLocalUserPrincipal();
165-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
165+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
166166
UserHome userHome = userHomeContext.getUserHome();
167167

168168
ConnectionWrapper connection = userHome.getConnections().getByObjectName(connectionName, true);
@@ -202,7 +202,7 @@ public CliOperationStatus removeColumn(String connectionName, String tableName,
202202
CliOperationStatus cliOperationStatus = new CliOperationStatus();
203203

204204
DqoUserPrincipal userPrincipal = this.userPrincipalProvider.getLocalUserPrincipal();
205-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
205+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
206206
UserHome userHome = userHomeContext.getUserHome();
207207

208208
ColumnSearchFilters columnSearchFilters = new ColumnSearchFilters();
@@ -300,7 +300,7 @@ public CliOperationStatus updateColumn(String connectionName, String tableName,
300300
CliOperationStatus cliOperationStatus = new CliOperationStatus();
301301

302302
DqoUserPrincipal userPrincipal = this.userPrincipalProvider.getLocalUserPrincipal();
303-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
303+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
304304
UserHome userHome = userHomeContext.getUserHome();
305305

306306
ColumnSearchFilters columnSearchFilters = new ColumnSearchFilters();
@@ -348,7 +348,7 @@ public CliOperationStatus renameColumn(String connectionName, String tableName,
348348
CliOperationStatus cliOperationStatus = new CliOperationStatus();
349349

350350
DqoUserPrincipal userPrincipal = this.userPrincipalProvider.getLocalUserPrincipal();
351-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
351+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
352352
UserHome userHome = userHomeContext.getUserHome();
353353

354354
ColumnSearchFilters columnSearchFilters = new ColumnSearchFilters();
@@ -397,7 +397,7 @@ public CliOperationStatus setDisableTo(String connectionName, String tableName,
397397
CliOperationStatus cliOperationStatus = new CliOperationStatus();
398398

399399
DqoUserPrincipal userPrincipal = this.userPrincipalProvider.getLocalUserPrincipal();
400-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
400+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
401401
UserHome userHome = userHomeContext.getUserHome();
402402

403403
ColumnSearchFilters columnSearchFilters = new ColumnSearchFilters();

dqops/src/main/java/com/dqops/cli/commands/connection/impl/ConnectionCliServiceImpl.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public CliOperationStatus showTableForConnection(String connectionName, String f
110110

111111
DqoUserPrincipal userPrincipal = this.dqoUserPrincipalProvider.getLocalUserPrincipal();
112112
UserDomainIdentity userIdentity = userPrincipal.getDataDomainIdentity();
113-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity);
113+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity, true);
114114
UserHome userHome = userHomeContext.getUserHome();
115115

116116
ConnectionList connections = userHome.getConnections();
@@ -200,7 +200,7 @@ public CliOperationStatus loadTableList(String connectionName, String schemaName
200200

201201
DqoUserPrincipal userPrincipal = this.dqoUserPrincipalProvider.getLocalUserPrincipal();
202202
UserDomainIdentity userIdentity = userPrincipal.getDataDomainIdentity();
203-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity);
203+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity, true);
204204
UserHome userHome = userHomeContext.getUserHome();
205205

206206
ConnectionList connections = userHome.getConnections();
@@ -287,7 +287,7 @@ public CliOperationStatus loadSchemaList(String connectionName, TabularOutputFor
287287

288288
DqoUserPrincipal userPrincipal = this.dqoUserPrincipalProvider.getLocalUserPrincipal();
289289
UserDomainIdentity userIdentity = userPrincipal.getDataDomainIdentity();
290-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity);
290+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity, true);
291291
UserHome userHome = userHomeContext.getUserHome();
292292
ConnectionList connections = userHome.getConnections();
293293

@@ -365,7 +365,7 @@ public CliOperationStatus loadSchemaList(String connectionName, TabularOutputFor
365365
public FormattedTableDto<ConnectionListModel> loadConnectionTable(String connectionNameFilter, String[] dimensions, String[] labels) {
366366
DqoUserPrincipal userPrincipal = this.dqoUserPrincipalProvider.getLocalUserPrincipal();
367367
UserDomainIdentity userIdentity = userPrincipal.getDataDomainIdentity();
368-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity);
368+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity, true);
369369
UserHome userHome = userHomeContext.getUserHome();
370370

371371
ConnectionSearchFilters connectionSearchFilters = new ConnectionSearchFilters();
@@ -413,7 +413,7 @@ public CliOperationStatus addConnection(String connectionName, ConnectionSpec co
413413

414414
DqoUserPrincipal userPrincipal = this.dqoUserPrincipalProvider.getLocalUserPrincipal();
415415
UserDomainIdentity userIdentity = userPrincipal.getDataDomainIdentity();
416-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity);
416+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity, false);
417417
UserHome userHome = userHomeContext.getUserHome();
418418
ConnectionList connections = userHome.getConnections();
419419

@@ -445,7 +445,7 @@ public CliOperationStatus removeConnection(String connectionName) {
445445

446446
DqoUserPrincipal userPrincipal = this.dqoUserPrincipalProvider.getLocalUserPrincipal();
447447
UserDomainIdentity userIdentity = userPrincipal.getDataDomainIdentity();
448-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity);
448+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity, false);
449449
UserHome userHome = userHomeContext.getUserHome();
450450

451451
ConnectionSearchFilters connectionSearchFilters = new ConnectionSearchFilters();
@@ -508,7 +508,7 @@ public CliOperationStatus updateConnection(String connectionName, ConnectionSpec
508508

509509
DqoUserPrincipal userPrincipal = this.dqoUserPrincipalProvider.getLocalUserPrincipal();
510510
UserDomainIdentity userIdentity = userPrincipal.getDataDomainIdentity();
511-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity);
511+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity, false);
512512
UserHome userHome = userHomeContext.getUserHome();
513513

514514
ConnectionSearchFilters connectionSearchFilters = new ConnectionSearchFilters();
@@ -543,7 +543,7 @@ public CliOperationStatus updateConnection(String connectionName, ConnectionSpec
543543
public ConnectionWrapper getConnection(String connectionName) {
544544
DqoUserPrincipal userPrincipal = this.dqoUserPrincipalProvider.getLocalUserPrincipal();
545545
UserDomainIdentity userIdentity = userPrincipal.getDataDomainIdentity();
546-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity);
546+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity, false);
547547
UserHome userHome = userHomeContext.getUserHome();
548548
ConnectionList connections = userHome.getConnections();
549549

@@ -579,7 +579,7 @@ public void promptForConnectionParameters(ConnectionSpec connectionSpec, boolean
579579
public int launchEditorForConnection(String connectionName) {
580580
DqoUserPrincipal userPrincipal = this.dqoUserPrincipalProvider.getLocalUserPrincipal();
581581
UserDomainIdentity userIdentity = userPrincipal.getDataDomainIdentity();
582-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity);
582+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userIdentity, true);
583583
UserHome userHome = userHomeContext.getUserHome();
584584
ConnectionWrapper connectionWrapper = userHome.getConnections().getByObjectName(connectionName, true);
585585
if (connectionWrapper == null) {

dqops/src/main/java/com/dqops/cli/commands/rule/impl/RuleCliServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public CliOperationStatus editTemplate(String ruleName, RuleFileExtension ext) {
6060
CliOperationStatus cliOperationStatus = new CliOperationStatus();
6161

6262
DqoUserPrincipal userPrincipal = this.userPrincipalProvider.getLocalUserPrincipal();
63-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
63+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
6464
UserHome userHome = userHomeContext.getUserHome();
6565

6666
DqoHomeContext dqoHomeContext = this.dqoHomeContextFactory.openLocalDqoHome();

dqops/src/main/java/com/dqops/cli/commands/sensor/impl/SensorServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public CliOperationStatus editTemplate(String sensorName, ProviderType provider,
5858
CliOperationStatus cliOperationStatus = new CliOperationStatus();
5959

6060
DqoUserPrincipal userPrincipalForAdministrator = this.dqoUserPrincipalProvider.getLocalUserPrincipal();
61-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipalForAdministrator.getDataDomainIdentity());
61+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipalForAdministrator.getDataDomainIdentity(), false);
6262
UserHome userHome = userHomeContext.getUserHome();
6363

6464
DqoHomeContext dqoHomeContext = this.dqoHomeContextFactory.openLocalDqoHome();

dqops/src/main/java/com/dqops/cli/commands/settings/impl/SettingsCliServiceImpl.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public CliOperationStatus setSettingsEditor(String editorName, String editorPath
8181
CliOperationStatus cliOperationStatus = new CliOperationStatus();
8282

8383
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
84-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
84+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
8585
UserHome userHome = userHomeContext.getUserHome();
8686
LocalSettingsSpec settings;
8787
if (userHome.getSettings() == null || userHome.getSettings().getSpec() == null) {
@@ -110,7 +110,7 @@ public CliOperationStatus removeSettingsEditor() {
110110
CliOperationStatus cliOperationStatus = new CliOperationStatus();
111111

112112
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
113-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
113+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
114114
UserHome userHome = userHomeContext.getUserHome();
115115
LocalSettingsSpec settings;
116116
if (userHome.getSettings() == null || userHome.getSettings().getSpec() == null) {
@@ -142,7 +142,7 @@ public CliOperationStatus showSettingsEditor() {
142142
CliOperationStatus cliOperationStatus = new CliOperationStatus();
143143

144144
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
145-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
145+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), true);
146146
UserHome userHome = userHomeContext.getUserHome();
147147
LocalSettingsSpec settings;
148148
if (userHome.getSettings() == null || userHome.getSettings().getSpec() == null) {
@@ -173,7 +173,7 @@ public CliOperationStatus showSettingsEditor() {
173173
public CliOperationStatus initSettings(String editorName, String editorPath) {
174174
CliOperationStatus cliOperationStatus = new CliOperationStatus();
175175
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
176-
UserHomeContext userHomeContext = userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
176+
UserHomeContext userHomeContext = userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
177177

178178
LocalSettingsSpec localSettingsSpec = new LocalSettingsSpec();
179179
localSettingsSpec.setEditorName(editorName);
@@ -199,7 +199,7 @@ public CliOperationStatus initSettings(String editorName, String editorPath) {
199199
public CliOperationStatus removeSettings() {
200200
CliOperationStatus cliOperationStatus = new CliOperationStatus();
201201
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
202-
UserHomeContext userHomeContext = userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
202+
UserHomeContext userHomeContext = userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
203203

204204
SettingsWrapper settings = userHomeContext.getUserHome().getSettings();
205205
if (settings == null || settings.getSpec() == null) {
@@ -223,7 +223,7 @@ public CliOperationStatus setApiKey(String key) {
223223
CliOperationStatus cliOperationStatus = new CliOperationStatus();
224224

225225
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
226-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
226+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
227227
UserHome userHome = userHomeContext.getUserHome();
228228
LocalSettingsSpec settings;
229229
if (userHome.getSettings() == null || userHome.getSettings().getSpec() == null) {
@@ -251,7 +251,7 @@ public CliOperationStatus removeApiKey() {
251251
CliOperationStatus cliOperationStatus = new CliOperationStatus();
252252

253253
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
254-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
254+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
255255
UserHome userHome = userHomeContext.getUserHome();
256256
LocalSettingsSpec settings;
257257
if (userHome.getSettings() == null || userHome.getSettings().getSpec() == null) {
@@ -285,7 +285,7 @@ public CliOperationStatus showApiKey() {
285285
CliOperationStatus cliOperationStatus = new CliOperationStatus();
286286

287287
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
288-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
288+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), true);
289289
UserHome userHome = userHomeContext.getUserHome();
290290
LocalSettingsSpec settings;
291291
if (userHome.getSettings() == null || userHome.getSettings().getSpec() == null) {
@@ -364,7 +364,7 @@ public CliOperationStatus setTimeZone(String timeZone) {
364364
}
365365

366366
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
367-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
367+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
368368
UserHome userHome = userHomeContext.getUserHome();
369369
LocalSettingsSpec settings;
370370
if (userHome.getSettings() == null || userHome.getSettings().getSpec() == null) {
@@ -392,7 +392,7 @@ public CliOperationStatus removeTimeZone() {
392392
CliOperationStatus cliOperationStatus = new CliOperationStatus();
393393

394394
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
395-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
395+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), false);
396396
UserHome userHome = userHomeContext.getUserHome();
397397
LocalSettingsSpec settings;
398398
if (userHome.getSettings() == null || userHome.getSettings().getSpec() == null) {
@@ -426,7 +426,7 @@ public CliOperationStatus showTimeZone() {
426426
CliOperationStatus cliOperationStatus = new CliOperationStatus();
427427

428428
DqoUserPrincipal userPrincipal = this.principalProvider.getLocalUserPrincipal();
429-
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity());
429+
UserHomeContext userHomeContext = this.userHomeContextFactory.openLocalUserHome(userPrincipal.getDataDomainIdentity(), true);
430430
UserHome userHome = userHomeContext.getUserHome();
431431
LocalSettingsSpec settings;
432432
if (userHome.getSettings() == null || userHome.getSettings().getSpec() == null) {

0 commit comments

Comments
 (0)