### Question:
Log { private void roll(int index) throws IOException { roll(index, null); } private  Log(long checkpointInterval, long maxFileSize, int queueCapacity,
      int logWriteTimeout, int checkpointWriteTimeout,
      boolean useDualCheckpoints, File checkpointDir, File backupCheckpointDir,
      String name, boolean useLogReplayV1, boolean useFastReplay,
      long minimumRequiredSpace, @Nullable KeyProvider encryptionKeyProvider,
      @Nullable String encryptionKeyAlias,
      @Nullable String encryptionCipherProvider,
      long usableSpaceRefreshInterval, File... logDirs); @VisibleForTesting int getReadCount(); @VisibleForTesting int getPutCount(); @VisibleForTesting int getTakeCount(); @VisibleForTesting int getCommittedCount(); @VisibleForTesting int getRollbackCount(); static final String PREFIX; static final String FILE_LOCK; static final Set<String> EXCLUDES; }### Answer:
@Test public void testRoll() throws IOException, InterruptedException, NoopRecordException { log.shutdownWorker(); Thread.sleep(1000); for (int i = 0; i < 1000; i++) { FlumeEvent eventIn = TestUtils.newPersistableEvent(); long transactionID = ++this.transactionID; FlumeEventPointer eventPointer = log.put(transactionID, eventIn); FlumeEvent eventOut = log.get(eventPointer); Assert.assertNotNull(eventOut); Assert.assertEquals(eventIn.getHeaders(), eventOut.getHeaders()); Assert.assertArrayEquals(eventIn.getBody(), eventOut.getBody()); } int logCount = 0; for(File dataDir : dataDirs) { for(File logFile : dataDir.listFiles()) { if(logFile.getName().startsWith("log-")) { logCount++; } } } Assert.assertEquals(186, logCount); }