@Override public Record toRequestRecord() { return new SetDataRequest(getPath(), data, version); }
@Override public Record toRequestRecord() { return new SetDataRequest(getPath(), data, version); }
/** Verify jute - which we've had particular problems with in the past * wrt null fields */ @Test public void testJuteToString() { SetDataRequest req = new SetDataRequest(null, null, 0); Assert.assertNotSame("ERROR", req.toString()); } }
OpCode.getData, 0x0, 0); Request writeReq = newRequest( new SetDataRequest(path, new byte[16], -1), OpCode.setData, 0x0, 1);
/** * The asynchronous version of setData. * * @see #setData(String, byte[], int) */ public void setData(final String path, byte data[], int version, StatCallback cb, Object ctx) { final String clientPath = path; PathUtils.validatePath(clientPath); final String serverPath = prependChroot(clientPath); RequestHeader h = new RequestHeader(); h.setType(ZooDefs.OpCode.setData); SetDataRequest request = new SetDataRequest(); request.setPath(serverPath); request.setData(data); request.setVersion(version); SetDataResponse response = new SetDataResponse(); cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, clientPath, serverPath, ctx, null); }
/** * It tests that PrepRequestProcessor will return BadArgument KeeperException * if the request path (if it exists) is not valid, e.g. empty string. */ @Test public void testInvalidPath() throws Exception { pLatch = new CountDownLatch(1); processor = new PrepRequestProcessor(zks, new MyRequestProcessor()); SetDataRequest record = new SetDataRequest("", new byte[0], -1); Request req = createRequest(record, OpCode.setData); processor.pRequest(req); pLatch.await(); Assert.assertEquals(outcome.getHdr().getType(), OpCode.error); Assert.assertEquals(outcome.getException().code(), KeeperException.Code.BADARGUMENTS); }
/** * The asynchronous version of setData. * * @see #setData(String, byte[], int) */ public void setData(final String path, byte data[], int version, StatCallback cb, Object ctx) { final String clientPath = path; PathUtils.validatePath(clientPath); final String serverPath = prependChroot(clientPath); RequestHeader h = new RequestHeader(); h.setType(ZooDefs.OpCode.setData); SetDataRequest request = new SetDataRequest(); request.setPath(serverPath); request.setData(data); request.setVersion(version); SetDataResponse response = new SetDataResponse(); cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, clientPath, serverPath, ctx, null); }
break; case OpCode.setData: SetDataRequest setDataRequest = new SetDataRequest(); pRequest2Txn(request.type, zks.getNextZxid(), request, setDataRequest, true); break;
break; case OpCode.setData: SetDataRequest setDataRequest = new SetDataRequest(); pRequest2Txn(request.type, zks.getNextZxid(), request, setDataRequest, true); break;
SetDataRequest request = new SetDataRequest(); request.setPath(serverPath); request.setData(data);
SetDataRequest request = new SetDataRequest(); request.setPath(serverPath); request.setData(data);
break; case ZooDefs.OpCode.setData: SetDataRequest sdr = new SetDataRequest(); sdr.deserialize(archive, tag); add(Op.setData(sdr.getPath(), sdr.getData(), sdr.getVersion()));
break; case ZooDefs.OpCode.setData: SetDataRequest sdr = new SetDataRequest(); sdr.deserialize(archive, tag); add(Op.setData(sdr.getPath(), sdr.getData(), sdr.getVersion()));
/** * The Asynchronous version of setData. The request doesn't actually until * the asynchronous callback is called. * * @see #setData(String, byte[], int) */ public void setData(final String path, byte data[], int version, StatCallback cb, Object ctx) { final String clientPath = path; PathUtils.validatePath(clientPath); final String serverPath = prependChroot(clientPath); RequestHeader h = new RequestHeader(); h.setType(ZooDefs.OpCode.setData); SetDataRequest request = new SetDataRequest(); request.setPath(serverPath); request.setData(data); request.setVersion(version); SetDataResponse response = new SetDataResponse(); cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, clientPath, serverPath, ctx, null); }
.getNextZxid(), zks.getTime(), OpCode.setData); zks.sessionTracker.checkSession(request.sessionId, request.getOwner()); SetDataRequest setDataRequest = new SetDataRequest(); ZooKeeperServer.byteBuffer2Record(request.request, setDataRequest);
SetDataRequest request = new SetDataRequest(); request.setPath(serverPath); request.setData(data);