Exemplo n.º 1
0
 private void deleteIndexEntry(TitanProperty prop, StoreMutator mutator) throws StorageException {
   TitanKey pt = prop.getPropertyKey();
   assert pt.isSimple();
   if (pt.hasIndex()) {
     if (pt.isUnique()) {
       mutator.mutateIndex(
           getIndexKey(prop.getAttribute()),
           null,
           Lists.newArrayList(getKeyedIndexColumn(prop.getPropertyKey())));
     } else {
       mutator.mutateIndex(
           getIndexKey(prop.getAttribute()),
           null,
           Lists.newArrayList(getIndexColumn(prop.getPropertyKey(), prop.getID())));
     }
   }
 }
Exemplo n.º 2
0
 private void lockKeyedProperty(TitanProperty prop, StoreMutator mutator) throws StorageException {
   TitanKey pt = prop.getPropertyKey();
   assert pt.isSimple();
   if (pt.hasIndex() && pt.isUnique()) {
     if (prop.isNew()) {
       mutator.acquireIndexLock(getIndexKey(prop.getAttribute()), getKeyedIndexColumn(pt), null);
     } else {
       assert prop.isRemoved();
       mutator.acquireIndexLock(
           getIndexKey(prop.getAttribute()), getKeyedIndexColumn(pt), getIndexValue(prop));
     }
   }
 }