foundationdb/flow/task_priority_support.swift
Konrad `ktoso` Malawski c26aa0b2a3
Introduce initial Swift support in fdbserver (#10156)
* [fdbserver] workaround the FRT type layout issue to get Swfit getVersion working

* MasterData.actor.h: fix comment typo

* masterserver.swift: some tweaks

* masterserver.swift: remove getVersion function, use the method

* masterserver.swift: print replied version to output for tracing

* [swift] add radar links for C++ interop issues found in getVersion bringup

* Update fdbserver.actor.cpp

* Migrate MasterData closer to full reference type

This removes the workaround for the FRT type layout issue, and gets us closer to making MasterData a full reference type

* [interop] require a new toolchain (>= Oct 19th) to build

* [Swift] fix computation of toAdd for getVersion Swift implementation

* add Swift to FDBClient and add async `atLeast` to NotifiedVersion

* fix

* use new atLeast API in master server

* =build fixup link dependencies in swift fdbclient

* clocks

* +clock implement Clock using Flow's notion of time

* [interop] workaround the immortal retain/release issue

* [swift] add script to get latest centos toolchain

* always install swift hooks; not only in "test" mode

* simulator - first thing running WIP

* cleanups

* more cleanup

* working snapshot

* remove sim debug printlns

* added convenience for whenAtLeast

* try Alex's workaround

* annotate nonnull

* cleanup clock a little bit

* fix missing impls after rebase

* Undo the swift_lookup_Map_UID_CommitProxyVersionReplies workaround

No longer needed - the issue was retain/release

* [flow][swift] add Swift version of BUGGIFY

* [swiftication] add CounterValue type to provide value semantics for Counter types on the Swift side

* remove extraneous requestingProxyUID local

* masterserver: initial Swift state prototype

* [interop] make the Swiftied getVersion work

* masterserver - remove the C++ implementation (it can't be supported as state is now missing)

* Remove unnecessary SWIFT_CXX_REF_IMMORTAL annotations from Flow types

* Remove C++ implementation of CommitProxyVersionReplies - it's in Swift now

* [swift interop] remove more SWIFT_CXX_REF_IMMORTAL

* [swift interop] add SWIFT_CXX_IMMORTAL_SINGLETON_TYPE annotation for semanticly meaningful immortal uses

* rename SWIFT_CXX_REF_IMMORTAL -> UNSAFE_SWIFT_CXX_IMMORTAL_REF

* Move master server waitForPrev to swift

* =build fix linking swift in all modules

* =build single link option

* =cmake avoid manual math, just get "last" element from list

* implement Streams support (#18)

* [interop] update to new toolchain #6

* [interop] remove C++ vtable linking workarounds

* [interop] make MasterData proper reference counted SWIFT_CXX_REF_MASTERDATA

* [interop] use Swift array to pass UIDs to registerLastCommitProxyVersionReplies

* [interop] expose MasterServer actor to C++ without wrapper struct

* [interop] we no longer need expose on methods 🥳

* [interop] initial prototype of storing CheckedContinuation on the C++ side

* Example of invoking a synchronous swift function from a C++ unit test. (#21)

* move all "tests" we have in Swift, and priority support into real modules (#24)

* Make set continuation functions inline

* Split flow_swift into flow_swift and flow_swift_future to break circular dependency

* rename SwiftContinuationCallbackStruct to FlowCallbackForSwiftContinuation

* Future interop: use a method in a class template for continuation set call

* Revert "Merge pull request #22 from FoundationDB/cpp-continuation" (#30)

* Basic Swift Guide (#29)

Co-authored-by: Alex Lorenz <arphaman@gmail.com>

* Revert "Revert "Merge pull request #22 from FoundationDB/cpp-continuation" (#30)"

This reverts commit c025fe6258c4c4904d5e70cd549d408bb61f2802.

* Restore the C++ continuation, but it seems waitValue is broken for CInt somehow now

* disable broken tests - waitValue not accessible

* Streams can be async iterated over (#27)

Co-authored-by: Alex Lorenz <arphaman@gmail.com>

* remove work in progress things (#35)

* remove some not used (yet) code

* remove expose func for CInt, it's a primitive so we always have witness info (#37)

* +masterdata implement provideVersions in Swift (#36)

* serveLiveCommittedVersion in Swift (#38)

* Port updateLiveCommittedVersion to swift (#33)

Co-authored-by: Konrad `ktoso` Malawski <konrad_malawski@apple.com>

* Implement updateRecoveryData in Swift (#39)

Co-authored-by: Alex Lorenz <arphaman@gmail.com>

* Simplify flow_swift to avoid multiple targets and generate separate CheckedContinuation header

* Uncomment test which was blocked on extensions not being picked up (#31)

* [interop] Use a separate target for Swift-to-C++ header generation

* reduce boilerplate in future and stream support (#41)

* [interop] require interop v8 - that will fix linker issue (https://github.com/apple/swift/issues/62448)

* [interop] fix swift_stream_support.h Swift include

* [interop] bump up requirement to version 9

* [interop] Generalize the Flow.Optional -> Swift.Optional conversion using generics

* [WIP] masterServer func in Swift (#45)

* [interop] Try conforms_to with a SWIFT_CONFORMS_TO macro for Optional conformance (#49)

* [interop] include FlowOptionalProtocol source file when generating Flow_CheckedContinuation.h

This header generation step depends on the import of the C++ Flow module, which requires the presence of FlowOptionalProtocol

* conform Future to FlowFutureOps

* some notes

* move to value() so we can use discardable result for Flow.Void

* make calling into Swift async funcs nicer by returning Flow Futures

* [interop] hide initial use of FlowCheckedContinuation in flow.h to break dependency cycle

* [fdbserver] fix an EncryptionOpsUtils.h modularization issue (showed up with modularized libc++)

* Pass GCC toolchain using CMAKE_Swift_COMPILE_EXTERNAL_TOOLCHAIN to Swift's clang importer

* [interop] drop the no longer needed libstdc++ include directories

* [cmake] add a configuration check to ensure Swift can import C++ standard library

* [swift] include msgpack from msgpack_DIR

* [interop] make sure the FDB module maps have 'export' directive

* add import 'flow_swift' to swift_fdbserver_cxx_swift_value_conformance.swift

This is needed for CONFORMS_TO to work in imported modules

* make sure the Swift -> C++ manually bridged function signature matches generated signature

* [interop][workaround] force back use of @expose attribute before _Concurrency issue is fixed

* [interop] make getResolutionBalancer return a pointer to allow Swift to use it

We should revert back to a reference once compiler allows references again

* [interop] add a workaround for 'pop' being marked as unsafe in Swift

* masterserver.swift: MasterData returns the Swift actor pointer in an unsafe manner

* Add a 'getCopy' method to AsyncVar to make it more Swift friendly

* [interop] bump up the toolchain requirement

* Revert "[interop][workaround] force back use of @expose attribute before _Concurrency issue is fixed"

This reverts commit b01b271a76d1677bbb7c5c9c64cdad4b8b2b9612.

* [interop] add FIXME comments highlighting new issue workarounds

* [interop] adopt the new C++ interoperability compiler flag

* [interop] generate swift compile commands

* Do not deduplicate Swift compilation commands

* [interop] generate swift compile commands

* Do not deduplicate Swift compilation commands

* flow actorcompiler.h: add a SWIFT_ACTOR empty macro definition

This is needed to make the actor files parsable by clangd

* [cmake] add missing dependencies

* experimental cross compile

* [cmake] fix triple in cross-compiled cmake flags

* [interop] update to interop toolchain version 16

* [x-compile] add flags for cross-compiling boost

* cleanup x-compile cmake changes

* [cmake] fix typo in CMAKE_Swift_COMPILER_EXTERNAL_TOOLCHAIN config variable

* [interop] pass MasterDataActor from Swift to C++ and back to Swift

* [fdbserver] Swift->C++ header generation for FDBServer should use same module cache path

* Update swift_get_latest_toolchain.sh to fetch 5.9 toochains

* set HAVE_FLAG_SEARCH_PATHS_FIRST for cross compilation

* Resolve conflicts in net2/sim2/actors, can't build yet

* undo SWIFT_ACTOR changes, not necessary for merge

* guard c++ compiler flags with is_cxx_compile

* Update flow/actorcompiler/ActorParser.cs

Co-authored-by: Evan Wilde <etceterawilde@gmail.com>

* update the boost dependency

* Include boost directory from the container for Swift

* conform flow's Optional to FlowOptionalProtocol again

* Guard entire RocksDBLogForwarder.h with SSD_ROCKSDB_EXPERIMENTAL to avoid failing on missing rocksdb APIs

* remove extraneous merge marker

* [swift] update swift_test_streams.swifto to use vars in more places

* Add header guard to flow/include/flow/ThreadSafeQueue.h to fix moduralization issue

* Update net and sim impls

* [cmake] use prebuilt libc++ boost only when we're actually using libc++

* [fdbserver] Swift->C++ header generation for FDBServer should use same module cache path

* fixups after merge

* remove CustomStringConvertible conformance that would not be used

* remove self-caused deprecation warnings in future_support

* handle newly added task priority

* reformatting

* future: make value() not mutating

* remove FIXME, not needed anymore

* future: clarify why as functions

* Support TraceEvent in Swift

* Enable TraceEvent using a class wrapper in Swift

* prearing WITH_SWIFT flag

* wip disabled failing Go stuff

* cleanup WITH_SWIFT_FLAG and reenable Go

* wip disabled failing Go stuff

* move setting flag before printing it

* Add SWIFT_IDE_SETUP and cleanup guides and build a bit

* Revert "Wipe packet buffers that held serialized WipedString (#10018)"

This reverts commit e2df6e33029897360f8e11b3aea8fef97393a98c.

* [Swift] Compile workaround in KeyBackedRangeMap; default init is incorrect

* [interop] do not add FlowFutureOps conformance when building flow clang module for Flow checked continuation header pre-generation

* make sure to show  -DUSE_LIBCXX=OFF in readme

* readme updates

* do not print to stderr

* Update Swift and C++ code to build with latest Swift 5.9 toolchain now that we no longer support universal references and bridge the methods that take in a constant reference template parameter correctly

* Fix SERVER_KNOBS and enable use them for masterserver

* Bump to C++20, Swift is now able to handle it as well

* Put waitForPrev behind FLOW_WITH_SWIFT knob

* Forward declare updateLiveCommittedVersion

* Remove unused code

* fix wrong condition set for updateLiveCommittedVersion

* Revert "Revert "Wipe packet buffers that held serialized WipedString (#10018)""

This reverts commit 5ad8dce0525fb1844664ed2ccd7ba595db6913dd.

* Enable go-bindings in cmake

* Revert "Revert "Wipe packet buffers that held serialized WipedString (#10018)""

This reverts commit 5ad8dce0525fb1844664ed2ccd7ba595db6913dd.

* USE_SWIFT flag so we "build without swift" until ready to by default

* uncomment a few tests which were disabled during USE_SWIFT enablement

* the option is WITH_SWIFT, not USE

* formatting

* Fix masterserver compile error

* Fix some build errors.

How did it not merge cleanly? :/

* remove initializer list from constructor

* Expect Swift toolchain only if WITH_SWIFT is enabled

* Don't require Flow_CheckedContinuation when Swift is disabled

* Don't compile FlowCheckedContinuation when WITH_SWIFT=OFF

* No-op Swift macros

* More compile guards

* fix typo

* Run clang-format

* Guard swift/bridging include in fdbrpc

* Remove printf to pass the test

* Remove some more printf to avoid potential issues

TODO: Need to be TraceEvents instead

* Remove __has_feature(nullability) as its only used in Swift

* Don't use __FILENAME__

* Don't call generate_module_map outside WITH_SWIFT

* Add some more cmake stuff under WITH_SWIFT guard

* Some more guards

* Bring back TLSTest.cpp

* clang-format

* fix comment formatting

* Remove unused command line arg

* fix cmake formatting in some files

* Address some review comments

* fix clang-format error

---------

Co-authored-by: Alex Lorenz <arphaman@gmail.com>
Co-authored-by: Russell Sears <russell_sears@apple.com>
Co-authored-by: Evan Wilde <etceterawilde@gmail.com>
Co-authored-by: Alex Lorenz <aleksei_lorenz@apple.com>
Co-authored-by: Vishesh Yadav <vishesh_yadav@apple.com>
Co-authored-by: Vishesh Yadav <vishesh3y@gmail.com>
2023-06-02 16:09:28 -05:00

439 lines
32 KiB
Swift

import Flow
import Flow
// ==== ---------------------------------------------------------------------------------------------------------------
extension Flow.TaskPriority {
/// Values representing TaskPriority in the range that is possible to use as Task priority in Swift Concurrency.
///
/// The values are set back to ``Flow/TaskPriority`` when they are enqueued.
///
/// WARNING: When changing the values here, make sure to change the switch in `swift_priority_to_flow`
///
/// Note: Priority in swift must be in the 0-255 range, so we should map the priorities into this range.
/// The actual values don't really matter at this point, because they'll be mapped back into the exact values as
/// has them declared in `flow.h` before enqueueing jobs.
private enum Repr: UInt8, CaseIterable {
/// WARNING: When changing the values here, make sure to change the switch in `swift_priority_to_net2`
case Max = 255
case RunLoop = 200
case ASIOReactor = 173
case SSSpilledChangeFeedReply = 74
case RunCycleFunction = 73
case FlushTrace = 72
case WriteSocket = 71
case PollEIO = 70
case DiskIOComplete = 69
case LoadBalancedEndpoint = 68
case ReadSocket = 67
case AcceptSocket = 66
case Handshake = 65
case CoordinationReply = 64
case Coordination = 63
case FailureMonitor = 62
case ResolutionMetrics = 61
case Worker = 60
case ClusterControllerWorker = 59
case ClusterControllerRecruit = 58
case ClusterControllerRegister = 57
case ClusterController = 56
case MasterTLogRejoin = 55
case ProxyStorageRejoin = 54
case TLogQueuingMetrics = 53
case TLogPop = 52
case TLogPeekReply = 51
case TLogPeek = 50
case TLogCommitReply = 49
case TLogCommit = 48
case ReportLiveCommittedVersion = 47
case ProxyGetRawCommittedVersion = 46
case ProxyMasterVersionReply = 45
case ProxyCommitYield2 = 44
case ProxyTLogCommitReply = 43
case ProxyCommitYield1 = 42
case ProxyResolverReply = 41
case ProxyCommit = 40
case ProxyCommitBatcher = 39
case TLogConfirmRunningReply = 38
case TLogConfirmRunning = 37
case ProxyGRVTimer = 36
case GetConsistentReadVersion = 35
case GetLiveCommittedVersionReply = 34
case GetLiveCommittedVersion = 33
case GetTLogPrevCommitVersion = 32
case UpdateRecoveryTransactionVersion = 31
case DefaultPromiseEndpoint = 30
case DefaultOnMainThread = 29
case DefaultDelay = 28
case DefaultYield = 27
case DiskRead = 26
case DefaultEndpoint = 25 // FIXME: avoid overlaps with Swift's predefined priorities
case UnknownEndpoint = 24
case MoveKeys = 23
case DataDistributionLaunch = 22
case Ratekeeper = 21
case DataDistribution = 20
case DataDistributionLow = 19
case DataDistributionVeryLow = 18
case BlobManager = 17
case DiskWrite = 16
case UpdateStorage = 15
case CompactCache = 14
case TLogSpilledPeekReply = 13
case BlobWorkerReadChangeFeed = 12
case BlobWorkerUpdateFDB = 11
case BlobWorkerUpdateStorage = 10
case FetchKeys = 9
case RestoreApplierWriteDB = 8
case RestoreApplierReceiveMutations = 7
case RestoreLoaderFinishVersionBatch = 6
case RestoreLoaderSendMutations = 5
case RestoreLoaderLoadFiles = 4
case LowPriorityRead = 3
case Low = 2
case Min = 1
case Zero = 0
}
// NOTE: The values returned MUST fit in UInt8 (i.e. be 0..<256)
var asSwift: _Concurrency.TaskPriority {
switch self {
case .Max: return .init(rawValue: Repr.Max.rawValue)
case .RunLoop: return .init(rawValue: Repr.RunLoop.rawValue)
case .ASIOReactor: return .init(rawValue: Repr.ASIOReactor.rawValue)
case .RunCycleFunction: return .init(rawValue: Repr.RunCycleFunction.rawValue)
case .FlushTrace: return .init(rawValue: Repr.FlushTrace.rawValue)
case .WriteSocket: return .init(rawValue: Repr.WriteSocket.rawValue)
case .PollEIO: return .init(rawValue: Repr.PollEIO.rawValue)
case .DiskIOComplete: return .init(rawValue: Repr.DiskIOComplete.rawValue)
case .LoadBalancedEndpoint: return .init(rawValue: Repr.LoadBalancedEndpoint.rawValue)
case .ReadSocket: return .init(rawValue: Repr.ReadSocket.rawValue)
case .AcceptSocket: return .init(rawValue: Repr.AcceptSocket.rawValue)
case .Handshake: return .init(rawValue: Repr.Handshake.rawValue)
case .CoordinationReply: return .init(rawValue: Repr.CoordinationReply.rawValue)
case .Coordination: return .init(rawValue: Repr.Coordination.rawValue)
case .FailureMonitor: return .init(rawValue: Repr.FailureMonitor.rawValue)
case .ResolutionMetrics: return .init(rawValue: Repr.ResolutionMetrics.rawValue)
case .Worker: return .init(rawValue: Repr.Worker.rawValue)
case .ClusterControllerWorker: return .init(rawValue: Repr.ClusterControllerWorker.rawValue)
case .ClusterControllerRecruit: return .init(rawValue: Repr.ClusterControllerRecruit.rawValue)
case .ClusterControllerRegister: return .init(rawValue: Repr.ClusterControllerRegister.rawValue)
case .ClusterController: return .init(rawValue: Repr.ClusterController.rawValue)
case .MasterTLogRejoin: return .init(rawValue: Repr.MasterTLogRejoin.rawValue)
case .ProxyStorageRejoin: return .init(rawValue: Repr.ProxyStorageRejoin.rawValue)
case .TLogQueuingMetrics: return .init(rawValue: Repr.TLogQueuingMetrics.rawValue)
case .TLogPop: return .init(rawValue: Repr.TLogPop.rawValue)
case .TLogPeekReply: return .init(rawValue: Repr.TLogPeekReply.rawValue)
case .TLogPeek: return .init(rawValue: Repr.TLogPeek.rawValue)
case .TLogCommitReply: return .init(rawValue: Repr.TLogCommitReply.rawValue)
case .TLogCommit: return .init(rawValue: Repr.TLogCommit.rawValue)
case .ReportLiveCommittedVersion: return .init(rawValue: Repr.ReportLiveCommittedVersion.rawValue)
case .ProxyGetRawCommittedVersion: return .init(rawValue: Repr.ProxyGetRawCommittedVersion.rawValue)
case .ProxyMasterVersionReply: return .init(rawValue: Repr.ProxyMasterVersionReply.rawValue)
case .ProxyCommitYield2: return .init(rawValue: Repr.ProxyCommitYield2.rawValue)
case .ProxyTLogCommitReply: return .init(rawValue: Repr.ProxyTLogCommitReply.rawValue)
case .ProxyCommitYield1: return .init(rawValue: Repr.ProxyCommitYield1.rawValue)
case .ProxyResolverReply: return .init(rawValue: Repr.ProxyResolverReply.rawValue)
case .ProxyCommit: return .init(rawValue: Repr.ProxyCommit.rawValue)
case .ProxyCommitBatcher: return .init(rawValue: Repr.ProxyCommitBatcher.rawValue)
case .TLogConfirmRunningReply: return .init(rawValue: Repr.TLogConfirmRunningReply.rawValue)
case .TLogConfirmRunning: return .init(rawValue: Repr.TLogConfirmRunning.rawValue)
case .ProxyGRVTimer: return .init(rawValue: Repr.ProxyGRVTimer.rawValue)
case .GetConsistentReadVersion: return .init(rawValue: Repr.GetConsistentReadVersion.rawValue)
case .GetLiveCommittedVersionReply: return .init(rawValue: Repr.GetLiveCommittedVersionReply.rawValue)
case .GetLiveCommittedVersion: return .init(rawValue: Repr.GetLiveCommittedVersion.rawValue)
case .GetTLogPrevCommitVersion: return .init(rawValue: Repr.GetTLogPrevCommitVersion.rawValue)
case .UpdateRecoveryTransactionVersion: return .init(rawValue: Repr.UpdateRecoveryTransactionVersion.rawValue)
case .DefaultPromiseEndpoint: return .init(rawValue: Repr.DefaultPromiseEndpoint.rawValue)
case .DefaultOnMainThread: return .init(rawValue: Repr.DefaultOnMainThread.rawValue)
case .DefaultDelay: return .init(rawValue: Repr.DefaultDelay.rawValue)
case .DefaultYield: return .init(rawValue: Repr.DefaultYield.rawValue)
case .DiskRead: return .init(rawValue: Repr.DiskRead.rawValue)
case .DefaultEndpoint: return .init(rawValue: Repr.DefaultEndpoint.rawValue)
case .UnknownEndpoint: return .init(rawValue: Repr.UnknownEndpoint.rawValue)
case .MoveKeys: return .init(rawValue: Repr.MoveKeys.rawValue)
case .DataDistributionLaunch: return .init(rawValue: Repr.DataDistributionLaunch.rawValue)
case .Ratekeeper: return .init(rawValue: Repr.Ratekeeper.rawValue)
case .DataDistribution: return .init(rawValue: Repr.DataDistribution.rawValue)
case .DataDistributionLow: return .init(rawValue: Repr.DataDistributionLow.rawValue)
case .DataDistributionVeryLow: return .init(rawValue: Repr.DataDistributionVeryLow.rawValue)
case .BlobManager: return .init(rawValue: Repr.BlobManager.rawValue)
case .DiskWrite: return .init(rawValue: Repr.DiskWrite.rawValue)
case .UpdateStorage: return .init(rawValue: Repr.UpdateStorage.rawValue)
case .CompactCache: return .init(rawValue: Repr.CompactCache.rawValue)
case .TLogSpilledPeekReply: return .init(rawValue: Repr.TLogSpilledPeekReply.rawValue)
case .SSSpilledChangeFeedReply: return .init(rawValue: Repr.SSSpilledChangeFeedReply.rawValue)
case .BlobWorkerReadChangeFeed: return .init(rawValue: Repr.BlobWorkerReadChangeFeed.rawValue)
case .BlobWorkerUpdateFDB: return .init(rawValue: Repr.BlobWorkerUpdateFDB.rawValue)
case .BlobWorkerUpdateStorage: return .init(rawValue: Repr.BlobWorkerUpdateStorage.rawValue)
case .FetchKeys: return .init(rawValue: Repr.FetchKeys.rawValue)
case .RestoreApplierWriteDB: return .init(rawValue: Repr.RestoreApplierWriteDB.rawValue)
case .RestoreApplierReceiveMutations: return .init(rawValue: Repr.RestoreApplierReceiveMutations.rawValue)
case .RestoreLoaderFinishVersionBatch: return .init(rawValue: Repr.RestoreLoaderFinishVersionBatch.rawValue)
case .RestoreLoaderSendMutations: return .init(rawValue: Repr.RestoreLoaderSendMutations.rawValue)
case .RestoreLoaderLoadFiles: return .init(rawValue: Repr.RestoreLoaderLoadFiles.rawValue)
case .LowPriorityRead: return .init(rawValue: Repr.LowPriorityRead.rawValue)
case .Low: return .init(rawValue: Repr.Low.rawValue)
case .Min: return .init(rawValue: Repr.Min.rawValue)
case .Zero: return .init(rawValue: Repr.Zero.rawValue)
@unknown default: fatalError("Unknown Flow.TaskPriority: \(self)")
}
}
}
extension _Concurrency.TaskPriority {
public static var Max: Self { Flow.TaskPriority.Max.asSwift }
public static var RunLoop: Self { Flow.TaskPriority.RunLoop.asSwift }
public static var ASIOReactor: Self { Flow.TaskPriority.ASIOReactor.asSwift }
public static var RunCycleFunction: Self { Flow.TaskPriority.RunCycleFunction.asSwift }
public static var FlushTrace: Self { Flow.TaskPriority.FlushTrace.asSwift }
public static var WriteSocket: Self { Flow.TaskPriority.WriteSocket.asSwift }
public static var PollEIO: Self { Flow.TaskPriority.PollEIO.asSwift }
public static var DiskIOComplete: Self { Flow.TaskPriority.DiskIOComplete.asSwift }
public static var LoadBalancedEndpoint: Self { Flow.TaskPriority.LoadBalancedEndpoint.asSwift }
public static var ReadSocket: Self { Flow.TaskPriority.ReadSocket.asSwift }
public static var AcceptSocket: Self { Flow.TaskPriority.AcceptSocket.asSwift }
public static var Handshake: Self { Flow.TaskPriority.Handshake.asSwift }
public static var CoordinationReply: Self { Flow.TaskPriority.CoordinationReply.asSwift }
public static var Coordination: Self { Flow.TaskPriority.Coordination.asSwift }
public static var FailureMonitor: Self { Flow.TaskPriority.FailureMonitor.asSwift }
public static var ResolutionMetrics: Self { Flow.TaskPriority.ResolutionMetrics.asSwift }
public static var Worker: Self { Flow.TaskPriority.Worker.asSwift }
public static var ClusterControllerWorker: Self { Flow.TaskPriority.ClusterControllerWorker.asSwift }
public static var ClusterControllerRecruit: Self { Flow.TaskPriority.ClusterControllerRecruit.asSwift }
public static var ClusterControllerRegister: Self { Flow.TaskPriority.ClusterControllerRegister.asSwift }
public static var ClusterController: Self { Flow.TaskPriority.ClusterController.asSwift }
public static var MasterTLogRejoin: Self { Flow.TaskPriority.MasterTLogRejoin.asSwift }
public static var ProxyStorageRejoin: Self { Flow.TaskPriority.ProxyStorageRejoin.asSwift }
public static var TLogQueuingMetrics: Self { Flow.TaskPriority.TLogQueuingMetrics.asSwift }
public static var TLogPop: Self { Flow.TaskPriority.TLogPop.asSwift }
public static var TLogPeekReply: Self { Flow.TaskPriority.TLogPeekReply.asSwift }
public static var TLogPeek: Self { Flow.TaskPriority.TLogPeek.asSwift }
public static var TLogCommitReply: Self { Flow.TaskPriority.TLogCommitReply.asSwift }
public static var TLogCommit: Self { Flow.TaskPriority.TLogCommit.asSwift }
public static var ReportLiveCommittedVersion: Self { Flow.TaskPriority.ReportLiveCommittedVersion.asSwift }
public static var ProxyGetRawCommittedVersion: Self { Flow.TaskPriority.ProxyGetRawCommittedVersion.asSwift }
public static var ProxyMasterVersionReply: Self { Flow.TaskPriority.ProxyMasterVersionReply.asSwift }
public static var ProxyCommitYield2: Self { Flow.TaskPriority.ProxyCommitYield2.asSwift }
public static var ProxyTLogCommitReply: Self { Flow.TaskPriority.ProxyTLogCommitReply.asSwift }
public static var ProxyCommitYield1: Self { Flow.TaskPriority.ProxyCommitYield1.asSwift }
public static var ProxyResolverReply: Self { Flow.TaskPriority.ProxyResolverReply.asSwift }
public static var ProxyCommit: Self { Flow.TaskPriority.ProxyCommit.asSwift }
public static var ProxyCommitBatcher: Self { Flow.TaskPriority.ProxyCommitBatcher.asSwift }
public static var TLogConfirmRunningReply: Self { Flow.TaskPriority.TLogConfirmRunningReply.asSwift }
public static var TLogConfirmRunning: Self { Flow.TaskPriority.TLogConfirmRunning.asSwift }
public static var ProxyGRVTimer: Self { Flow.TaskPriority.ProxyGRVTimer.asSwift }
public static var GetConsistentReadVersion: Self { Flow.TaskPriority.GetConsistentReadVersion.asSwift }
public static var GetLiveCommittedVersionReply: Self { Flow.TaskPriority.GetLiveCommittedVersionReply.asSwift }
public static var GetLiveCommittedVersion: Self { Flow.TaskPriority.GetLiveCommittedVersion.asSwift }
public static var GetTLogPrevCommitVersion: Self { Flow.TaskPriority.GetTLogPrevCommitVersion.asSwift }
public static var UpdateRecoveryTransactionVersion: Self { Flow.TaskPriority.UpdateRecoveryTransactionVersion.asSwift }
public static var DefaultPromiseEndpoint: Self { Flow.TaskPriority.DefaultPromiseEndpoint.asSwift }
public static var DefaultOnMainThread: Self { Flow.TaskPriority.DefaultOnMainThread.asSwift }
public static var DefaultDelay: Self { Flow.TaskPriority.DefaultDelay.asSwift }
public static var DefaultYield: Self { Flow.TaskPriority.DefaultYield.asSwift }
public static var DiskRead: Self { Flow.TaskPriority.DiskRead.asSwift }
public static var DefaultEndpoint: Self { Flow.TaskPriority.DefaultEndpoint.asSwift }
public static var UnknownEndpoint: Self { Flow.TaskPriority.UnknownEndpoint.asSwift }
public static var MoveKeys: Self { Flow.TaskPriority.MoveKeys.asSwift }
public static var DataDistributionLaunch: Self { Flow.TaskPriority.DataDistributionLaunch.asSwift }
public static var Ratekeeper: Self { Flow.TaskPriority.Ratekeeper.asSwift }
public static var DataDistribution: Self { Flow.TaskPriority.DataDistribution.asSwift }
public static var DataDistributionLow: Self { Flow.TaskPriority.DataDistributionLow.asSwift }
public static var DataDistributionVeryLow: Self { Flow.TaskPriority.DataDistributionVeryLow.asSwift }
public static var BlobManager: Self { Flow.TaskPriority.BlobManager.asSwift }
public static var DiskWrite: Self { Flow.TaskPriority.DiskWrite.asSwift }
public static var UpdateStorage: Self { Flow.TaskPriority.UpdateStorage.asSwift }
public static var CompactCache: Self { Flow.TaskPriority.CompactCache.asSwift }
public static var TLogSpilledPeekReply: Self { Flow.TaskPriority.TLogSpilledPeekReply.asSwift }
public static var SSSpilledChangeFeedReply: Self { Flow.TaskPriority.SSSpilledChangeFeedReply.asSwift }
public static var BlobWorkerReadChangeFeed: Self { Flow.TaskPriority.BlobWorkerReadChangeFeed.asSwift }
public static var BlobWorkerUpdateFDB: Self { Flow.TaskPriority.BlobWorkerUpdateFDB.asSwift }
public static var BlobWorkerUpdateStorage: Self { Flow.TaskPriority.BlobWorkerUpdateStorage.asSwift }
public static var FetchKeys: Self { Flow.TaskPriority.FetchKeys.asSwift }
public static var RestoreApplierWriteDB: Self { Flow.TaskPriority.RestoreApplierWriteDB.asSwift }
public static var RestoreApplierReceiveMutations: Self { Flow.TaskPriority.RestoreApplierReceiveMutations.asSwift }
public static var RestoreLoaderFinishVersionBatch: Self { Flow.TaskPriority.RestoreLoaderFinishVersionBatch.asSwift }
public static var RestoreLoaderSendMutations: Self { Flow.TaskPriority.RestoreLoaderSendMutations.asSwift }
public static var RestoreLoaderLoadFiles: Self { Flow.TaskPriority.RestoreLoaderLoadFiles.asSwift }
public static var LowPriorityRead: Self { Flow.TaskPriority.LowPriorityRead.asSwift }
public static var Low: Self { Flow.TaskPriority.Low.asSwift }
public static var Min : Self { Flow.TaskPriority.Min.asSwift }
public static var Zero: Self { Flow.TaskPriority.Zero.asSwift }
var rawValueNet2: Int32 {
switch self {
case .Max: return Flow.TaskPriority.Max.rawValue
case .RunLoop: return Flow.TaskPriority.RunLoop.rawValue
case .ASIOReactor: return Flow.TaskPriority.ASIOReactor.rawValue
case .RunCycleFunction: return Flow.TaskPriority.RunCycleFunction.rawValue
case .FlushTrace: return Flow.TaskPriority.FlushTrace.rawValue
case .WriteSocket: return Flow.TaskPriority.WriteSocket.rawValue
case .PollEIO: return Flow.TaskPriority.PollEIO.rawValue
case .DiskIOComplete: return Flow.TaskPriority.DiskIOComplete.rawValue
case .LoadBalancedEndpoint: return Flow.TaskPriority.LoadBalancedEndpoint.rawValue
case .ReadSocket: return Flow.TaskPriority.ReadSocket.rawValue
case .AcceptSocket: return Flow.TaskPriority.AcceptSocket.rawValue
case .Handshake: return Flow.TaskPriority.Handshake.rawValue
case .CoordinationReply: return Flow.TaskPriority.CoordinationReply.rawValue
case .Coordination: return Flow.TaskPriority.Coordination.rawValue
case .FailureMonitor: return Flow.TaskPriority.FailureMonitor.rawValue
case .ResolutionMetrics: return Flow.TaskPriority.ResolutionMetrics.rawValue
case .Worker: return Flow.TaskPriority.Worker.rawValue
case .ClusterControllerWorker: return Flow.TaskPriority.ClusterControllerWorker.rawValue
case .ClusterControllerRecruit: return Flow.TaskPriority.ClusterControllerRecruit.rawValue
case .ClusterControllerRegister: return Flow.TaskPriority.ClusterControllerRegister.rawValue
case .ClusterController: return Flow.TaskPriority.ClusterController.rawValue
case .MasterTLogRejoin: return Flow.TaskPriority.MasterTLogRejoin.rawValue
case .ProxyStorageRejoin: return Flow.TaskPriority.ProxyStorageRejoin.rawValue
case .TLogQueuingMetrics: return Flow.TaskPriority.TLogQueuingMetrics.rawValue
case .TLogPop: return Flow.TaskPriority.TLogPop.rawValue
case .TLogPeekReply: return Flow.TaskPriority.TLogPeekReply.rawValue
case .TLogPeek: return Flow.TaskPriority.TLogPeek.rawValue
case .TLogCommitReply: return Flow.TaskPriority.TLogCommitReply.rawValue
case .TLogCommit: return Flow.TaskPriority.TLogCommit.rawValue
case .ReportLiveCommittedVersion: return Flow.TaskPriority.ReportLiveCommittedVersion.rawValue
case .ProxyGetRawCommittedVersion: return Flow.TaskPriority.ProxyGetRawCommittedVersion.rawValue
case .ProxyMasterVersionReply: return Flow.TaskPriority.ProxyMasterVersionReply.rawValue
case .ProxyCommitYield2: return Flow.TaskPriority.ProxyCommitYield2.rawValue
case .ProxyTLogCommitReply: return Flow.TaskPriority.ProxyTLogCommitReply.rawValue
case .ProxyCommitYield1: return Flow.TaskPriority.ProxyCommitYield1.rawValue
case .ProxyResolverReply: return Flow.TaskPriority.ProxyResolverReply.rawValue
case .ProxyCommit: return Flow.TaskPriority.ProxyCommit.rawValue
case .ProxyCommitBatcher: return Flow.TaskPriority.ProxyCommitBatcher.rawValue
case .TLogConfirmRunningReply: return Flow.TaskPriority.TLogConfirmRunningReply.rawValue
case .TLogConfirmRunning: return Flow.TaskPriority.TLogConfirmRunning.rawValue
case .ProxyGRVTimer: return Flow.TaskPriority.ProxyGRVTimer.rawValue
case .GetConsistentReadVersion: return Flow.TaskPriority.GetConsistentReadVersion.rawValue
case .GetLiveCommittedVersionReply: return Flow.TaskPriority.GetLiveCommittedVersionReply.rawValue
case .GetLiveCommittedVersion: return Flow.TaskPriority.GetLiveCommittedVersion.rawValue
case .GetTLogPrevCommitVersion: return Flow.TaskPriority.GetTLogPrevCommitVersion.rawValue
case .UpdateRecoveryTransactionVersion: return Flow.TaskPriority.UpdateRecoveryTransactionVersion.rawValue
case .DefaultPromiseEndpoint: return Flow.TaskPriority.DefaultPromiseEndpoint.rawValue
case .DefaultOnMainThread: return Flow.TaskPriority.DefaultOnMainThread.rawValue
case .DefaultDelay: return Flow.TaskPriority.DefaultDelay.rawValue
case .DefaultYield: return Flow.TaskPriority.DefaultYield.rawValue
case .DiskRead: return Flow.TaskPriority.DiskRead.rawValue
case .DefaultEndpoint: return Flow.TaskPriority.DefaultEndpoint.rawValue
case .UnknownEndpoint: return Flow.TaskPriority.UnknownEndpoint.rawValue
case .MoveKeys: return Flow.TaskPriority.MoveKeys.rawValue
case .DataDistributionLaunch: return Flow.TaskPriority.DataDistributionLaunch.rawValue
case .Ratekeeper: return Flow.TaskPriority.Ratekeeper.rawValue
case .DataDistribution: return Flow.TaskPriority.DataDistribution.rawValue
case .DataDistributionLow: return Flow.TaskPriority.DataDistributionLow.rawValue
case .DataDistributionVeryLow: return Flow.TaskPriority.DataDistributionVeryLow.rawValue
case .BlobManager: return Flow.TaskPriority.BlobManager.rawValue
case .DiskWrite: return Flow.TaskPriority.DiskWrite.rawValue
case .UpdateStorage: return Flow.TaskPriority.UpdateStorage.rawValue
case .CompactCache: return Flow.TaskPriority.CompactCache.rawValue
case .TLogSpilledPeekReply: return Flow.TaskPriority.TLogSpilledPeekReply.rawValue
case .SSSpilledChangeFeedReply: return Flow.TaskPriority.SSSpilledChangeFeedReply.rawValue
case .BlobWorkerReadChangeFeed: return Flow.TaskPriority.BlobWorkerReadChangeFeed.rawValue
case .BlobWorkerUpdateFDB: return Flow.TaskPriority.BlobWorkerUpdateFDB.rawValue
case .BlobWorkerUpdateStorage: return Flow.TaskPriority.BlobWorkerUpdateStorage.rawValue
case .FetchKeys: return Flow.TaskPriority.FetchKeys.rawValue
case .RestoreApplierWriteDB: return Flow.TaskPriority.RestoreApplierWriteDB.rawValue
case .RestoreApplierReceiveMutations: return Flow.TaskPriority.RestoreApplierReceiveMutations.rawValue
case .RestoreLoaderFinishVersionBatch: return Flow.TaskPriority.RestoreLoaderFinishVersionBatch.rawValue
case .RestoreLoaderSendMutations: return Flow.TaskPriority.RestoreLoaderSendMutations.rawValue
case .RestoreLoaderLoadFiles: return Flow.TaskPriority.RestoreLoaderLoadFiles.rawValue
case .LowPriorityRead: return Flow.TaskPriority.LowPriorityRead.rawValue
case .Low: return Flow.TaskPriority.Low.rawValue
case .Min: return Flow.TaskPriority.Min.rawValue
case .Zero: return Flow.TaskPriority.Zero.rawValue
default: fatalError("Unknown TaskPriority value: \(self.rawValue)")
}
}
var name: String {
switch self {
case .Max: return "Max"
case .RunLoop: return "RunLoop"
case .ASIOReactor: return "ASIOReactor"
case .RunCycleFunction: return "RunCycleFunction"
case .FlushTrace: return "FlushTrace"
case .WriteSocket: return "WriteSocket"
case .PollEIO: return "PollEIO"
case .DiskIOComplete: return "DiskIOComplete"
case .LoadBalancedEndpoint: return "LoadBalancedEndpoint"
case .ReadSocket: return "ReadSocket"
case .AcceptSocket: return "AcceptSocket"
case .Handshake: return "Handshake"
case .CoordinationReply: return "CoordinationReply"
case .Coordination: return "Coordination"
case .FailureMonitor: return "FailureMonitor"
case .ResolutionMetrics: return "ResolutionMetrics"
case .Worker: return "Worker"
case .ClusterControllerWorker: return "ClusterControllerWorker"
case .ClusterControllerRecruit: return "ClusterControllerRecruit"
case .ClusterControllerRegister: return "ClusterControllerRegister"
case .ClusterController: return "ClusterController"
case .MasterTLogRejoin: return "MasterTLogRejoin"
case .ProxyStorageRejoin: return "ProxyStorageRejoin"
case .TLogQueuingMetrics: return "TLogQueuingMetrics"
case .TLogPop: return "TLogPop"
case .TLogPeekReply: return "TLogPeekReply"
case .TLogPeek: return "TLogPeek"
case .TLogCommitReply: return "TLogCommitReply"
case .TLogCommit: return "TLogCommit"
case .ReportLiveCommittedVersion: return "ReportLiveCommittedVersion"
case .ProxyGetRawCommittedVersion: return "ProxyGetRawCommittedVersion"
case .ProxyMasterVersionReply: return "ProxyMasterVersionReply"
case .ProxyCommitYield2: return "ProxyCommitYield2"
case .ProxyTLogCommitReply: return "ProxyTLogCommitReply"
case .ProxyCommitYield1: return "ProxyCommitYield1"
case .ProxyResolverReply: return "ProxyResolverReply"
case .ProxyCommit: return "ProxyCommit"
case .ProxyCommitBatcher: return "ProxyCommitBatcher"
case .TLogConfirmRunningReply: return "TLogConfirmRunningReply"
case .TLogConfirmRunning: return "TLogConfirmRunning"
case .ProxyGRVTimer: return "ProxyGRVTimer"
case .GetConsistentReadVersion: return "GetConsistentReadVersion"
case .GetLiveCommittedVersionReply: return "GetLiveCommittedVersionReply"
case .GetLiveCommittedVersion: return "GetLiveCommittedVersion"
case .GetTLogPrevCommitVersion: return "GetTLogPrevCommitVersion"
case .UpdateRecoveryTransactionVersion: return "UpdateRecoveryTransactionVersion"
case .DefaultPromiseEndpoint: return "DefaultPromiseEndpoint"
case .DefaultOnMainThread: return "DefaultOnMainThread"
case .DefaultDelay: return "DefaultDelay"
case .DefaultYield: return "DefaultYield"
case .DiskRead: return "DiskRead"
case .DefaultEndpoint: return "DefaultEndpoint"
case .UnknownEndpoint: return "UnknownEndpoint"
case .MoveKeys: return "MoveKeys"
case .DataDistributionLaunch: return "DataDistributionLaunch"
case .Ratekeeper: return "Ratekeeper"
case .DataDistribution: return "DataDistribution"
case .DataDistributionLow: return "DataDistributionLow"
case .DataDistributionVeryLow: return "DataDistributionVeryLow"
case .BlobManager: return "BlobManager"
case .DiskWrite: return "DiskWrite"
case .UpdateStorage: return "UpdateStorage"
case .CompactCache: return "CompactCache"
case .TLogSpilledPeekReply: return "TLogSpilledPeekReply"
case .SSSpilledChangeFeedReply: return "SSSpilledChangeFeedReply"
case .BlobWorkerReadChangeFeed: return "BlobWorkerReadChangeFeed"
case .BlobWorkerUpdateFDB: return "BlobWorkerUpdateFDB"
case .BlobWorkerUpdateStorage: return "BlobWorkerUpdateStorage"
case .FetchKeys: return "FetchKeys"
case .RestoreApplierWriteDB: return "RestoreApplierWriteDB"
case .RestoreApplierReceiveMutations: return "RestoreApplierReceiveMutations"
case .RestoreLoaderFinishVersionBatch: return "RestoreLoaderFinishVersionBatch"
case .RestoreLoaderSendMutations: return "RestoreLoaderSendMutations"
case .RestoreLoaderLoadFiles: return "RestoreLoaderLoadFiles"
case .LowPriorityRead: return "LowPriorityRead"
case .Low: return "Low"
case .Min: return "Min"
case .Zero: return "Zero"
default: return "<unknown:\(self.rawValue)>"
}
}
}
extension _Concurrency.TaskPriority {
public var flowDescription: String {
"_Concurrency.TaskPriority(\(self.name), rawValue: \(rawValue), rawValueNet2: \(self.rawValueNet2))"
}
}