turcsanyip commented on code in PR #10031: URL: https://github.com/apache/nifi/pull/10031#discussion_r2284784594
########## nifi-extension-bundles/nifi-couchbase-bundle/nifi-couchbase-3-services/src/main/java/org/apache/nifi/services/couchbase/Couchbase3Client.java: ########## @@ -0,0 +1,161 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.services.couchbase; + +import com.couchbase.client.core.error.AuthenticationFailureException; +import com.couchbase.client.core.error.BucketNotFoundException; +import com.couchbase.client.core.error.CasMismatchException; +import com.couchbase.client.core.error.CollectionNotFoundException; +import com.couchbase.client.core.error.ConfigException; +import com.couchbase.client.core.error.DatasetNotFoundException; +import com.couchbase.client.core.error.DecodingFailureException; +import com.couchbase.client.core.error.DocumentExistsException; +import com.couchbase.client.core.error.DocumentLockedException; +import com.couchbase.client.core.error.DocumentMutationLostException; +import com.couchbase.client.core.error.DocumentNotFoundException; +import com.couchbase.client.core.error.DocumentNotLockedException; +import com.couchbase.client.core.error.DocumentUnretrievableException; +import com.couchbase.client.core.error.DurableWriteInProgressException; +import com.couchbase.client.core.error.DurableWriteReCommitInProgressException; +import com.couchbase.client.core.error.FeatureNotAvailableException; +import com.couchbase.client.core.error.InvalidArgumentException; +import com.couchbase.client.core.error.RequestCanceledException; +import com.couchbase.client.core.error.ScopeNotFoundException; +import com.couchbase.client.core.error.ServerOutOfMemoryException; +import com.couchbase.client.core.error.ServiceNotAvailableException; +import com.couchbase.client.core.error.TemporaryFailureException; +import com.couchbase.client.core.error.ValueTooLargeException; +import com.couchbase.client.core.error.subdoc.PathExistsException; +import com.couchbase.client.core.error.subdoc.PathNotFoundException; +import com.couchbase.client.java.Collection; +import com.couchbase.client.java.codec.RawBinaryTranscoder; +import com.couchbase.client.java.codec.RawJsonTranscoder; +import com.couchbase.client.java.codec.Transcoder; +import com.couchbase.client.java.kv.GetOptions; +import com.couchbase.client.java.kv.GetResult; +import com.couchbase.client.java.kv.MutationResult; +import com.couchbase.client.java.kv.PersistTo; +import com.couchbase.client.java.kv.ReplicateTo; +import com.couchbase.client.java.kv.UpsertOptions; +import org.apache.nifi.services.couchbase.exception.CouchbaseErrorHandler; +import org.apache.nifi.services.couchbase.exception.CouchbaseException; +import org.apache.nifi.services.couchbase.utils.CouchbaseGetResult; +import org.apache.nifi.services.couchbase.utils.DocumentType; +import org.apache.nifi.services.couchbase.utils.JsonValidator; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Predicate; + +import static java.util.Map.entry; +import static org.apache.nifi.services.couchbase.exception.CouchbaseErrorHandler.ErrorHandlingStrategy.FAILURE; +import static org.apache.nifi.services.couchbase.exception.CouchbaseErrorHandler.ErrorHandlingStrategy.RETRY; +import static org.apache.nifi.services.couchbase.exception.CouchbaseErrorHandler.ErrorHandlingStrategy.ROLLBACK; + +public class Couchbase3Client implements CouchbaseClient { + + private final Collection collection; + private final DocumentType documentType; + private final PersistTo persistTo; + private final ReplicateTo replicateTo; + + public Couchbase3Client(Collection collection, DocumentType documentType, PersistTo persistTo, ReplicateTo replicateTo) { Review Comment: As the client implementation is not intended to be used directly by the processors, the class and its constructor should be package-private. ```suggestion class Couchbase3Client implements CouchbaseClient { private final Collection collection; private final DocumentType documentType; private final PersistTo persistTo; private final ReplicateTo replicateTo; Couchbase3Client(Collection collection, DocumentType documentType, PersistTo persistTo, ReplicateTo replicateTo) { ``` -- 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]
