blob: 3a18440a6e725d0f12cc7e90f68d427a3bf3325c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/util/vstringfmt.h>
#include <vespa/persistence/conformancetest/conformancetest.h>
#include <vespa/persistence/proxy/providerstub.h>
#include <vespa/persistence/proxy/providerproxy.h>
namespace storage {
namespace spi {
/**
* Generic wrapper for persistence conformance test factories. This
* wrapper will take any other factory and expose a factory interface
* that will create persistence instances that communicate with
* persistence instances created by the wrapped factory using the RPC
* persistence Proxy.
**/
struct ProxyFactory : ConformanceTest::PersistenceFactory
{
using Provider = storage::spi::PersistenceProvider;
using Client = storage::spi::ProviderProxy;
using Repo = document::DocumentTypeRepo;
ProxyFactory() {}
Provider::UP
getPersistenceImplementation(const Repo::SP &repo, const Repo::DocumenttypesConfig &) override {
return Provider::UP(new Client("tcp/localhost:3456", *repo));
}
virtual bool
supportsActiveState() const override
{
return false;
}
};
} // namespace spi
} // namespace storage
|