/** Write the cursor state to the map in cassandra */
  private void writeCursorState(final String jobId, final EdgeScope edge) {

    final JsonNode node =
        EdgeScopeSerializer.INSTANCE.toNode(CursorSerializerUtil.getMapper(), edge);

    final String serializedState = CursorSerializerUtil.asString(node);

    mapManager.putString(jobId + MAP_CURSOR_KEY, serializedState, INDEX_TTL);
  }
  /** Swap our cursor for an optional edgescope */
  private Optional<EdgeScope> parseCursor(final Optional<String> cursor) {

    if (!cursor.isPresent()) {
      return Optional.absent();
    }

    // get our cursor
    final String persistedCursor = mapManager.getString(cursor.get());

    if (persistedCursor == null) {
      return Optional.absent();
    }

    final JsonNode node = CursorSerializerUtil.fromString(persistedCursor);

    final EdgeScope edgeScope =
        EdgeScopeSerializer.INSTANCE.fromJsonNode(node, CursorSerializerUtil.getMapper());

    return Optional.of(edgeScope);
  }