Example #1
0
 /** Append the id to the string */
 private static final void idString(final StringBuilder builder, final String type, final Id id) {
   builder
       .append(type)
       .append("(")
       .append(id.getUuid())
       .append(ID_SEPERATOR)
       .append(id.getType().toLowerCase())
       .append(")");
 }
  /**
   * 4. Delete all entity documents out of elasticsearch. 5. Compact Graph so that it deletes the
   * marked values. 6. Delete entity from cassandra using the map manager.
   */
  private Id deleteAsync(MapManager mapManager, ApplicationScope applicationScope, Id entityId) {
    try {
      // Step 4 && 5

      if (!skipIndexingForType(entityId.getType(), applicationScope)) {

        asyncEventService.queueEntityDelete(applicationScope, entityId);
      }
      // Step 6
      // delete from our UUID index
      mapManager.delete(entityId.getUuid().toString());
      return entityId;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }