use of com.yahoo.vespa.config.protocol.JRTServerConfigRequestV3 in project vespa by vespa-engine.
the class JRTConfigRequesterTest method testFirstRequestAfterSubscribing.
@Test
public void testFirstRequestAfterSubscribing() {
ConfigSubscriber subscriber = new ConfigSubscriber();
final TimingValues timingValues = getTestTimingValues();
JRTConfigSubscription<SimpletypesConfig> sub = createSubscription(subscriber, timingValues);
final MockConnection connection = new MockConnection();
JRTConfigRequester requester = new JRTConfigRequester(connection, timingValues);
assertThat(requester.getConnectionPool(), is(connection));
requester.request(sub);
final Request request = connection.getRequest();
assertNotNull(request);
assertThat(connection.getNumberOfRequests(), is(1));
JRTServerConfigRequestV3 receivedRequest = JRTServerConfigRequestV3.createFromRequest(request);
assertTrue(receivedRequest.validateParameters());
assertThat(receivedRequest.getTimeout(), is(timingValues.getSubscribeTimeout()));
assertThat(requester.getFatalFailures(), is(0));
assertThat(requester.getTransientFailures(), is(0));
}
use of com.yahoo.vespa.config.protocol.JRTServerConfigRequestV3 in project vespa by vespa-engine.
the class RpcServer method getConfigV3.
/**
* Called by reflection from RPC.
* Handles RPC method "config.v3.getConfig" requests.
* Uses the template pattern to call methods in classes that extend RpcServer.
*/
@SuppressWarnings({ "UnusedDeclaration" })
public final void getConfigV3(Request req) {
if (log.isLoggable(LogLevel.SPAM)) {
log.log(LogLevel.SPAM, getConfigMethodName);
}
req.detach();
JRTServerConfigRequestV3 request = JRTServerConfigRequestV3.createFromRequest(req);
addToRequestQueue(request);
hostLivenessTracker.receivedRequestFrom(request.getClientHostName());
}
use of com.yahoo.vespa.config.protocol.JRTServerConfigRequestV3 in project vespa by vespa-engine.
the class SuperModelControllerTest method test_unknown_config_definition.
@Test(expected = UnknownConfigDefinitionException.class)
public void test_unknown_config_definition() {
String md5 = "asdfasf";
Request request = JRTClientConfigRequestV3.createWithParams(new ConfigKey<>("foo", "id", "bar", md5, null), DefContent.fromList(Collections.emptyList()), "fromHost", md5, 1, 1, Trace.createDummy(), CompressionType.UNCOMPRESSED, Optional.empty()).getRequest();
JRTServerConfigRequestV3 v3Request = JRTServerConfigRequestV3.createFromRequest(request);
handler.resolveConfig(v3Request);
}
Aggregations