mehakmeet commented on code in PR #5780:
URL: https://github.com/apache/hadoop/pull/5780#discussion_r1247863406


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/BackReference.java:
##########
@@ -0,0 +1,37 @@
+package org.apache.hadoop.fs.impl;
+
+import javax.annotation.Nullable;
+
+import org.apache.hadoop.classification.VisibleForTesting;
+
+/**
+ * Holds reference to an object to be attached to a stream or store to avoid
+ * the reference being lost to GC.
+ */
+public class BackReference {
+  private final Object reference;
+
+  public BackReference(@Nullable Object reference) {
+    this.reference = reference;
+  }
+
+  /**
+   * is the reference null?
+   * @return true if the ref. is null, else false.
+   */
+  public boolean isNull() {
+    return reference == null;
+  }
+
+  @VisibleForTesting
+  public Object getReference() {

Review Comment:
   Okay, sounds good.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to