use of org.neo4j.com.RequestContext in project neo4j by neo4j.
the class BackupProtocolTest method shouldHandleNoForensicsSpecifiedInFullBackupRequest.
@Test
public void shouldHandleNoForensicsSpecifiedInFullBackupRequest() throws Exception {
TheBackupInterface backup = mock(TheBackupInterface.class);
RequestContext ctx = new RequestContext(0, 1, 0, -1, 12);
@SuppressWarnings("unchecked") TargetCaller<TheBackupInterface, Void> targetCaller = (TargetCaller<TheBackupInterface, Void>) BackupRequestType.FULL_BACKUP.getTargetCaller();
targetCaller.call(backup, ctx, EMPTY_BUFFER, null);
verify(backup).fullBackup(any(StoreWriter.class), eq(false));
}
use of org.neo4j.com.RequestContext in project neo4j by neo4j.
the class SlaveLocksClient method acquireSharedOnMaster.
private void acquireSharedOnMaster(ResourceType resourceType, long... resourceIds) {
if (resourceType == ResourceTypes.NODE || resourceType == ResourceTypes.RELATIONSHIP || resourceType == ResourceTypes.GRAPH_PROPS || resourceType == ResourceTypes.LEGACY_INDEX) {
makeSureTxHasBeenInitialized();
RequestContext requestContext = newRequestContextFor(this);
try (Response<LockResult> response = master.acquireSharedLock(requestContext, resourceType, resourceIds)) {
receiveLockResponse(response);
} catch (ComException e) {
throw new DistributedLockFailureException("Cannot get shared lock(s) on master", master, e);
}
}
}
use of org.neo4j.com.RequestContext in project neo4j by neo4j.
the class MasterClient214 method allocateIds.
@Override
public Response<IdAllocation> allocateIds(RequestContext context, final IdType idType) {
Serializer serializer = buffer -> buffer.writeByte(idType.ordinal());
Deserializer<IdAllocation> deserializer = (buffer, temporaryBuffer) -> readIdAllocation(buffer);
return sendRequest(requestTypes.type(HaRequestTypes.Type.ALLOCATE_IDS), context, serializer, deserializer);
}
use of org.neo4j.com.RequestContext in project neo4j by neo4j.
the class MasterClient214 method createRelationshipType.
@Override
public Response<Integer> createRelationshipType(RequestContext context, final String name) {
Serializer serializer = buffer -> writeString(buffer, name);
Deserializer<Integer> deserializer = (buffer, temporaryBuffer) -> buffer.readInt();
return sendRequest(requestTypes.type(HaRequestTypes.Type.CREATE_RELATIONSHIP_TYPE), context, serializer, deserializer);
}
use of org.neo4j.com.RequestContext in project neo4j by neo4j.
the class MasterClient214 method createLabel.
@Override
public Response<Integer> createLabel(RequestContext context, final String name) {
Serializer serializer = buffer -> writeString(buffer, name);
Deserializer<Integer> deserializer = (buffer, temporaryBuffer) -> buffer.readInt();
return sendRequest(requestTypes.type(HaRequestTypes.Type.CREATE_LABEL), context, serializer, deserializer);
}
Aggregations