private ExtendedDataRowId createExtendedDataRowId(Row row) { return new ExtendedDataRowId(elementType, elementId, tableName, row.rowId); }
public static ExtendedDataRowId parseExtendedDataRowId(String accumuloRow) { ElementType elementType = extendedDataRowIdElementTypePrefixToElementType(accumuloRow.charAt(0)); String[] parts = accumuloRow.substring(1).split("" + KeyBase.VALUE_SEPARATOR); if (parts.length != 3) { throw new VertexiumException("Invalid Accumulo row key found for extended data, expected 3 parts found " + parts.length + ": " + accumuloRow); } return new ExtendedDataRowId(elementType, parts[0], parts[1], parts[2]); }
public static ExtendedDataRowId parseExtendedDataRowId(String accumuloRow) { ElementType elementType = extendedDataRowIdElementTypePrefixToElementType(accumuloRow.charAt(0)); String[] parts = accumuloRow.substring(1).split("" + KeyBase.VALUE_SEPARATOR); if (parts.length != 3) { throw new VertexiumException("Invalid Accumulo row key found for extended data, expected 3 parts found " + parts.length + ": " + accumuloRow); } return new ExtendedDataRowId(elementType, parts[0], parts[1], parts[2]); }
protected static void handleExtendedDataRow( Graph graph, Elasticsearch5SearchIndex elasticsearch5SearchIndex, FlushObjectQueue.FlushObject flushObject, Authorizations authorizations ) { ExtendedDataRowId id = new ExtendedDataRowId( flushObject.getElementType(), flushObject.getElementId(), flushObject.getExtendedDataTableName(), flushObject.getExtendedDataRowId() ); ExtendedDataRow row = graph.getExtendedData(id, authorizations); elasticsearch5SearchIndex.addExtendedData(graph, Collections.singletonList(row), authorizations); } }
protected static void handleExtendedDataRow( Graph graph, Elasticsearch5SearchIndex elasticsearch5SearchIndex, FlushObjectQueue.FlushObject flushObject, Authorizations authorizations ) { ExtendedDataRowId id = new ExtendedDataRowId( flushObject.getElementType(), flushObject.getElementId(), flushObject.getExtendedDataTableName(), flushObject.getExtendedDataRowId() ); ExtendedDataRow row = graph.getExtendedData(id, authorizations); elasticsearch5SearchIndex.addExtendedData(graph, Collections.singletonList(row), authorizations); } }
protected void extendedData(ExtendedDataMutation extendedData, Authorizations authorizations) { ExtendedDataRowId extendedDataRowId = new ExtendedDataRowId( ElementType.getTypeFromElement(this), getId(), extendedData.getTableName(), extendedData.getRow() ); getGraph().extendedData(this, extendedDataRowId, extendedData, authorizations); }
public ExtendedDataRowId extendedDataRowIdFromSearchHit(SearchHit hit) { SearchHitField elementTypeField = hit.getFields().get(Elasticsearch5SearchIndex.ELEMENT_TYPE_FIELD_NAME); if (elementTypeField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch5SearchIndex.ELEMENT_TYPE_FIELD_NAME); } ElementType elementType = ElasticsearchDocumentType.parse(elementTypeField.getValue().toString()).toElementType(); SearchHitField elementIdField = hit.getFields().get(Elasticsearch5SearchIndex.ELEMENT_ID_FIELD_NAME); if (elementIdField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch5SearchIndex.ELEMENT_ID_FIELD_NAME); } String elementId = elementIdField.getValue(); SearchHitField tableNameField = hit.getFields().get(Elasticsearch5SearchIndex.EXTENDED_DATA_TABLE_NAME_FIELD_NAME); if (tableNameField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch5SearchIndex.EXTENDED_DATA_TABLE_NAME_FIELD_NAME); } String tableName = tableNameField.getValue(); SearchHitField rowIdField = hit.getFields().get(Elasticsearch5SearchIndex.EXTENDED_DATA_TABLE_ROW_ID_FIELD_NAME); if (rowIdField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch5SearchIndex.EXTENDED_DATA_TABLE_ROW_ID_FIELD_NAME); } String rowId = rowIdField.getValue(); return new ExtendedDataRowId(elementType, elementId, tableName, rowId); }
public ExtendedDataRowId extendedDataRowIdFromSearchHit(SearchHit hit) { SearchHitField elementTypeField = hit.getFields().get(Elasticsearch5SearchIndex.ELEMENT_TYPE_FIELD_NAME); if (elementTypeField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch5SearchIndex.ELEMENT_TYPE_FIELD_NAME); } ElementType elementType = ElasticsearchDocumentType.parse(elementTypeField.getValue().toString()).toElementType(); SearchHitField elementIdField = hit.getFields().get(Elasticsearch5SearchIndex.ELEMENT_ID_FIELD_NAME); if (elementIdField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch5SearchIndex.ELEMENT_ID_FIELD_NAME); } String elementId = elementIdField.getValue(); SearchHitField tableNameField = hit.getFields().get(Elasticsearch5SearchIndex.EXTENDED_DATA_TABLE_NAME_FIELD_NAME); if (tableNameField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch5SearchIndex.EXTENDED_DATA_TABLE_NAME_FIELD_NAME); } String tableName = tableNameField.getValue(); SearchHitField rowIdField = hit.getFields().get(Elasticsearch5SearchIndex.EXTENDED_DATA_TABLE_ROW_ID_FIELD_NAME); if (rowIdField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch5SearchIndex.EXTENDED_DATA_TABLE_ROW_ID_FIELD_NAME); } String rowId = rowIdField.getValue(); return new ExtendedDataRowId(elementType, elementId, tableName, rowId); }
public static ExtendedDataRowId fromSearchHit(SearchHit hit) { SearchHitField elementTypeField = hit.getFields().get(ElasticsearchSingleDocumentSearchIndex.ELEMENT_TYPE_FIELD_NAME); if (elementTypeField == null) { throw new VertexiumException("Could not find field: " + ElasticsearchSingleDocumentSearchIndex.ELEMENT_TYPE_FIELD_NAME); } ElementType elementType = ElasticsearchDocumentType.parse(elementTypeField.getValue().toString()).toElementType(); SearchHitField elementIdField = hit.getFields().get(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_ELEMENT_ID_FIELD_NAME); if (elementIdField == null) { throw new VertexiumException("Could not find field: " + ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_ELEMENT_ID_FIELD_NAME); } String elementId = elementIdField.getValue(); SearchHitField tableNameField = hit.getFields().get(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_TABLE_NAME_FIELD_NAME); if (tableNameField == null) { throw new VertexiumException("Could not find field: " + ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_TABLE_NAME_FIELD_NAME); } String tableName = tableNameField.getValue(); SearchHitField rowIdField = hit.getFields().get(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_TABLE_ROW_ID_FIELD_NAME); if (rowIdField == null) { throw new VertexiumException("Could not find field: " + ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_TABLE_ROW_ID_FIELD_NAME); } String rowId = rowIdField.getValue(); return new ExtendedDataRowId(elementType, elementId, tableName, rowId); } }
public static ExtendedDataRowId fromSearchHit(SearchHit hit) { SearchHitField elementTypeField = hit.getFields().get(Elasticsearch2SearchIndex.ELEMENT_TYPE_FIELD_NAME); if (elementTypeField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch2SearchIndex.ELEMENT_TYPE_FIELD_NAME); } ElementType elementType = ElasticsearchDocumentType.parse(elementTypeField.getValue().toString()).toElementType(); SearchHitField elementIdField = hit.getFields().get(Elasticsearch2SearchIndex.EXTENDED_DATA_ELEMENT_ID_FIELD_NAME); if (elementIdField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch2SearchIndex.EXTENDED_DATA_ELEMENT_ID_FIELD_NAME); } String elementId = elementIdField.getValue(); SearchHitField tableNameField = hit.getFields().get(Elasticsearch2SearchIndex.EXTENDED_DATA_TABLE_NAME_FIELD_NAME); if (tableNameField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch2SearchIndex.EXTENDED_DATA_TABLE_NAME_FIELD_NAME); } String tableName = tableNameField.getValue(); SearchHitField rowIdField = hit.getFields().get(Elasticsearch2SearchIndex.EXTENDED_DATA_TABLE_ROW_ID_FIELD_NAME); if (rowIdField == null) { throw new VertexiumException("Could not find field: " + Elasticsearch2SearchIndex.EXTENDED_DATA_TABLE_ROW_ID_FIELD_NAME); } String rowId = rowIdField.getValue(); return new ExtendedDataRowId(elementType, elementId, tableName, rowId); } }
public void deleteExtendedData( InMemoryElement element, String tableName, String row, String columnName, String key, Visibility visibility, Authorizations authorizations ) { extendedDataTable.removeColumn( new ExtendedDataRowId(ElementType.getTypeFromElement(element), element.getId(), tableName, row), columnName, key, visibility ); getSearchIndex().deleteExtendedData(this, element, tableName, row, columnName, key, visibility, authorizations); if (hasEventListeners()) { fireGraphEvent(new DeleteExtendedDataEvent(this, element, tableName, row, columnName, key)); } }
row = graph.getExtendedData(new ExtendedDataRowId(ElementType.VERTEX, "v1", "table1", "row1"), AUTHORIZATIONS_A); assertEquals("row1", row.getId().getRowId()); assertEquals(date1, row.getPropertyValue("date")); new ExtendedDataRowId(ElementType.VERTEX, "v1", "table1", "row1"), new ExtendedDataRowId(ElementType.VERTEX, "v1", "table1", "row2") ), AUTHORIZATIONS_A
row = graph.getExtendedData(new ExtendedDataRowId(ElementType.VERTEX, "v1", "table1", "row1"), AUTHORIZATIONS_A); assertEquals("row1", row.getId().getRowId()); assertEquals(date1, row.getPropertyValue("date")); new ExtendedDataRowId(ElementType.VERTEX, "v1", "table1", "row1"), new ExtendedDataRowId(ElementType.VERTEX, "v1", "table1", "row2") ), AUTHORIZATIONS_A