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
6f5d3c94
Verified
Commit
6f5d3c94
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: clean-up
parent
6581dc8a
No related branches found
No related tags found
3 merge requests
!44
Release 0.6
,
!43
Merge f-GRPC-main to dev
,
!35
F grpc f mixed write transactions
Pipeline
#14140
passed
3 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/grpc/EntityTransactionServiceImpl.java
+21
-12
21 additions, 12 deletions
.../org/caosdb/server/grpc/EntityTransactionServiceImpl.java
with
21 additions
and
12 deletions
src/main/java/org/caosdb/server/grpc/EntityTransactionServiceImpl.java
+
21
−
12
View file @
6f5d3c94
...
@@ -39,6 +39,7 @@ import org.caosdb.api.entity.v1alpha1.UpdateRequest;
...
@@ -39,6 +39,7 @@ import org.caosdb.api.entity.v1alpha1.UpdateRequest;
import
org.caosdb.api.entity.v1alpha1.UpdateResponse
;
import
org.caosdb.api.entity.v1alpha1.UpdateResponse
;
import
org.caosdb.api.entity.v1alpha1.Version
;
import
org.caosdb.api.entity.v1alpha1.Version
;
import
org.caosdb.datetime.DateTimeInterface
;
import
org.caosdb.datetime.DateTimeInterface
;
import
org.caosdb.server.CaosDBException
;
import
org.caosdb.server.datatype.AbstractCollectionDatatype
;
import
org.caosdb.server.datatype.AbstractCollectionDatatype
;
import
org.caosdb.server.datatype.AbstractDatatype
;
import
org.caosdb.server.datatype.AbstractDatatype
;
import
org.caosdb.server.datatype.BooleanDatatype
;
import
org.caosdb.server.datatype.BooleanDatatype
;
...
@@ -476,6 +477,12 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa
...
@@ -476,6 +477,12 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa
FileDownload
file_download
=
null
;
FileDownload
file_download
=
null
;
for
(
final
TransactionRequest
sub_request
:
request
.
getRequestsList
())
{
for
(
final
TransactionRequest
sub_request
:
request
.
getRequestsList
())
{
if
(
sub_request
.
getWrappedRequestsCase
()
!=
WrappedRequestsCase
.
RETRIEVE_REQUEST
)
{
throw
new
CaosDBException
(
"Cannot process a "
+
sub_request
.
getWrappedRequestsCase
().
name
()
+
" in a read-only request."
);
}
final
boolean
fileDownload
=
sub_request
.
getRetrieveRequest
().
getRegisterFileDownload
();
final
boolean
fileDownload
=
sub_request
.
getRetrieveRequest
().
getRegisterFileDownload
();
if
(
sub_request
.
getRetrieveRequest
().
hasQuery
()
if
(
sub_request
.
getRetrieveRequest
().
hasQuery
()
&&
!
sub_request
.
getRetrieveRequest
().
getQuery
().
getQuery
().
isBlank
())
{
&&
!
sub_request
.
getRetrieveRequest
().
getQuery
().
getQuery
().
isBlank
())
{
...
@@ -564,18 +571,17 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa
...
@@ -564,18 +571,17 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa
public
MultiTransactionResponse
transaction
(
final
MultiTransactionRequest
request
)
public
MultiTransactionResponse
transaction
(
final
MultiTransactionRequest
request
)
throws
Exception
{
throws
Exception
{
// we currently can only process one request type per multi transaction request.
WrappedRequestsCase
requestCase
=
WrappedRequestsCase
.
WRAPPEDREQUESTS_NOT_SET
;
if
(
request
.
getRequestsCount
()
>
0
)
{
if
(
request
.
getRequestsCount
()
>
0
)
{
requestCase
=
request
.
getRequests
(
0
).
getWrappedRequestsCase
();
final
WrappedRequestsCase
requestCase
=
request
.
getRequests
(
0
).
getWrappedRequestsCase
();
}
switch
(
requestCase
)
{
case
RETRIEVE_REQUEST:
switch
(
requestCase
)
{
return
retrieve
(
request
);
case
RETRIEVE_REQUEST:
default
:
return
retrieve
(
request
);
return
write
(
request
);
default
:
}
return
write
(
request
);
}
else
{
// empty request, empty response.
return
MultiTransactionResponse
.
newBuilder
().
build
();
}
}
}
}
...
@@ -649,7 +655,10 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa
...
@@ -649,7 +655,10 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa
}
}
break
;
break
;
default
:
default
:
throw
new
UnsupportedOperationException
(
"Not implemented"
);
throw
new
CaosDBException
(
"Cannot process a "
+
request
.
getWrappedRequestsCase
().
name
()
+
" in a write request."
);
}
}
}
}
...
...
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