diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 2921978399..d9449f4c0f 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -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) diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/FDBDatabaseRunner.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/FDBDatabaseRunner.java index dae44476e7..1f73bf13d8 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/FDBDatabaseRunner.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/FDBDatabaseRunner.java @@ -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; @@ -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 diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/FDBRecordContext.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/FDBRecordContext.java index cc5aa2d5c3..da88f223b3 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/FDBRecordContext.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/FDBRecordContext.java @@ -1184,6 +1184,7 @@ public Map getMdcContext() { *
  • Same {@linkplain FDBDatabase.WeakReadSemantics weak read semantics}
  • *
  • Same {@linkplain FDBTransactionPriority priority}
  • *
  • Same {@linkplain #getTimeoutMillis() transaction timeout}
  • + *
  • Same {@linkplain #getPropertyStorage()} property storage}
  • * * @return a new database runner based on this context */ @@ -1195,6 +1196,7 @@ public FDBDatabaseRunner newRunner() { runner.setWeakReadSemantics(weakReadSemantics); runner.setPriority(priority); runner.setTransactionTimeoutMillis(timeoutMillis); + runner.setRecordLayerPropertyStorage(propertyStorage); return runner; }