use of com.baidu.hugegraph.HugeGraphParams in project incubator-hugegraph by apache.
the class DeleteExpiredIndexJob method execute.
@Override
public V execute() throws Exception {
LOG.debug("Delete expired indexes: {}", this.indexes);
HugeGraphParams graph = this.params();
GraphTransaction tx = graph.graphTransaction();
try {
for (HugeIndex index : this.indexes) {
this.deleteExpiredIndex(graph, index);
}
tx.commit();
} catch (Throwable e) {
tx.rollback();
LOG.warn("Failed to delete expired indexes: {}", this.indexes);
throw e;
} finally {
JOB_COUNTERS.jobCounter(graph.graph()).decrement();
}
return null;
}
use of com.baidu.hugegraph.HugeGraphParams in project incubator-hugegraph by apache.
the class DeleteExpiredElementJob method execute.
@Override
public V execute() throws Exception {
LOG.debug("Delete expired elements: {}", this.elements);
HugeGraphParams graph = this.params();
GraphTransaction tx = graph.graphTransaction();
try {
for (HugeElement element : this.elements) {
element.remove();
}
tx.commit();
} catch (Exception e) {
tx.rollback();
LOG.warn("Failed to delete expired elements: {}", this.elements);
throw e;
} finally {
JOB_COUNTERS.jobCounter(graph.graph()).decrement();
}
return null;
}
Aggregations