Search in sources :

Example 1 with TruncateCommand

use of org.apache.distributedlog.tools.DistributedLogTool.TruncateCommand in project bookkeeper by apache.

the class TestDistributedLogTool method testToolTruncate.

@Test(timeout = 60000)
public void testToolTruncate() throws Exception {
    DistributedLogManager dlm = DLMTestUtil.createNewDLM("TruncateStream", conf, defaultUri);
    DLMTestUtil.generateCompletedLogSegments(dlm, conf, 3, 1000);
    dlm.close();
    TruncateCommand cmd = new TruncateCommand();
    cmd.setUri(defaultUri);
    cmd.setFilter("TruncateStream");
    cmd.setForce(true);
    assertEquals(0, cmd.runCmd());
}
Also used : TruncateCommand(org.apache.distributedlog.tools.DistributedLogTool.TruncateCommand) DistributedLogManager(org.apache.distributedlog.api.DistributedLogManager) Test(org.junit.Test)

Aggregations

DistributedLogManager (org.apache.distributedlog.api.DistributedLogManager)1 TruncateCommand (org.apache.distributedlog.tools.DistributedLogTool.TruncateCommand)1 Test (org.junit.Test)1