Changeset 4306


Ignore:
Timestamp:
2010-10-01 13:30:38 (3 years ago)
Author:
evert
Message:

RowLogConfigurationManager? should not close the zookeeper connection it recieves.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/repository/impl/src/test/java/org/lilycms/repository/impl/test/AvroRepositoryTest.java

    r4305 r4306  
    7676        messageQueueProcessor.stop(); 
    7777        serverRepository.stop(); 
    78         rowLogConfigurationManager.stop(); 
    7978        HBASE_PROXY.stop(); 
    8079    } 
  • trunk/repository/impl/src/test/java/org/lilycms/repository/impl/test/HBaseRepositoryTest.java

    r4305 r4306  
    5959        messageQueueProcessor.stop(); 
    6060        ((HBaseRepository)repository).stop(); 
    61         rowLogConfigurationManager.stop(); 
    6261        HBASE_PROXY.stop(); 
    6362    } 
  • trunk/rowlog/impl/src/main/java/org/lilycms/rowlog/impl/RemoteListenerHandler.java

    r4305 r4306  
    9191            e.printStackTrace(); 
    9292        }  
    93         try { 
    94             rowLogConfigurationManager.stop(); 
    95         } catch (InterruptedException e) { 
    96         } 
    9793    } 
    9894     
  • trunk/rowlog/impl/src/main/java/org/lilycms/rowlog/impl/RowLogConfigurationManagerImpl.java

    r4305 r4306  
    44import java.util.List; 
    55 
    6 import org.apache.commons.logging.Log; 
    7 import org.apache.commons.logging.LogFactory; 
    86import org.apache.hadoop.hbase.util.Bytes; 
    97import org.apache.zookeeper.CreateMode; 
     
    2220 
    2321public class RowLogConfigurationManagerImpl implements RowLogConfigurationManager { 
    24     private Log log = LogFactory.getLog(getClass()); 
    2522    private String lilyPath = "/lily"; 
    2623    private String rowLogPath = lilyPath + "/rowlog"; 
    2724     
    2825    private ZooKeeperItf zooKeeper; 
    29      
    30     @Override 
    31     protected void finalize() throws Throwable { 
    32         stop(); 
    33         super.finalize(); 
    34     } 
    35      
    36     public void stop() throws InterruptedException { 
    37         if (zooKeeper != null) { 
    38             long sessionId = zooKeeper.getSessionId(); 
    39             zooKeeper.close(); 
    40             log.info("Closed zookeeper connection with sessionId 0x"+Long.toHexString(sessionId)); 
    41         } 
    42     } 
    4326     
    4427    public RowLogConfigurationManagerImpl(ZooKeeperItf zooKeeper) throws RowLogException { 
  • trunk/rowlog/impl/src/main/java/org/lilycms/rowlog/impl/RowLogProcessorImpl.java

    r4305 r4306  
    158158            } 
    159159        } 
    160         try { 
    161             rowLogConfigurationManager.stop(); 
    162         } catch (InterruptedException e) { 
    163         } 
    164160    } 
    165161 
  • trunk/rowlog/impl/src/main/java/org/lilycms/rowlog/impl/RowLogProcessorNotifier.java

    r4305 r4306  
    4646            channelFactory.releaseExternalResources(); 
    4747            channelFactory = null; 
    48         } 
    49         try { 
    50             rowLogConfigurationManager.stop(); 
    51         } catch (InterruptedException e) { 
    5248        } 
    5349    } 
  • trunk/rowlog/impl/src/test/java/org/lilycms/rowlog/impl/test/AbstractRowLogEndToEndTest.java

    r4305 r4306  
    5151    @AfterClass 
    5252    public static void tearDownAfterClass() throws Exception { 
    53       rowLogConfigurationManager.stop(); 
    5453      processor.stop(); 
    5554      HBASE_PROXY.stop(); 
  • trunk/rowlog/impl/src/test/java/org/lilycms/rowlog/impl/test/Example.java

    r4305 r4306  
    9999        Thread.sleep(30000); 
    100100        processor.stop(); 
    101          
    102101        TEST_UTIL.shutdownMiniCluster(); 
    103102    } 
  • trunk/rowlog/impl/src/test/java/org/lilycms/rowlog/impl/test/RowLogTest.java

    r4305 r4306  
    6969        RowLogConfigurationManagerImpl configurationManager = new RowLogConfigurationManagerImpl(zooKeeper); 
    7070        configurationManager.addSubscription(RowLogId, subscriptionId1, Type.VM, 3, 1); 
    71         configurationManager.stop(); 
    7271        control = createControl(); 
    7372        rowTable = RowLogTableUtil.getRowTable(HBASE_PROXY.getConf()); 
     
    254253        rowLog.unlockMessage(message, subscriptionId2, true, lock2); 
    255254        configurationManager.removeSubscription(RowLogId, subscriptionId2); 
    256         configurationManager.stop(); 
    257255    } 
    258256     
     
    305303        control.verify(); 
    306304        configurationManager.removeSubscription(RowLogId, subscriptionId3); 
    307         configurationManager.stop(); 
    308305    } 
    309306} 
Note: See TracChangeset for help on using the changeset viewer.