mattyb149 commented on code in PR #7213:
URL: https://github.com/apache/nifi/pull/7213#discussion_r1181329111
##########
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java:
##########
@@ -83,15 +78,6 @@ public abstract class AbstractMongoProcessor extends
AbstractProcessor {
.identifiesControllerService(MongoDBClientService.class)
.build();
- static final PropertyDescriptor URI = new PropertyDescriptor.Builder()
Review Comment:
This removal requires migration, can you add it to the [Migration
Guide](https://cwiki.apache.org/confluence/display/NIFI/Migrating+Deprecated+Components+and+Features+for+2.0.0)
and/or the appropriate 2.0 docs, since it renders existing flows using these
processors invalid? Please and thanks!
##########
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java:
##########
@@ -230,36 +183,37 @@ public abstract class AbstractMongoProcessor extends
AbstractProcessor {
@OnScheduled
public final void createClient(ProcessContext context) {
- if (context.getProperty(CLIENT_SERVICE).isSet()) {
- clientService =
context.getProperty(CLIENT_SERVICE).asControllerService(MongoDBClientService.class);
- return;
- }
-
- if (mongoClient != null) {
- closeClient();
- }
-
- getLogger().info("Creating MongoClient");
-
- // Set up the client for secure (SSL/TLS communications) if configured
to do so
- final SSLContextService sslService =
context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class);
- final SSLContext sslContext;
-
- if (sslService != null) {
- sslContext = sslService.createContext();
- } else {
- sslContext = null;
- }
-
- try {
- final String uri = getURI(context);
- final MongoClientSettings.Builder builder = getClientSettings(uri,
sslContext);
- final MongoClientSettings clientSettings = builder.build();
- mongoClient = MongoClients.create(clientSettings);
- } catch (Exception e) {
- getLogger().error("Failed to schedule {} due to {}", new Object[]
{ this.getClass().getName(), e }, e);
- throw e;
- }
+ clientService =
context.getProperty(CLIENT_SERVICE).asControllerService(MongoDBClientService.class);
+// if (context.getProperty(CLIENT_SERVICE).isSet()) {
Review Comment:
Let's delete this dead code
##########
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongo.java:
##########
@@ -277,40 +276,40 @@ private Document parseUpdateKey(String updateKey, Map
doc) {
}
- protected WriteConcern getWriteConcern(final ProcessContext context) {
- final String writeConcernProperty =
context.getProperty(WRITE_CONCERN).getValue();
- WriteConcern writeConcern = null;
- switch (writeConcernProperty) {
- case WRITE_CONCERN_ACKNOWLEDGED:
- writeConcern = WriteConcern.ACKNOWLEDGED;
- break;
- case WRITE_CONCERN_UNACKNOWLEDGED:
- writeConcern = WriteConcern.UNACKNOWLEDGED;
- break;
- case WRITE_CONCERN_FSYNCED:
- writeConcern = WriteConcern.JOURNALED;
- break;
- case WRITE_CONCERN_JOURNALED:
- writeConcern = WriteConcern.JOURNALED;
- break;
- case WRITE_CONCERN_REPLICA_ACKNOWLEDGED:
- writeConcern = WriteConcern.W2;
- break;
- case WRITE_CONCERN_MAJORITY:
- writeConcern = WriteConcern.MAJORITY;
- break;
- case WRITE_CONCERN_W1:
- writeConcern = WriteConcern.W1;
- break;
- case WRITE_CONCERN_W2:
- writeConcern = WriteConcern.W2;
- break;
- case WRITE_CONCERN_W3:
- writeConcern = WriteConcern.W3;
- break;
- default:
- writeConcern = WriteConcern.ACKNOWLEDGED;
- }
- return writeConcern;
- }
+// protected WriteConcern getWriteConcern(final ProcessContext context) {
Review Comment:
Same as above, remove dead code
##########
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongoRecord.java:
##########
@@ -266,10 +265,7 @@ public void onTrigger(final ProcessContext context, final
ProcessSession session
error = true;
} finally {
if (!error) {
- String url = clientService != null
Review Comment:
Is this always not null now?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]