mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-22 23:19:02 +08:00
Update ISingleThreadTransaction::create to support PAXOS_CONFIG transactions
This commit is contained in:
parent
ba8d21e340
commit
da2f773759
@ -18,6 +18,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "fdbclient/ConfigKnobs.h"
|
#include "fdbclient/ConfigKnobs.h"
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "fdbclient/DatabaseContext.h"
|
#include "fdbclient/DatabaseContext.h"
|
||||||
#include "fdbclient/ISingleThreadTransaction.h"
|
#include "fdbclient/ISingleThreadTransaction.h"
|
||||||
|
#include "fdbclient/PaxosConfigTransaction.h"
|
||||||
#include "fdbclient/ReadYourWrites.h"
|
#include "fdbclient/ReadYourWrites.h"
|
||||||
#include "fdbclient/SimpleConfigTransaction.h"
|
#include "fdbclient/SimpleConfigTransaction.h"
|
||||||
|
|
||||||
@ -32,6 +33,9 @@ ISingleThreadTransaction* ISingleThreadTransaction::allocateOnForeignThread(Type
|
|||||||
} else if (type == Type::SIMPLE_CONFIG) {
|
} else if (type == Type::SIMPLE_CONFIG) {
|
||||||
auto tr = (SimpleConfigTransaction*)(SimpleConfigTransaction::operator new(sizeof(SimpleConfigTransaction)));
|
auto tr = (SimpleConfigTransaction*)(SimpleConfigTransaction::operator new(sizeof(SimpleConfigTransaction)));
|
||||||
return tr;
|
return tr;
|
||||||
|
} else if (type == Type::PAXOS_CONFIG) {
|
||||||
|
auto tr = (PaxosConfigTransaction*)(PaxosConfigTransaction::operator new(sizeof(PaxosConfigTransaction)));
|
||||||
|
return tr;
|
||||||
}
|
}
|
||||||
ASSERT(false);
|
ASSERT(false);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -45,6 +49,9 @@ void ISingleThreadTransaction::create(ISingleThreadTransaction* tr, Type type, D
|
|||||||
case Type::SIMPLE_CONFIG:
|
case Type::SIMPLE_CONFIG:
|
||||||
new (tr) SimpleConfigTransaction(db->getConnectionFile()->getConnectionString());
|
new (tr) SimpleConfigTransaction(db->getConnectionFile()->getConnectionString());
|
||||||
break;
|
break;
|
||||||
|
case Type::PAXOS_CONFIG:
|
||||||
|
new (tr) PaxosConfigTransaction(db->getConnectionFile()->getConnectionString());
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(false);
|
ASSERT(false);
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ public:
|
|||||||
enum class Type {
|
enum class Type {
|
||||||
RYW,
|
RYW,
|
||||||
SIMPLE_CONFIG,
|
SIMPLE_CONFIG,
|
||||||
|
PAXOS_CONFIG,
|
||||||
};
|
};
|
||||||
|
|
||||||
static ISingleThreadTransaction* allocateOnForeignThread(Type type);
|
static ISingleThreadTransaction* allocateOnForeignThread(Type type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user