public DeletePropertyEvent(Graph graph, Element element, Property property) { super(graph); this.element = element; this.key = property.getKey(); this.name = property.getName(); this.visibility = property.getVisibility(); }
@Override protected Object convert(Property o) { return o.getValue(); } };
private String getMimeType(Property property) { String mimeType = VisalloProperties.MIME_TYPE_METADATA.getMetadataValue(property.getMetadata(), null); if (mimeType != null) { return mimeType; } return null; }
private String createHdfsFileName(String rowKey, Property property) throws IOException { String fileName = HdfsLargeDataStore.encodeFileName(property.getName() + "_" + property.getKey() + "_" + property.getTimestamp()); return rowKey + "/" + fileName; }
private void writePropertyRdfTriples(Element element, Property property, OutputStream out) throws IOException { SetPropertyVisalloRdfTriple setPropertyVisalloRdfTriple = new SetPropertyVisalloRdfTriple( element instanceof Vertex ? ElementType.VERTEX : ElementType.EDGE, element.getId(), getVisibilitySource(element), property.getKey(), property.getName(), getVisibilitySource(property), property.getValue()); write(setPropertyVisalloRdfTriple, out); if (setPropertyVisalloRdfTriple.getValueRdfString() != null) { for (Metadata.Entry entry : property.getMetadata().entrySet()) { writeMetadataEntryRdfTriple(element, property, entry, out); } } }
public void addPropertyToMutation(AccumuloGraph graph, Mutation m, String rowKey, Property property) { Text columnQualifier = KeyHelper.getColumnQualifierFromPropertyColumnQualifier(property, getNameSubstitutionStrategy()); ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(property.getVisibility()); Object propertyValue = transformValue(property.getValue(), rowKey, property); // graph can be null if this is running in Map Reduce. We can just assume the property is already defined. if (graph != null) { graph.ensurePropertyDefined(property.getName(), propertyValue); } Value value = new Value(vertexiumSerializer.objectToBytes(propertyValue)); m.put(AccumuloElement.CF_PROPERTY, columnQualifier, columnVisibility, property.getTimestamp(), value); addPropertyMetadataToMutation(m, property); }
public IndexInfo addPropertiesToIndex(Graph graph, Element element, Iterable<Property> properties) { try { String indexName = getIndexName(element); IndexInfo indexInfo = ensureIndexCreatedAndInitialized(indexName); for (Property property : properties) { addPropertyToIndex(graph, indexInfo, property.getName(), property.getValue(), property.getVisibility()); } return indexInfo; } catch (IOException e) { throw new VertexiumException("Could not add properties to index", e); } }
private void addPropertyToKeyValuePairs(List<KeyValuePair> results, Text elementRowKey, Property property) { Text columnQualifier = KeyHelper.getColumnQualifierFromPropertyColumnQualifier(property, getNameSubstitutionStrategy()); ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(property.getVisibility()); Object propertyValue = property.getValue(); Value value = new Value(vertexiumSerializer.objectToBytes(transformValue(propertyValue, null, null))); results.add(new KeyValuePair(new Key(elementRowKey, AccumuloElement.CF_PROPERTY, columnQualifier, columnVisibility, property.getTimestamp()), value)); addPropertyMetadataToKeyValuePairs(results, elementRowKey, property); }
@Override public boolean isHandled(Element element, Property property) { if (property == null) { return false; } if (property.getName().equals(VisalloProperties.RAW.getPropertyName())) { return false; } String mimeType = VisalloProperties.MIME_TYPE_METADATA.getMetadataValue(property.getMetadata(), null); return !(mimeType == null || !mimeType.startsWith("text")); } }
public void addPropertyToIndexInner(Graph graph, IndexInfo indexInfo, Property property) throws IOException { String deflatedPropertyName = addVisibilityToPropertyName(graph, property); Object propertyValue = property.getValue(); Visibility propertyVisibility = property.getVisibility(); addPropertyToIndexInner(graph, indexInfo, deflatedPropertyName, propertyValue, propertyVisibility); }
protected String deflatePropertyName(Graph graph, Property property) { String propertyName = property.getName(); Visibility propertyVisibility = property.getVisibility(); return deflatePropertyName(graph, propertyName, propertyVisibility); }
private JSONObject getProductDataJson(Vertex productVertex) { JSONObject data = new JSONObject(); Iterable<Property> dataProperties = WorkspaceProperties.PRODUCT_DATA.getProperties(productVertex); for (Property dataProperty : dataProperties) { data.put(dataProperty.getKey(), dataProperty.getValue()); } return data; }
public void update(Property property) { if (property.getHiddenVisibilities() != null) { for (Visibility v : property.getHiddenVisibilities()) { addHiddenVisibility(v); } } setValue(property.getValue()); setTimestamp(property.getTimestamp()); updateMetadata(property); } }
public void addPropertyDeleteToMutation(Mutation m, Property property) { Preconditions.checkNotNull(m, "mutation cannot be null"); Preconditions.checkNotNull(property, "property cannot be null"); Text columnQualifier = KeyHelper.getColumnQualifierFromPropertyColumnQualifier(property, getNameSubstitutionStrategy()); ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(property.getVisibility()); m.putDelete(AccumuloElement.CF_PROPERTY, columnQualifier, columnVisibility, currentTimeMillis()); for (Metadata.Entry metadataEntry : property.getMetadata().entrySet()) { Text metadataEntryColumnQualifier = getPropertyMetadataColumnQualifierText(property, metadataEntry.getKey()); ColumnVisibility metadataEntryVisibility = visibilityToAccumuloVisibility(metadataEntry.getVisibility()); addPropertyMetadataItemDeleteToMutation(m, metadataEntryColumnQualifier, metadataEntryVisibility); } }
public static VideoFrameInfo getVideoFrameInfoFromProperty(Property property) { String mimeType = VisalloProperties.MIME_TYPE_METADATA.getMetadataValueOrDefault(property.getMetadata(), null); if (mimeType == null || !mimeType.equals("text/plain")) { return null; } return getVideoFrameInfo(property.getKey()); }
boolean isHandled(Element element, Property property) { for (TextExtractMapping textExtractMapping : this.textExtractMappings.values()) { if (textExtractMapping.rawPropertyName.equals(property.getName())) { return true; } } return false; }
@Override public long getTimestamp() { return property.getTimestamp(); }
public void hideProperty( List<VisalloPropertyUpdate> changedPropertiesOut, Element element, Property propertyToHide, String workspaceId, Authorizations authorizations ) { long beforeDeletionTimestamp = System.currentTimeMillis() - 1; element.markPropertyHidden(propertyToHide, new Visibility(workspaceId), authorizations); changedPropertiesOut.add(new VisalloPropertyUpdateRemove(this, propertyToHide.getKey(), beforeDeletionTimestamp, false, true)); }