diff --git a/direct/core/src/main/java/cz/o2/proxima/direct/core/transaction/TransactionalOnlineAttributeWriter.java b/direct/core/src/main/java/cz/o2/proxima/direct/core/transaction/TransactionalOnlineAttributeWriter.java index 6f9fe9b80..ceb18bb90 100644 --- a/direct/core/src/main/java/cz/o2/proxima/direct/core/transaction/TransactionalOnlineAttributeWriter.java +++ b/direct/core/src/main/java/cz/o2/proxima/direct/core/transaction/TransactionalOnlineAttributeWriter.java @@ -252,6 +252,15 @@ public void commitWrite(List outputs, CommitCallback callback) transformed.size() == 1 && !isGlobalTransaction ? delegate : commitDelegate; List keyAttributes = transformed.stream().map(KeyAttributes::ofStreamElement).collect(Collectors.toList()); + boolean anyDisallowed = keyAttributes.stream().anyMatch(KeyAttribute::isWildcardQuery); + if (anyDisallowed) { + throw new IllegalArgumentException( + String.format( + "Invalid output writes %s. Wildcards need to have suffixes.", + keyAttributes.stream() + .filter(KeyAttribute::isWildcardQuery) + .collect(Collectors.toList()))); + } manager.commit(transactionId, keyAttributes); Response response = takeResponse(); if (response.getFlags() != Response.Flags.COMMITTED) { diff --git a/direct/transaction-manager/src/main/java/cz/o2/proxima/direct/transaction/manager/TransactionLogObserver.java b/direct/transaction-manager/src/main/java/cz/o2/proxima/direct/transaction/manager/TransactionLogObserver.java index 622a96e2a..d2c364177 100644 --- a/direct/transaction-manager/src/main/java/cz/o2/proxima/direct/transaction/manager/TransactionLogObserver.java +++ b/direct/transaction-manager/src/main/java/cz/o2/proxima/direct/transaction/manager/TransactionLogObserver.java @@ -510,7 +510,8 @@ static Iterable concatInputsAndOutputs( (a, b) -> a.getSequenceId() < b.getSequenceId() ? a : b)); outputAttributes.forEach( ka -> { - Preconditions.checkArgument(!ka.isWildcardQuery()); + Preconditions.checkArgument( + !ka.isWildcardQuery(), "Got KeyAttribute %s, which is not allowed output.", ka); KeyWithAttribute kwa = KeyWithAttribute.of(ka); if (!ka.getAttributeSuffix().isPresent()) { mapOfInputs.putIfAbsent(kwa, ka);