zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iv...@apache.org
Subject svn commit: r1547123 - in /zookeeper/bookkeeper/trunk: ./ bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/
Date Mon, 02 Dec 2013 17:45:14 GMT
Author: ivank
Date: Mon Dec  2 17:45:13 2013
New Revision: 1547123

URL: http://svn.apache.org/r1547123
Log:
BOOKKEEPER-565: Make an option to separate storing entry log files from index files. (sijie
via ivank)

Modified:
    zookeeper/bookkeeper/trunk/CHANGES.txt
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyEntryLogger.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/TestLedgerDirsManager.java

Modified: zookeeper/bookkeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/CHANGES.txt?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/CHANGES.txt (original)
+++ zookeeper/bookkeeper/trunk/CHANGES.txt Mon Dec  2 17:45:13 2013
@@ -124,6 +124,8 @@ Trunk (unreleased changes)
 
         BOOKKEEPER-678: BookieServer shutdown hangs indefinitely at NioServerSocketChannelFactory.releaseExternalResources
(rakeshr via ivank)
 
+        BOOKKEEPER-565: Make an option to separate storing entry log files from index files.
(sijie via ivank)
+
       hedwig-server:
 
         BOOKKEEPER-601: readahead cache size isn't updated correctly (sijie via fpj)

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
Mon Dec  2 17:45:13 2013
@@ -101,6 +101,7 @@ public class Bookie extends BookieThread
     private final String bookieRegistrationPath;
 
     private LedgerDirsManager ledgerDirsManager;
+    private LedgerDirsManager indexDirsManager;
 
     // ZooKeeper client instance for the Bookie
     ZooKeeper zk;
