@Test public void testInstanceSharing() throws IOException { LeaseRenewer lr = LeaseRenewer.getInstance( FAKE_AUTHORITY, FAKE_UGI_A, MOCK_DFSCLIENT); LeaseRenewer lr2 = LeaseRenewer.getInstance( FAKE_AUTHORITY, FAKE_UGI_A, MOCK_DFSCLIENT); Assert.assertSame(lr, lr2); LeaseRenewer lr3 = LeaseRenewer.getInstance( FAKE_AUTHORITY, FAKE_UGI_B, MOCK_DFSCLIENT); Assert.assertNotSame(lr, lr3); LeaseRenewer lr4 = LeaseRenewer.getInstance( "someOtherAuthority", FAKE_UGI_B, MOCK_DFSCLIENT); Assert.assertNotSame(lr, lr4); Assert.assertNotSame(lr3, lr4); }
static LeaseRenewer getInstance(final String authority, final UserGroupInformation ugi, final DFSClient dfsc) throws IOException { final LeaseRenewer r = Factory.INSTANCE.get(authority, ugi); r.addClient(dfsc); return r; }
LeaseRenewer { static LeaseRenewer getInstance(final String authority, final UserGroupInformation ugi, final DFSClient dfsc) throws IOException { final LeaseRenewer r = Factory.INSTANCE.get(authority, ugi); r.addClient(dfsc); return r; } }
LeaseRenewer { static LeaseRenewer getInstance(final String authority, final UserGroupInformation ugi, final DFSClient dfsc) throws IOException { final LeaseRenewer r = Factory.INSTANCE.get(authority, ugi); r.addClient(dfsc); return r; } private  LeaseRenewer(Factory.Key factorykey); }
LeaseRenewer { static LeaseRenewer getInstance(final String authority, final UserGroupInformation ugi, final DFSClient dfsc) throws IOException { final LeaseRenewer r = Factory.INSTANCE.get(authority, ugi); r.addClient(dfsc); return r; } private  LeaseRenewer(Factory.Key factorykey); @VisibleForTesting synchronized void setRenewalTime(final long renewal); boolean isEmpty(); @Override String toString(); }
LeaseRenewer { static LeaseRenewer getInstance(final String authority, final UserGroupInformation ugi, final DFSClient dfsc) throws IOException { final LeaseRenewer r = Factory.INSTANCE.get(authority, ugi); r.addClient(dfsc); return r; } private  LeaseRenewer(Factory.Key factorykey); @VisibleForTesting synchronized void setRenewalTime(final long renewal); boolean isEmpty(); @Override String toString();  }