Docs Menu
Docs Home
/
MongoDB Kafka Connector
/ /

싱크 커넥터 쓰기 모델 전략

이 페이지의 내용

  • 개요
  • WriteModel
  • 쓰기 모델 삭제
  • Strategies

구성 속성을 설정하여 MongoDB Kafka 싱크 connector 가 MongoDB 에 데이터를 쓰는 방법을 지정할 수 있습니다. 다음 섹션에서는 이 동작을 사용자 지정하기 위해 설정할 수 있는 구성 속성에 대해 설명합니다.

connector가 싱크 레코드를 수신할 때 데이터를 쓰는 방법을 지정하려면 writemodel.strategy 속성을 설정합니다.

이 페이지의 전략 섹션에 설명된 쓰기 (write) 모델 전략의 정규화된 클래스 이름 중 하나로 writemodel.strategy 값을 설정하다 수 있습니다. 다음 구성을 설정하여 전략을 지정할 수 있습니다.

writemodel.strategy=<a write model strategy>

싱크 connector 가 툼스톤 이벤트를 수신할 때 데이터를 쓰는 방법을 지정하려면 delete.writemodel.strategy 구성 속성을 설정합니다. 툼스톤 이벤트는 키가 있지만 값이 없는 레코드로, 삭제된 레코드를 나타냅니다.

이 페이지의 전략 섹션에 설명된 쓰기 (write) 모델 전략의 정규화된 클래스 이름 중 하나로 delete.writemodel.strategy 값을 설정하다 수 있습니다. 다음 구성을 설정하여 전략을 지정할 수 있습니다.

delete.writemodel.strategy=<a write model strategy>

카테고리별로 정리된 싱크 connector 구성 설정 목록은 싱크 Connector 구성 속성가이드 를 참조하세요.

이름
설명
DefaultWriteModelStrategy

Description:
This strategy uses the ReplaceOneDefaultStrategy by default, and the InsertOneDefaultStrategy if you set the timeseries.timefield option.

This is the default value value for the writemodel.strategy configuration property.
InsertOneDefaultStrategy

Description:
Insert each sink record into MongoDB as a document.
To specify this strategy, set the configuration property to the following class name:
com.mongodb.kafka.connect.sink.writemodel.strategy.InsertOneDefaultStrategy
ReplaceOneDefaultStrategy

Description:
Replaces at most one document in MongoDB that matches a sink record by the _id field. If no documents match, the connector inserts the sink record as a new document.
To specify this strategy, set the configuration property to the following class name:
com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneDefaultStrategy
ReplaceOneBusinessKeyStrategy

Description:
Replaces at most one document that matches a sink record by a specified business key. If no documents match, the connector inserts the sink record as a new document.
To specify this strategy, set the configuration property to the following class name:
com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneBusinessKeyStrategy
To see an example showing how to use this strategy, see our guide on write model strategies.
DeleteOneDefaultStrategy

Description:
Deletes at most one document that matches your sink connector's key structure by the _id field only when the document contains a null value structure.

This is the default value for the delete.writemodel.strategy configuration property.

This strategy is set as the default value of the writemodel.strategy property when you set mongodb.delete.on.null.values=true.
To specify this strategy, set the configuration property to the following class name:
com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneDefaultStrategy
DeleteOneBusinessKeyStrategy

Description:
Deletes at most one MongoDB document that matches a sink record by a business key.
To specify this strategy, set the configuration property to the following class name:
com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneBusinessKeyStrategy
To see an example showing how to use this strategy, see our guide on write model strategies.
UpdateOneDefaultStrategy

Description:
Updates at most one document in MongoDB that matches a sink record by the _id field. If no documents match, the connector inserts the sink record as a new document.
To specify this strategy, set the configuration property to the following class name:
com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneDefaultStrategy
UpdateOneTimestampsStrategy

Description:
Add _insertedTS (inserted timestamp) and _modifiedTS (modified timestamp) fields into documents.
To specify this strategy, set the configuration property to the following class name:
com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneTimestampsStrategy
To see an example showing how to use this strategy, see our guide on write model strategies.
UpdateOneBusinessKeyTimestampStrategy

Description:
Add _insertedTS (inserted timestamp) and _modifiedTS (modified timestamp) fields into documents that match a business key.
To specify this strategy, set the configuration property to the following class name:
com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneBusinessKeyTimestampStrategy

돌아가기

ID 전략