Uploaded image for project: 'Kafka Connector'
  1. Kafka Connector
  2. KAFKA-296

Confused with ADD_ALT_NAMESPACE_STAGE and UNSET_ORIGINAL_NAMESPACE_STAGE in CopyData

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Works as Designed
    • Icon: Trivial - P5 Trivial - P5
    • None
    • None
    • None

    Description

      Hi there,

       
      I am a little confused with the pipeline stages of ADD_ALT_NAMESPACE_STAGE and UNSET_ORIGINAL_NAMESPACE_STAGE in MongoCopyDataManager.
      May I ask the reason we need these two stages?
       

      private static final String PIPELINE_TEMPLATE =
          format(
              "{$replaceRoot: "
                  + "{newRoot: {"
                  + "_id: {_id: '$_id', copyingData: true}, "
                  + "operationType: 'insert', "
                  + "%s: {db: '%%s', coll: '%%s'}"
                  + "documentKey: {_id: '$_id'}, "
                  + "fullDocument: '$$ROOT'}}"
                  + "}",
              NAMESPACE_FIELD);
       
      private static final BsonDocument ADD_ALT_NAMESPACE_STAGE =
          BsonDocument.parse(
              format("{'$addFields': {'%s': '$%s'}}", ALT_NAMESPACE_FIELD, NAMESPACE_FIELD));
      private static final BsonDocument UNSET_ORIGINAL_NAMESPACE_STAGE =
          BsonDocument.parse(format("{'$project': {'%s': 0}}", NAMESPACE_FIELD));
      

       
       

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            jiabao.sun@xtransfer.cn Jiabao Sun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: