private void checkForSharedSourceCommand(AccessNode aNode) {
    // create a top level key to avoid the full command toString
    String modelName = aNode.getModelName();
    Command cmd = aNode.getCommand();

    // don't share full scans against internal sources, it's a waste of buffering
    if (CoreConstants.SYSTEM_MODEL.equals(modelName)
        || CoreConstants.SYSTEM_ADMIN_MODEL.equals(modelName)
        || TempMetadataAdapter.TEMP_MODEL.getName().equals(modelName)) {
      if (!(cmd instanceof Query)) {
        return;
      }
      Query query = (Query) cmd;
      if (query.getOrderBy() == null && query.getCriteria() == null) {
        return;
      }
    }

    AccessNode other = sharedCommands.get(cmd);
    if (other == null) {
      sharedCommands.put(cmd, aNode);
    } else {
      if (other.info == null) {
        other.info = new RegisterRequestParameter.SharedAccessInfo();
        other.info.id = sharedId.getAndIncrement();
      }
      other.info.sharingCount++;
      aNode.info = other.info;
    }
  }