@Test public void synchronizationRequestQueuing() throws Throwable { setUp(this.nodeCount); this.host.joinNodesAndVerifyConvergence(this.host.getPeerCount()); this.host.setNodeGroupQuorum(this.nodeCount); waitForReplicatedFactoryServiceAvailable( this.host.getPeerServiceUri(ExampleService.FACTORY_LINK), ServiceUriPaths.DEFAULT_NODE_SELECTOR); waitForReplicationFactoryConvergence(); VerificationHost peerHost = this.host.getPeerHost(); List<URI> exampleUris = this.host.createExampleServices(peerHost, 1, null); URI instanceUri = exampleUris.get(0); ExampleServiceState synchState = new ExampleServiceState(); synchState.documentSelfLink = UriUtils.getLastPathSegment(instanceUri); TestContext ctx = this.host.testCreate(this.updateCount); for (int i = 0; i < this.updateCount; i++) { Operation op = Operation.createPost(peerHost, ExampleService.FACTORY_LINK) .setBody(synchState) .addPragmaDirective(Operation.PRAGMA_DIRECTIVE_SYNCH_OWNER) .setReferer(this.host.getUri()) .setCompletion(ctx.getCompletion()); this.host.sendRequest(op); } ctx.await(); synchState.documentSelfLink = "unknown-service"; TestContext notFoundCtx = this.host.testCreate(1); Operation notFoundOp = Operation .createPost(peerHost, ExampleService.FACTORY_LINK) .setBody(synchState) .addPragmaDirective(Operation.PRAGMA_DIRECTIVE_SYNCH_OWNER) .setReferer(this.host.getUri()) .setCompletion((o, e) -> { if (e != null) { notFoundCtx.completeIteration(); return; } notFoundCtx.failIteration(new IllegalStateException("Failure expected")); }); this.host.sendRequest(notFoundOp); notFoundCtx.await(); }
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation patch); @Override void handlePost(Operation post); @Override void handleMaintenance(Operation maint); void handleGossipPatchCompletion(long sendTimeMicros, Operation maint, Operation patch,
            Throwable e,
            NodeGroupState localState, NodeGroupState patchBody, AtomicInteger remaining,
            NodeState remotePeer); }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation patch); @Override void handlePost(Operation post); @Override void handleMaintenance(Operation maint); void handleGossipPatchCompletion(long sendTimeMicros, Operation maint, Operation patch,
            Throwable e,
            NodeGroupState localState, NodeGroupState patchBody, AtomicInteger remaining,
            NodeState remotePeer); static final String STAT_NAME_JOIN_RETRY_COUNT; static final String STAT_NAME_REMOTE_FALSE_UNAVAILABLE_COUNT; static final String PROPERTY_NAME_PEER_REQUEST_TIMEOUT_MICROS; static final long PEER_REQUEST_TIMEOUT_MICROS; static final int MIN_PEER_GOSSIP_COUNT; static final String STAT_NAME_RESTARTING_SERVICES_COUNT; static final String STAT_NAME_RESTARTING_SERVICES_FAILURE_COUNT; static final String STAT_NAME_PREFIX_GOSSIP_PATCH_DURATION; }