@@ -273,9 +274,15 @@ public class Bookie extends BookieThread
      * first run and the filesystem structure is up to date.
      */
     private void checkEnvironment(ZooKeeper zk) throws BookieException, IOException {
+        List<File> allLedgerDirs = new ArrayList<File>(ledgerDirsManager.getAllLedgerDirs().size()
+                                                     + indexDirsManager.getAllLedgerDirs().size());
+        allLedgerDirs.addAll(ledgerDirsManager.getAllLedgerDirs());
+        if (indexDirsManager != ledgerDirsManager) {
+            allLedgerDirs.addAll(indexDirsManager.getAllLedgerDirs());
+        }
         if (zk == null) { // exists only for testing, just make sure directories are correct
             checkDirectoryStructure(journalDirectory);
-            for (File dir : ledgerDirsManager.getAllLedgerDirs()) {
+            for (File dir : allLedgerDirs) {
                     checkDirectoryStructure(dir);
             }
             return;
@@ -303,7 +310,7 @@ public class Bookie extends BookieThread
             } catch (FileNotFoundException fnf) {
                 missedCookieDirs.add(journalDirectory);
             }
-            for (File dir : ledgerDirsManager.getAllLedgerDirs()) {
+            for (File dir : allLedgerDirs) {
                 checkDirectoryStructure(dir);
                 try {
                     Cookie c = Cookie.readFromDirectory(dir);
@@ -322,7 +329,7 @@ public class Bookie extends BookieThread
                 if (missedCookieDirs.size() > 0) {
                     LOG.debug("Directories missing cookie file are {}", missedCookieDirs);
                     masterCookie.writeToDirectory(journalDirectory);
-                    for (File dir : ledgerDirsManager.getAllLedgerDirs()) {
+                    for (File dir : allLedgerDirs) {
                         masterCookie.writeToDirectory(dir);
                     }
                 }
@@ -387,6 +394,10 @@ public class Bookie extends BookieThread
         return ledgerDirsManager;
     }
 
+    LedgerDirsManager getIndexDirsManager() {
+        return indexDirsManager;
+    }
+
     public static File getCurrentDirectory(File dir) {
         return new File(dir, BookKeeperConstants.CURRENT_DIR);
     }
@@ -406,7 +417,14 @@ public class Bookie extends BookieThread
         this.bookieRegistrationPath = conf.getZkAvailableBookiesPath() + "/";
         this.conf = conf;
         this.journalDirectory = getCurrentDirectory(conf.getJournalDir());
-        this.ledgerDirsManager = new LedgerDirsManager(conf);
+        this.ledgerDirsManager = new LedgerDirsManager(conf, conf.getLedgerDirs());
+        File[] idxDirs = conf.getIndexDirs();
+        if (null == idxDirs) {
+            this.indexDirsManager = this.ledgerDirsManager;
+        } else {
+            this.indexDirsManager = new LedgerDirsManager(conf, idxDirs);
+        }
+
         // instantiate zookeeper client to initialize ledger manager
         this.zk = instantiateZookeeperClient(conf);
         checkEnvironment(this.zk);
@@ -421,7 +439,8 @@ public class Bookie extends BookieThread
         // instantiate the journal
         journal = new Journal(conf, ledgerDirsManager);
         ledgerStorage = new InterleavedLedgerStorage(conf, ledgerManager,
-                                                     ledgerDirsManager, journal);
+                                                     ledgerDirsManager, indexDirsManager,
+                                                     journal);
         syncThread = new SyncThread(conf, getLedgerDirsListener(),
                                     ledgerStorage, journal);
 
@@ -492,6 +511,9 @@ public class Bookie extends BookieThread
         LOG.debug("I'm starting a bookie with journal directory {}", journalDirectory.getName());
         //Start DiskChecker thread
         ledgerDirsManager.start();
+        if (indexDirsManager != ledgerDirsManager) {
+            indexDirsManager.start();
+        }
         // replay journals
         try {
             readJournal();
@@ -511,6 +533,9 @@ public class Bookie extends BookieThread
         // After successful bookie startup, register listener for disk
         // error/full notifications.
         ledgerDirsManager.addLedgerDirsListener(getLedgerDirsListener());
+        if (indexDirsManager != ledgerDirsManager) {
+            indexDirsManager.addLedgerDirsListener(getLedgerDirsListener());
+        }
 
         ledgerStorage.start();
 
@@ -853,6 +878,9 @@ public class Bookie extends BookieThread
 
                 //Shutdown disk checker
                 ledgerDirsManager.shutdown();
+                if (indexDirsManager != ledgerDirsManager) {
+                    indexDirsManager.shutdown();
+                }
 
                 // Shutdown the ZK client
                 if(zk != null) zk.close();
@@ -1068,6 +1096,18 @@ public class Bookie extends BookieThread
                 return false;
             }
         }
+
+        // Clean up index directories if they are separate from the ledger dirs
+        File[] indexDirs = conf.getIndexDirs();
+        if (null != indexDirs) {
+            for (File dir : indexDirs) {
+                if (!cleanDir(dir)) {
+                    LOG.error("Formatting ledger directory " + dir + " failed");
+                    return false;
+                }
+            }
+        }
+
         LOG.info("Bookie format completed successfully");
         return true;
     }

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
Mon Dec  2 17:45:13 2013
@@ -796,7 +796,7 @@ public class BookieShell implements Tool
 
     private synchronized Journal getJournal() throws IOException {
         if (null == journal) {
-            journal = new Journal(bkConf, new LedgerDirsManager(bkConf));
+            journal = new Journal(bkConf, new LedgerDirsManager(bkConf, bkConf.getLedgerDirs()));
         }
         return journal;
     }

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java
Mon Dec  2 17:45:13 2013
@@ -82,10 +82,18 @@ class InterleavedLedgerStorage implement
     InterleavedLedgerStorage(ServerConfiguration conf, LedgerManager ledgerManager,
                              LedgerDirsManager ledgerDirsManager, CheckpointSource checkpointSource)
             throws IOException {
+        this(conf, ledgerManager, ledgerDirsManager, ledgerDirsManager, checkpointSource);
+    }
+
+    InterleavedLedgerStorage(ServerConfiguration conf, LedgerManager ledgerManager,
+                             LedgerDirsManager ledgerDirsManager, LedgerDirsManager indexDirsManager,
+                             CheckpointSource checkpointSource)
+            throws IOException {
         activeLedgers = new SnapshotMap<Long, Boolean>();
         this.checkpointSource = checkpointSource;
         entryLogger = new EntryLogger(conf, ledgerDirsManager, this);
-        ledgerCache = new LedgerCacheImpl(conf, activeLedgers, ledgerDirsManager);
+        ledgerCache = new LedgerCacheImpl(conf, activeLedgers,
+                null == indexDirsManager ? ledgerDirsManager : indexDirsManager);
         gcThread = new GarbageCollectorThread(conf, ledgerCache, entryLogger,
                 activeLedgers, ledgerManager);
     }

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java
Mon Dec  2 17:45:13 2013
@@ -50,9 +50,9 @@ public class LedgerDirsManager {
     private LedgerDirsMonitor monitor;
     private final Random rand = new Random();
 
-    public LedgerDirsManager(ServerConfiguration conf) {
+    public LedgerDirsManager(ServerConfiguration conf, File[] dirs) {
         this.ledgerDirectories = Arrays.asList(Bookie
-                .getCurrentDirectories(conf.getLedgerDirs()));
+                .getCurrentDirectories(dirs));
         this.writableLedgerDirectories = new ArrayList<File>(ledgerDirectories);
         this.filledDirs = new ArrayList<File>();
         listeners = new ArrayList<LedgerDirsManager.LedgerDirsListener>();

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyEntryLogger.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyEntryLogger.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyEntryLogger.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyEntryLogger.java
Mon Dec  2 17:45:13 2013
@@ -32,7 +32,7 @@ import org.apache.bookkeeper.conf.Server
 public class ReadOnlyEntryLogger extends EntryLogger {
 
     public ReadOnlyEntryLogger(ServerConfiguration conf) throws IOException {
-        super(conf, new LedgerDirsManager(conf));
+        super(conf, new LedgerDirsManager(conf, conf.getLedgerDirs()));
     }
 
     @Override

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
Mon Dec  2 17:45:13 2013
@@ -67,6 +67,7 @@ public class ServerConfiguration extends
 
     protected final static String JOURNAL_DIR = "journalDirectory";
     protected final static String LEDGER_DIRS = "ledgerDirectories";
+    protected final static String INDEX_DIRS = "indexDirectories";
     // NIO Parameters
     protected final static String SERVER_TCP_NODELAY = "serverTcpNoDelay";
     // Zookeeper Parameters
@@ -459,6 +460,47 @@ public class ServerConfiguration extends
         return ledgerDirs;
     }
 
+    /** 
+     * Get dir name to store index files.
+     *   
+     * @return ledger index dir name, if no index dirs provided return null
+     */  
+    public String[] getIndexDirNames() {
+        if (!this.containsKey(INDEX_DIRS)) {
+            return null;
+        }
+        return this.getStringArray(INDEX_DIRS);
+    }   
+
+    /** 
+     * Set dir name to store index files.
+     *
+     * @param indexDirs
+     *          Index dir names
+     * @return server configuration.
+     */
+    public ServerConfiguration setIndexDirName(String[] indexDirs) {
+        this.setProperty(INDEX_DIRS, indexDirs);
+        return this;
+    }
+
+    /**
+     * Get index dir to store ledger index files.
+     *
+     * @return index dirs, if no index dirs provided return null
+     */
+    public File[] getIndexDirs() {
+        String[] idxDirNames = getIndexDirNames();
+        if (null == idxDirNames) {
+            return null;
+        }
+        File[] idxDirs = new File[idxDirNames.length];
+        for (int i=0; i<idxDirNames.length; i++) {
+            idxDirs[i] = new File(idxDirNames[i]);
+        }
+        return idxDirs;
+    }
+
     /**
      * Is tcp connection no delay.
      *

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java
Mon Dec  2 17:45:13 2013
@@ -374,7 +374,7 @@ public class BookieInitializationTest {
         try {
             // LedgerDirsManager#init() is used in Bookie instantiation.
             // Simulating disk errors by directly calling #init
-            LedgerDirsManager ldm = new LedgerDirsManager(conf);
+            LedgerDirsManager ldm = new LedgerDirsManager(conf, conf.getLedgerDirs());
             ldm.init();
         } finally {
             FileUtils.deleteDirectory(parent);

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java
Mon Dec  2 17:45:13 2013
@@ -363,7 +363,7 @@ public class CompactionTest extends Book
             };
         final byte[] KEY = "foobar".getBytes();
         File log0 = new File(curDir, "0.log");
-        LedgerDirsManager dirs = new LedgerDirsManager(conf);
+        LedgerDirsManager dirs = new LedgerDirsManager(conf, conf.getLedgerDirs());
         assertFalse("Log shouldnt exist", log0.exists());
         InterleavedLedgerStorage storage = new InterleavedLedgerStorage(conf, manager,
                                                                         dirs, checkpointSource);
@@ -470,7 +470,7 @@ public class CompactionTest extends Book
         Bookie.checkDirectoryStructure(curDir);
         conf.setLedgerDirNames(new String[] { tmpDir.toString() });
 
-        LedgerDirsManager dirs = new LedgerDirsManager(conf);
+        LedgerDirsManager dirs = new LedgerDirsManager(conf, conf.getLedgerDirs());
         final Set<Long> ledgers = Collections
                 .newSetFromMap(new ConcurrentHashMap<Long, Boolean>());
         LedgerManager manager = getLedgerManager(ledgers);

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java
Mon Dec  2 17:45:13 2013
@@ -82,7 +82,7 @@ public class CreateNewLogTest {
         // Creating a new configuration with a number of 
         // ledger directories.
         conf.setLedgerDirNames(ledgerDirs);
-        LedgerDirsManager ledgerDirsManager = new LedgerDirsManager(conf);
+        LedgerDirsManager ledgerDirsManager = new LedgerDirsManager(conf, conf.getLedgerDirs());
         EntryLogger el = new EntryLogger(conf, ledgerDirsManager);
         
         // Extracted from createNewLog()

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
Mon Dec  2 17:45:13 2013
@@ -171,7 +171,7 @@ public class EntryLogTest extends TestCa
         conf.setLedgerDirNames(new String[] { tmpDir.toString() });
         EntryLogger entryLogger = null;
         try {
-            entryLogger = new EntryLogger(conf, new LedgerDirsManager(conf));
+            entryLogger = new EntryLogger(conf, new LedgerDirsManager(conf, conf.getLedgerDirs()));
             fail("Expecting FileNotFoundException");
         } catch (FileNotFoundException e) {
             assertEquals("Entry log directory does not exist", e

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java
Mon Dec  2 17:45:13 2013
@@ -103,7 +103,7 @@ public class LedgerCacheTest extends Tes
             ledgerCache.close();
         }
         ledgerCache = ((InterleavedLedgerStorage) bookie.ledgerStorage).ledgerCache = new
LedgerCacheImpl(
-                conf, activeLedgers, bookie.getLedgerDirsManager());
+                conf, activeLedgers, bookie.getIndexDirsManager());
         flushThread = new Thread() {
                 public void run() {
                     while (true) {
@@ -280,7 +280,7 @@ public class LedgerCacheTest extends Tes
 
         ledgerStorage.addEntry(generateEntry(1, 3));
         // add the dir to failed dirs
-        bookie.getLedgerDirsManager().addToFilledDirs(
+        bookie.getIndexDirsManager().addToFilledDirs(
                 newFileInfo.getLf().getParentFile().getParentFile().getParentFile());
         File before = newFileInfo.getLf();
         // flush after disk is added as failed.

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/TestLedgerDirsManager.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/TestLedgerDirsManager.java?rev=1547123&r1=1547122&r2=1547123&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/TestLedgerDirsManager.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/TestLedgerDirsManager.java
Mon Dec  2 17:45:13 2013
@@ -50,7 +50,7 @@ public class TestLedgerDirsManager exten
         ServerConfiguration conf = TestBKConfiguration.newServerConfiguration();
         conf.setLedgerDirNames(new String[] {tmpDir.toString()});
 
-        dirsManager = new LedgerDirsManager(conf);
+        dirsManager = new LedgerDirsManager(conf, conf.getLedgerDirs());
     }
 
     @Test(timeout=60000)



Mime
View raw message