@@ -60,17 +60,11 @@ public class TestRouterAsyncMountTable {
6060 private static MiniRouterDFSCluster .NamenodeContext nnContext1 ;
6161 private static MiniRouterDFSCluster .RouterContext routerContext ;
6262 private static MountTableResolver mountTable ;
63- private static ClientProtocol routerProtocol ;
64- private static long startTime ;
65- private static FileSystem nnFs0 ;
66- private static FileSystem nnFs1 ;
6763 private static FileSystem routerFs ;
6864
6965 @ BeforeClass
7066 public static void globalSetUp () throws Exception {
71- startTime = Time .now ();
72-
73- // Build and start a federated cluster
67+ // Build and start a federated cluster.
7468 cluster = new StateStoreDFSCluster (false , 2 );
7569 Configuration conf = new RouterConfigBuilder ()
7670 .stateStore ()
@@ -84,15 +78,12 @@ public static void globalSetUp() throws Exception {
8478 cluster .startRouters ();
8579 cluster .waitClusterUp ();
8680
87- // Get the end points
81+ // Get the end points.
8882 nnContext0 = cluster .getNamenode ("ns0" , null );
8983 nnContext1 = cluster .getNamenode ("ns1" , null );
90- nnFs0 = nnContext0 .getFileSystem ();
91- nnFs1 = nnContext1 .getFileSystem ();
9284 routerContext = cluster .getRandomRouter ();
9385 routerFs = routerContext .getFileSystem ();
9486 Router router = routerContext .getRouter ();
95- routerProtocol = routerContext .getClient ().getNamenode ();
9687 mountTable = (MountTableResolver ) router .getSubclusterResolver ();
9788 }
9889
@@ -135,7 +126,7 @@ private boolean addMountTable(final MountTable entry) throws IOException {
135126 AddMountTableEntryResponse addResponse =
136127 mountTableManager .addMountTableEntry (addRequest );
137128
138- // Reload the Router cache
129+ // Reload the Router cache.
139130 mountTable .loadCache (true );
140131
141132 return addResponse .getStatus ();
@@ -144,7 +135,7 @@ private boolean addMountTable(final MountTable entry) throws IOException {
144135 @ Test
145136 public void testGetEnclosingRoot () throws Exception {
146137
147- // Add a read only entry
138+ // Add a read only entry.
148139 MountTable readOnlyEntry = MountTable .newInstance (
149140 "/readonly" , Collections .singletonMap ("ns0" , "/testdir" ));
150141 readOnlyEntry .setReadOnly (true );
@@ -155,13 +146,13 @@ public void testGetEnclosingRoot() throws Exception {
155146 assertEquals (routerFs .getEnclosingRoot (new Path ("/regular" )),
156147 routerFs .getEnclosingRoot (routerFs .getEnclosingRoot (new Path ("/regular" ))));
157148
158- // Add a regular entry
149+ // Add a regular entry.
159150 MountTable regularEntry = MountTable .newInstance (
160151 "/regular" , Collections .singletonMap ("ns0" , "/testdir" ));
161152 assertTrue (addMountTable (regularEntry ));
162153 assertEquals (routerFs .getEnclosingRoot (new Path ("/regular" )), new Path ("/regular" ));
163154
164- // path does not need to exist
155+ // Path does not need to exist.
165156 assertEquals (routerFs .getEnclosingRoot (new Path ("/regular/pathDNE" )), new Path ("/regular" ));
166157 }
167158}
0 commit comments