Exemplo n.º 1
0
 private void addPropertyMetadataItemToMutation(
     Mutation m, Property property, Metadata.Entry metadataItem) {
   Text columnQualifier = getPropertyMetadataColumnQualifierText(property, metadataItem);
   ColumnVisibility metadataVisibility =
       visibilityToAccumuloVisibility(metadataItem.getVisibility());
   if (metadataItem.getValue() == null) {
     addPropertyMetadataItemDeleteToMutation(m, columnQualifier, metadataVisibility);
   } else {
     addPropertyMetadataItemAddToMutation(
         m, columnQualifier, metadataVisibility, property.getTimestamp(), metadataItem.getValue());
   }
 }
Exemplo n.º 2
0
 public void addPropertyDeleteMetadataToMutation(
     Mutation m, PropertyDeleteMutation propertyDeleteMutation) {
   if (propertyDeleteMutation instanceof PropertyPropertyDeleteMutation) {
     Property property = ((PropertyPropertyDeleteMutation) propertyDeleteMutation).getProperty();
     Metadata metadata = property.getMetadata();
     for (Metadata.Entry metadataItem : metadata.entrySet()) {
       Text columnQualifier = getPropertyMetadataColumnQualifierText(property, metadataItem);
       ColumnVisibility metadataVisibility =
           visibilityToAccumuloVisibility(metadataItem.getVisibility());
       addPropertyMetadataItemDeleteToMutation(m, columnQualifier, metadataVisibility);
     }
   }
 }
Exemplo n.º 3
0
 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);
     ColumnVisibility metadataEntryVisibility =
         visibilityToAccumuloVisibility(metadataEntry.getVisibility());
     addPropertyMetadataItemDeleteToMutation(
         m, metadataEntryColumnQualifier, metadataEntryVisibility);
   }
 }
Exemplo n.º 4
0
 private void addPropertyMetadataItemToKeyValuePairs(
     List<KeyValuePair> results,
     Text vertexRowKey,
     Property property,
     Metadata.Entry metadataItem) {
   Text columnQualifier = getPropertyMetadataColumnQualifierText(property, metadataItem);
   ColumnVisibility metadataVisibility =
       visibilityToAccumuloVisibility(metadataItem.getVisibility());
   if (metadataItem.getValue() == null) {
     throw new VertexiumException("Property metadata deletes are not supported");
   } else {
     addPropertyMetadataItemAddToKeyValuePairs(
         results,
         vertexRowKey,
         columnQualifier,
         metadataVisibility,
         property.getTimestamp(),
         metadataItem.getValue());
   }
 }