public override Response <LockResult> Call(Master master, RequestContext context, ChannelBuffer input, ChannelBuffer target) { ResourceType type = ResourceTypes.fromId(input.readInt()); long[] ids = new long[input.readInt()]; for (int i = 0; i < ids.Length; i++) { ids[i] = input.readLong(); } return(Lock(master, context, type, ids)); }
private static IdAllocation ReadIdAllocation(ChannelBuffer buffer) { int numberOfDefragIds = buffer.readInt(); long[] defragIds = new long[numberOfDefragIds]; for (int i = 0; i < numberOfDefragIds; i++) { defragIds[i] = buffer.readLong(); } long rangeStart = buffer.readLong(); int rangeLength = buffer.readInt(); long highId = buffer.readLong(); long defragCount = buffer.readLong(); return(new IdAllocation(new IdRange(defragIds, rangeStart, rangeLength), highId, defragCount)); }