code: public static void populateExternalStreamsStatesFromSites(SystemProcedureExecutionContext context) {
          Database database = context.getDatabase();
          for (Table t : database.getTables()) {
              if (!CatalogUtil.isTableExportOnly(database, t))
                  continue;
  
              Map<Integer, Pair<Long,Long>> sequenceNumbers = s_exportSequenceNumbers.get(t.getTypeName());
              if (sequenceNumbers == null) {
                  sequenceNumbers = new HashMap<Integer, Pair<Long, Long>>();
                  s_exportSequenceNumbers.put(t.getTypeName(), sequenceNumbers);
              }
  
              long[] usoAndSequenceNumber =
                      context.getSiteProcedureConnection().getUSOForExportTable(t.getTypeName());
              sequenceNumbers.put(
                              context.getPartitionId(),
                              Pair.of(
                                  usoAndSequenceNumber[0],
                                  usoAndSequenceNumber[1]));
          }
          TupleStreamStateInfo drStateInfo = context.getSiteProcedureConnection().getDRTupleStreamStateInfo();
          s_drTupleStreamInfo.put(context.getPartitionId(), drStateInfo);
          if (drStateInfo.containsReplicatedStreamInfo) {
              s_drTupleStreamInfo.put(MpInitiator.MP_INIT_PID, drStateInfo);
          }
  
          if (!context.getSiteProcedureConnection().externalStreamsEnabled()) {
              s_disabledStreams.add(context.getPartitionId());
          }
      }
docs: /*
  Synchronization is handled by SnapshotSaveAPI.startSnapshotting
  Store the export sequence numbers for every table and partition. This will
  be called by every execution site before the snapshot starts. Then the execution
  site that gets the setup permit will  use getExportSequenceNumbers to retrieve the full
  set and reset the contents.