public void RPC_setActiveState(Request req) { try { addResult(provider.setActiveState(getBucket(req, 0), BucketInfo.ActiveState.values()[req.parameters().get(2).asInt8()]), req); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }
public void RPC_maintain(Request req) { addResult(provider.maintain(getBucket(req, 0), PersistenceProvider.MaintenanceLevel.values()[req.parameters().get(2).asInt8()]), req); }
getFieldSet(req, 2), selection, PersistenceProvider.IncludedVersions.values()[req.parameters().get(7).asInt8()]);
protected Params toParams(Values args) { Params p = new Params(); p.version = new Version(args.get(0).asUtf8Array()); p.route = args.get(1).asString(); p.session = args.get(2).asString(); p.retryEnabled = (args.get(3).asInt8() != 0); p.retry = args.get(4).asInt32(); p.timeRemaining = args.get(5).asInt64(); p.protocolName = args.get(6).asUtf8Array(); p.payload = args.get(7).asData(); p.traceLevel = args.get(8).asInt32(); return p; }
@Override public void handleRequestDone(Request requestWithResponse) { if (requestWithResponse.isError()) { handler.receive(GetDocsumsResponseOrError.fromError("Error response from " + node + ": " + requestWithResponse.errorMessage())); return; } Values returnValues = requestWithResponse.returnValues(); if (returnValues.size() < 3) { handler.receive(GetDocsumsResponseOrError.fromError("Invalid getDocsums response from " + node + ": Expected 3 return arguments, got " + returnValues.size())); return; } byte compression = returnValues.get(0).asInt8(); int uncompressedSize = returnValues.get(1).asInt32(); byte[] compressedSlimeBytes = returnValues.get(2).asData(); List<FastHit> hits = (List<FastHit>) requestWithResponse.getContext(); handler.receive(GetDocsumsResponseOrError.fromResponse(new GetDocsumsResponse(compression, uncompressedSize, compressedSlimeBytes, hits))); }
protected Params toParams(Values args) { CompressionType compression = CompressionType.valueOf(args.get(3).asInt8()); byte[] slimeBytes = compressor.decompress(args.get(5).asData(), compression, args.get(4).asInt32()); Slime slime = BinaryFormat.decode(slimeBytes); Inspector root = slime.get(); Params p = new Params(); p.version = new Version(root.field(VERSION_F).asString()); p.route = root.field(ROUTE_F).asString(); p.session = root.field(SESSION_F).asString(); p.retryEnabled = root.field(USERETRY_F).asBool(); p.retry = (int)root.field(RETRY_F).asLong(); p.timeRemaining = root.field(TIMEREMAINING_F).asLong(); p.protocolName = new Utf8Array(Utf8.toBytes(root.field(PROTOCOL_F).asString())); p.payload = root.field(BLOB_F).asData(); p.traceLevel = (int)root.field(TRACELEVEL_F).asLong(); return p; }
@Override protected Reply createReply(Values ret, String serviceName, Trace trace) { CompressionType compression = CompressionType.valueOf(ret.get(3).asInt8()); byte[] slimeBytes = compressor.decompress(ret.get(5).asData(), compression, ret.get(4).asInt32()); Slime slime = BinaryFormat.decode(slimeBytes);