You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cl...@apache.org on 2019/07/25 17:17:19 UTC

[hadoop] 10/50: HDFS-13706. [SBN read] Rename client context to ClientGSIContext. Contributed by Konstantin Shvachko.

This is an automated email from the ASF dual-hosted git repository.

cliang pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/hadoop.git

commit c02f4ccba19c9399e6421f6df2411bc57a5ce86b
Author: Konstantin V Shvachko <sh...@apache.org>
AuthorDate: Fri Jun 29 15:50:37 2018 -0700

    HDFS-13706. [SBN read] Rename client context to ClientGSIContext. Contributed by Konstantin Shvachko.
---
 ...ClientGCIContext.java => ClientGSIContext.java} |  4 +++-
 .../hdfs/TestStateAlignmentContextWithHA.java      | 28 +++++++++++-----------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ClientGCIContext.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ClientGSIContext.java
similarity index 96%
rename from hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ClientGCIContext.java
rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ClientGSIContext.java
index 0d0bd25..6f69eed 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ClientGCIContext.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ClientGSIContext.java
@@ -27,12 +27,14 @@ import org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto;
 import java.util.concurrent.atomic.LongAccumulator;
 
 /**
+ * Global State Id context for the client.
+ * <p/>
  * This is the client side implementation responsible for receiving
  * state alignment info from server(s).
  */
 @InterfaceAudience.Private
 @InterfaceStability.Stable
-class ClientGCIContext implements AlignmentContext {
+class ClientGSIContext implements AlignmentContext {
 
   private final LongAccumulator lastSeenStateId =
       new LongAccumulator(Math::max, Long.MIN_VALUE);
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestStateAlignmentContextWithHA.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestStateAlignmentContextWithHA.java
index 3437bb0..00ed6bc 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestStateAlignmentContextWithHA.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestStateAlignmentContextWithHA.java
@@ -67,11 +67,11 @@ public class TestStateAlignmentContextWithHA {
   private static final int NUMFILES = 300;
   private static final Configuration CONF = new HdfsConfiguration();
   private static final String NAMESERVICE = "nameservice";
-  private static final List<ClientGCIContext> AC_LIST = new ArrayList<>();
+  private static final List<ClientGSIContext> AC_LIST = new ArrayList<>();
 
   private static MiniDFSCluster cluster;
   private static List<Worker> clients;
-  private static ClientGCIContext spy;
+  private static ClientGSIContext spy;
 
   private DistributedFileSystem dfs;
   private int active = 0;
@@ -80,7 +80,7 @@ public class TestStateAlignmentContextWithHA {
   static class AlignmentContextProxyProvider<T>
       extends ConfiguredFailoverProxyProvider<T> {
 
-    private ClientGCIContext alignmentContext;
+    private ClientGSIContext alignmentContext;
 
     public AlignmentContextProxyProvider(
         Configuration conf, URI uri, Class<T> xface,
@@ -89,14 +89,14 @@ public class TestStateAlignmentContextWithHA {
 
       // Create and set AlignmentContext in HAProxyFactory.
       // All proxies by factory will now have AlignmentContext assigned.
-      this.alignmentContext = (spy != null ? spy : new ClientGCIContext());
+      this.alignmentContext = (spy != null ? spy : new ClientGSIContext());
       ((ClientHAProxyFactory) factory).setAlignmentContext(alignmentContext);
 
       AC_LIST.add(alignmentContext);
     }
 
     @Override // AbstractNNFailoverProxyProvider
-    public synchronized ClientGCIContext getAlignmentContext() {
+    public synchronized ClientGSIContext getAlignmentContext() {
       return this.alignmentContext;
     }
   }
@@ -104,7 +104,7 @@ public class TestStateAlignmentContextWithHA {
   static class SpyConfiguredContextProxyProvider<T>
       extends ConfiguredFailoverProxyProvider<T> {
 
-    private ClientGCIContext alignmentContext;
+    private ClientGSIContext alignmentContext;
 
     public SpyConfiguredContextProxyProvider(
         Configuration conf, URI uri, Class<T> xface,
@@ -112,7 +112,7 @@ public class TestStateAlignmentContextWithHA {
       super(conf, uri, xface, factory);
 
       // Create but DON'T set in HAProxyFactory.
-      this.alignmentContext = (spy != null ? spy : new ClientGCIContext());
+      this.alignmentContext = (spy != null ? spy : new ClientGSIContext());
 
       AC_LIST.add(alignmentContext);
     }
@@ -180,7 +180,7 @@ public class TestStateAlignmentContextWithHA {
 
     try (DistributedFileSystem clearDfs =
              (DistributedFileSystem) FileSystem.get(confCopy)) {
-      ClientGCIContext clientState = getContext(1);
+      ClientGSIContext clientState = getContext(1);
       assertThat(clientState.getLastSeenStateId(), is(Long.MIN_VALUE));
       DFSTestUtil.writeFile(clearDfs, new Path("/testFileNoState"), "no_state");
       assertThat(clientState.getLastSeenStateId(), is(Long.MIN_VALUE));
@@ -231,7 +231,7 @@ public class TestStateAlignmentContextWithHA {
         cluster.getNamesystem(active).getLastWrittenTransactionId();
     try (DistributedFileSystem clearDfs =
              (DistributedFileSystem) FileSystem.get(CONF)) {
-      ClientGCIContext clientState = getContext(1);
+      ClientGSIContext clientState = getContext(1);
       assertThat(clientState.getLastSeenStateId(), is(Long.MIN_VALUE));
       DFSTestUtil.readFile(clearDfs, new Path("/testFile3"));
       assertThat(clientState.getLastSeenStateId(), is(lastWrittenId));
@@ -244,8 +244,8 @@ public class TestStateAlignmentContextWithHA {
    */
   @Test
   public void testClientSendsState() throws Exception {
-    ClientGCIContext alignmentContext = new ClientGCIContext();
-    ClientGCIContext spiedAlignContext = Mockito.spy(alignmentContext);
+    ClientGSIContext alignmentContext = new ClientGSIContext();
+    ClientGSIContext spiedAlignContext = Mockito.spy(alignmentContext);
     spy = spiedAlignContext;
 
     try (DistributedFileSystem clearDfs =
@@ -286,8 +286,8 @@ public class TestStateAlignmentContextWithHA {
    */
   @Test
   public void testClientSendsGreaterState() throws Exception {
-    ClientGCIContext alignmentContext = new ClientGCIContext();
-    ClientGCIContext spiedAlignContext = Mockito.spy(alignmentContext);
+    ClientGSIContext alignmentContext = new ClientGSIContext();
+    ClientGSIContext spiedAlignContext = Mockito.spy(alignmentContext);
     spy = spiedAlignContext;
 
     try (DistributedFileSystem clearDfs =
@@ -377,7 +377,7 @@ public class TestStateAlignmentContextWithHA {
     }
   }
 
-  private ClientGCIContext getContext(int clientCreationIndex) {
+  private ClientGSIContext getContext(int clientCreationIndex) {
     return AC_LIST.get(clientCreationIndex);
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org