Skip to content

Commit

Permalink
Resolves FoundationDB#1645: FDBRecordContext::newRunner drops propert…
Browse files Browse the repository at this point in the history
…y storage
  • Loading branch information
tian-yizuo committed May 5, 2022
1 parent 8d3eac9 commit 7487a6c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/ReleaseNotes.md
Expand Up @@ -16,7 +16,7 @@ This release also updates downstream dependency versions. Most notably, the prot
// begin next release
### NEXT_RELEASE
* **Bug fix** Fix 1 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** FDBRecordContext::newRunner drops property storage [(Issue #1645)](https://github.com/FoundationDB/fdb-record-layer/issues/1645)
* **Bug fix** Fix 2 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 3 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 4 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
Expand Down
Expand Up @@ -22,6 +22,7 @@

import com.apple.foundationdb.annotation.API;
import com.apple.foundationdb.record.RecordCoreException;
import com.apple.foundationdb.record.provider.foundationdb.properties.RecordLayerPropertyStorage;
import com.apple.foundationdb.record.provider.foundationdb.synchronizedsession.SynchronizedSessionRunner;
import com.apple.foundationdb.subspace.Subspace;
import com.apple.foundationdb.synchronizedsession.SynchronizedSession;
Expand Down Expand Up @@ -201,6 +202,15 @@ default void setTransactionTimeoutMillis(long transactionTimeoutMillis) {
getContextConfigBuilder().setTransactionTimeoutMillis(transactionTimeoutMillis);
}

/**
* Set the properties configured by adopter of Record-Layer for transactions opened by this runner.
* @param propertyStorage the storage of properties
* @see FDBRecordContext#getPropertyStorage()
*/
default void setRecordLayerPropertyStorage(@Nonnull RecordLayerPropertyStorage propertyStorage) {
getContextConfigBuilder().setRecordContextProperties(propertyStorage);
}

/**
* Gets the maximum number of attempts for a database to make when running a
* retriable transactional operation. This is used by {@link #run} and {@link #runAsync} to limit the number of
Expand Down
Expand Up @@ -1195,6 +1195,7 @@ public FDBDatabaseRunner newRunner() {
runner.setWeakReadSemantics(weakReadSemantics);
runner.setPriority(priority);
runner.setTransactionTimeoutMillis(timeoutMillis);
runner.setRecordLayerPropertyStorage(propertyStorage);
return runner;
}

Expand Down

0 comments on commit 7487a6c

Please sign in to comment.