mirror of
https://github.com/JHUAPL/AccumuloGraph.git
synced 2026-01-09 20:57:55 -05:00
Move remote property from index functionality to IndexTableWrapper
This commit is contained in:
@@ -118,7 +118,7 @@ public abstract class AccumuloElement implements Element {
|
||||
globals.getElementWrapper(type).clearProperty(this, key);
|
||||
globals.checkedFlush();
|
||||
}
|
||||
globals.getGraph().removePropertyFromIndex(type, this, key, value);
|
||||
globals.getIndexWrapper(type).removePropertyFromIndex(this, key, value);
|
||||
// MDL 31 Dec 2014: AccumuloGraph.removeProperty
|
||||
// calls getProperty which populates the cache.
|
||||
// So the order here is important (for now).
|
||||
|
||||
@@ -694,29 +694,6 @@ public class AccumuloGraph implements Graph, KeyIndexableGraph, IndexableGraph {
|
||||
return getVertexIndexWriter();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Move to appropriate place
|
||||
* @param type
|
||||
* @param element
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
void removePropertyFromIndex(Class<? extends Element> type, Element element,
|
||||
String key, Object obj) {
|
||||
try {
|
||||
if (obj != null) {
|
||||
byte[] val = AccumuloByteSerializer.serialize(obj);
|
||||
Mutation m = new Mutation(val);
|
||||
m.putDelete(key, element.getId().toString());
|
||||
getIndexBatchWriter(type).addMutation(m);
|
||||
globals.checkedFlush();
|
||||
}
|
||||
} catch (MutationsRejectedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
private void nullCheckProperty(String key, Object val) {
|
||||
if (key == null) {
|
||||
|
||||
@@ -61,4 +61,17 @@ public abstract class IndexTableWrapper extends BaseTableWrapper {
|
||||
globals.checkedFlush();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove property from the index.
|
||||
* @param element
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
public void removePropertyFromIndex(Element element, String key, Object value) {
|
||||
if (value != null) {
|
||||
Mutators.apply(getWriter(), new IndexValueMutator.Delete(element, key, value));
|
||||
globals.checkedFlush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user