@Override public DocumentUpdate getOutput() { Document doc = adapter.getFullOutput(); DocumentUpdate upd = new DocumentUpdate(doc.getDataType(), doc.getId()); createUpdatesAt(new ArrayList<>(), adapter.getUpdatableOutput(), 0, upd); return upd; }
@Override public DocumentUpdate getOutput() { Document doc = fwdAdapter.getFullOutput(); DocumentUpdate upd = new DocumentUpdate(doc.getDataType(), doc.getId()); upd.addFieldPathUpdate(update); return upd; }
@Override public DocumentUpdate getOutput() { Document doc = adapter.getUpdatableOutput(); DocumentUpdate upd = new DocumentUpdate(doc.getDataType(), doc.getId()); for (Iterator<Map.Entry<Field, FieldValue>> it = doc.iterator(); it.hasNext();) { Map.Entry<Field, FieldValue> entry = it.next(); Field field = entry.getKey(); if (field.getName().equals("sddocname")) { continue; } FieldUpdate fieldUpd = FieldUpdate.create(field); fieldUpd.addValueUpdates(builder.build(entry.getValue())); if (!fieldUpd.isEmpty()) { upd.addFieldUpdate(fieldUpd); } } return upd.isEmpty() ? null : upd; }
protected void decodeInto(UpdateDocumentMessage msg, DocumentDeserializer buf) { msg.setDocumentUpdate(new DocumentUpdate(buf)); msg.setOldTimestamp(buf.getLong(null)); msg.setNewTimestamp(buf.getLong(null)); decodeTasCondition(msg, buf); }
public void RPC_update(Request req) { try { GrowableByteBuffer buffer = new GrowableByteBuffer(ByteBuffer.wrap(req.parameters().get(3).asData())); DocumentUpdate update = new DocumentUpdate(DocumentDeserializerFactory.createHead(docTypeManager, buffer)); UpdateResult result = provider.update(getBucket(req, 0), req.parameters().get(2).asInt64(), update); addResult(result, req); req.returnValues().add(new Int64Value(result.getExistingTimestamp())); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }
break; case UPDATE: documentOperation = new DocumentUpdate(documentType, documentParseInfo.documentId); readUpdate(documentParseInfo.fieldsBuffer, (DocumentUpdate) documentOperation); verifyEndState(documentParseInfo.fieldsBuffer, JsonToken.END_OBJECT);
} else if ("update".equals(startTag)) { VespaXMLUpdateReader updateReader = new VespaXMLUpdateReader(reader, docTypeManager); DocumentUpdate update = new DocumentUpdate(updateReader); operation.setDocumentUpdate(update); operation.setCondition(TestAndSetCondition.fromConditionString(updateReader.getCondition()));
DocumentUpdate update = new DocumentUpdate(docType, doc1.getId()); FieldUpdate fieldUpdate = FieldUpdate.create(docType.getField("headerval")); fieldUpdate.addValueUpdate(AssignValueUpdate.createAssign(new IntegerFieldValue(42)));