private <T extends VertexiumObject> List<T> sortVertexiumObjectsByResultOrder(Iterable<T> vertexiumObjects, List<String> ids) { ImmutableMap<String, T> itemMap = Maps.uniqueIndex(vertexiumObjects, vertexiumObject -> { if (vertexiumObject instanceof Element) { return ((Element) vertexiumObject).getId(); } else if (vertexiumObject instanceof ExtendedDataRow) { return ((ExtendedDataRow) vertexiumObject).getId().toString(); } else { throw new VertexiumException("Unhandled searchable item type: " + vertexiumObject.getClass().getName()); } }); List<T> results = new ArrayList<>(); for (String id : ids) { T item = itemMap.get(id); if (item != null) { results.add(item); } } return results; }
private <T extends VertexiumObject> List<T> sortVertexiumObjectsByResultOrder(Iterable<T> vertexiumObjects, List<String> ids) { ImmutableMap<String, T> itemMap = Maps.uniqueIndex(vertexiumObjects, vertexiumObject -> { if (vertexiumObject instanceof Element) { return ((Element) vertexiumObject).getId(); } else if (vertexiumObject instanceof ExtendedDataRow) { return ((ExtendedDataRow) vertexiumObject).getId().toString(); } else { throw new VertexiumException("Unhandled searchable item type: " + vertexiumObject.getClass().getName()); } }); List<T> results = new ArrayList<>(); for (String id : ids) { T item = itemMap.get(id); if (item != null) { results.add(item); } } return results; }
case EDGE_EXTENDED_DATA: ExtendedDataRowId extendedDataRowId = idStrategy.extendedDataRowIdFromSearchHit(hit); ids.add(extendedDataRowId.toString()); extendedDataIds.add(extendedDataRowId); break;
case EDGE_EXTENDED_DATA: ExtendedDataRowId extendedDataRowId = idStrategy.extendedDataRowIdFromSearchHit(hit); ids.add(extendedDataRowId.toString()); extendedDataIds.add(extendedDataRowId); break;
@Override public void deleteExtendedDataRow(ExtendedDataRowId rowId, Authorizations authorizations) { checkNotNull(rowId); Span trace = Trace.start("deleteExtendedDataRow"); trace.data("rowId", rowId.toString()); try { getSearchIndex().deleteExtendedData(this, rowId, authorizations); addMutations(VertexiumObjectType.EXTENDED_DATA, getDeleteExtendedDataMutations(rowId)); if (hasEventListeners()) { queueEvent(new DeleteExtendedDataRowEvent(this, rowId)); } } finally { trace.stop(); } }
@Override public void deleteExtendedDataRow(ExtendedDataRowId rowId, Authorizations authorizations) { checkNotNull(rowId); Span trace = Trace.start("deleteExtendedDataRow"); trace.data("rowId", rowId.toString()); try { getSearchIndex().deleteExtendedData(this, rowId, authorizations); addMutations(VertexiumObjectType.EXTENDED_DATA, getDeleteExtendedDataMutations(rowId)); if (hasEventListeners()) { queueEvent(new DeleteExtendedDataRowEvent(this, rowId)); } } finally { trace.stop(); } }