private boolean release(Document<T> md, String stage) { return io.markTouched(md.getID(), stage); }
private boolean release(Document<T> md, String stage) { return io.markTouched(md.getID(), stage); }
protected static void printInsertOk(HttpResponse response, Document<?> d) { logger.debug("Successfully inserted a document with ID: " + d.getID()); response.setStatusCode(HttpStatus.SC_OK); setStringEntity(response, d.contentFieldsToJson(null)); }
protected static void printDocument(HttpResponse response, Document<?> d, String stage) { logger.debug("Printing document with ID " + d.getID() + " to stage " + stage); response.setStatusCode(HttpStatus.SC_OK); setStringEntity(response, d.toJson()); }
@Override public void putAll(Document<?> d) { if(d.getID() != null) { documentMap.put(ID_KEY, d.getID().getID()); } if(d.getAction()!=null) { documentMap.put(ACTION_KEY, d.getAction()); } for(Map.Entry<String, Object> e : d.getMetadataMap().entrySet()) { putMetadataField(e.getKey(), e.getValue()); } for(String s : d.getContentFields()) { putContentField(s, d.getContentField(s)); } }
if(d.getID() == null) { else if(d.getID() instanceof MongoDocumentID) { documentMap.put(MONGO_ID_KEY, d.getID().getID()); } else { try { ObjectId id = MongoDocumentID.getObjectId(d.getID().toJSON()); documentMap.put(MONGO_ID_KEY, id); } catch (JsonException e) { logger.error("Unable to convert ID of type "+d.getID().getClass()+ " to MongoDucumentID", e); return;
Object id = d != null ? d.getID() : null; logger.info(String.format("type=performance event=query stage_name=%s doc_id=\"%s\" start=%d end=%d total=%d entitystring=%d parse=%d query=%d serialize=%d", stage, id, start, serialize, serialize-start, tostring-start, parse-tostring, query-parse, serialize-query));
@Override public boolean isEqual(Document<?> d) { if(d.getID()!=null) { if(!d.getID().getID().equals(getID().getID())) { return false; } } else { if(getID()!=null) { return false; } } if(d.getAction()!=getAction()) { return false; } if(equalMetadata(d) && equalContent(d)) { return true; } return false; }