Xuanwo commented on code in PR #3392:
URL: 
https://github.com/apache/incubator-opendal/pull/3392#discussion_r1374192886


##########
bindings/java/src/main/java/org/apache/opendal/layer/RetryNativeLayer.java:
##########
@@ -0,0 +1,50 @@
+/*
+ * 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.opendal.layer;
+
+import java.time.Duration;
+import lombok.Builder;
+import org.apache.opendal.NativeLayer;
+
+@Builder
+public class RetryNativeLayer extends NativeLayer {
+
+    private final boolean jitter;

Review Comment:
   > This causes `RetryNativeLayer` to hold a native handle to release.
   
   Can we implement something like `Drop` for `RetryNativeLayer`? I'm guessing 
java can do something while the class is not referred. By the way, the memory 
of `layerHandle` should be freed after `doLayer` has been called.
   
   > Still I'm thinking of a layer concept to intercept in Java level
   
   It's ok to keep to have different layer types.
   
   But users don't need to know about them.
   
   For example, users could call:
   
   ```java
   op.layer(RetryLayer).layer(TracingLayer).layer(MyLayer)
   ```
   
   without knowing it's `native` or not.



-- 
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]

Reply via email to