Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
852dc71f
Commit
852dc71f
authored
2 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
Revert "MAINT: remove debugging"
This reverts commit
8c64dae4
.
parent
8c64dae4
No related branches found
No related tags found
No related merge requests found
Pipeline
#25062
failed
2 years ago
Stage: info
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/caosdb/server/query/Query.java
+19
-1
19 additions, 1 deletion
src/main/java/org/caosdb/server/query/Query.java
with
19 additions
and
1 deletion
src/main/java/org/caosdb/server/query/Query.java
+
19
−
1
View file @
852dc71f
...
...
@@ -800,17 +800,24 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
}
cachable
=
false
;
try
(
final
Statement
stmt
=
this
.
getConnection
().
createStatement
())
{
// final ResultSet rs = stmt.executeQuery("SELECT id from `" + resultSet + "`");
String
logstr
=
""
;
final
String
query
=
(
"SELECT t1.id, entity_acl.acl from (select entities.id, entities.acl from entities where id in (select id from `"
+
resultSet
+
"`) ) as t1 inner join entity_acl on t1.acl=entity_acl.id;"
);
logstr
+=
"SQL query: "
+
query
+
"\n"
;
long
begin_t
=
System
.
currentTimeMillis
();
final
ResultSet
rs
=
stmt
.
executeQuery
(
query
);
final
HashMap
<
String
,
Boolean
>
acl_cache
=
new
HashMap
<
String
,
Boolean
>();
final
List
<
Integer
>
toBeDeleted
=
new
LinkedList
<
Integer
>();
final
List
<
Integer
>
allrs
=
new
ArrayList
<
Integer
>();
logstr
+=
"Got rs: "
+
(
System
.
currentTimeMillis
()
-
begin_t
)
+
" s\n"
;
long
count
=
0
;
long
count2
=
0
;
// @todo here, we must operate on sql site. only retrieve different permissions
while
(
rs
.
next
())
{
final
long
t1
=
System
.
currentTimeMillis
();
...
...
@@ -818,10 +825,12 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
if
(
id
<=
99
)
{
continue
;
}
count2
+=
1
;
allrs
.
add
(
id
);
final
String
acl_str
=
bytes2UTF8
(
rs
.
getBytes
(
"ACL"
));
if
(!
acl_cache
.
containsKey
(
acl_str
))
{
count
+=
1
;
acl_cache
.
put
(
acl_str
,
EntityACL
.
deserialize
(
acl_str
)
...
...
@@ -835,8 +844,17 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
final
long
t2
=
System
.
currentTimeMillis
();
this
.
addBenchmark
(
"filterEntitiesWithoutRetrievePermission"
,
t2
-
t1
);
}
logstr
+=
"done with looking up acl: "
+
(
System
.
currentTimeMillis
()
-
begin_t
)
+
" s\n"
;
allrs
.
sort
(
Comparator
.
naturalOrder
());
logstr
+=
"iterations: "
+
count
+
"\n"
;
logstr
+=
"iterations: "
+
count2
+
"\n"
;
logstr
+=
"Full time: "
+
(
System
.
currentTimeMillis
()
-
begin_t
)
+
"\n"
;
this
.
logger
.
warn
(
logstr
);
rs
.
close
();
// TODO is there a better way than the following?
for
(
final
Integer
id
:
toBeDeleted
)
{
stmt
.
execute
(
"DELETE FROM `"
+
resultSet
+
"` WHERE id = "
+
id
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment