Java Code Examples for org.apache.bookkeeper.client.BKException#BKUnexpectedConditionException

The following examples show how to use org.apache.bookkeeper.client.BKException#BKUnexpectedConditionException . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestLedgerHandleCache.java    From distributedlog with Apache License 2.0 5 votes vote down vote up
@Test(timeout = 60000, expected = BKException.BKUnexpectedConditionException.class)
public void testReadLastConfirmedWithoutOpeningLedger() throws Exception {
    LedgerDescriptor desc = new LedgerDescriptor(9999, 9999, false);
    LedgerHandleCache cache =
            LedgerHandleCache.newBuilder().bkc(bkc).conf(conf).build();
    // read last confirmed
    cache.tryReadLastConfirmed(desc);
}
 
Example 2
Source File: TestLedgerHandleCache.java    From distributedlog with Apache License 2.0 5 votes vote down vote up
@Test(timeout = 60000, expected = BKException.BKUnexpectedConditionException.class)
public void testReadEntriesWithoutOpeningLedger() throws Exception {
    LedgerDescriptor desc = new LedgerDescriptor(9999, 9999, false);
    LedgerHandleCache cache =
            LedgerHandleCache.newBuilder().bkc(bkc).conf(conf).build();
    // read entries
    cache.readEntries(desc, 0, 10);
}
 
Example 3
Source File: TestLedgerHandleCache.java    From distributedlog with Apache License 2.0 5 votes vote down vote up
@Test(timeout = 60000, expected = BKException.BKUnexpectedConditionException.class)
public void testGetLastConfirmedWithoutOpeningLedger() throws Exception {
    LedgerDescriptor desc = new LedgerDescriptor(9999, 9999, false);
    LedgerHandleCache cache =
            LedgerHandleCache.newBuilder().bkc(bkc).conf(conf).build();
    // read entries
    cache.getLastAddConfirmed(desc);
}
 
Example 4
Source File: TestLedgerHandleCache.java    From distributedlog with Apache License 2.0 5 votes vote down vote up
@Test(timeout = 60000, expected = BKException.BKUnexpectedConditionException.class)
public void testReadLastConfirmedAndEntryWithoutOpeningLedger() throws Exception {
    LedgerDescriptor desc = new LedgerDescriptor(9999, 9999, false);
    LedgerHandleCache cache =
            LedgerHandleCache.newBuilder().bkc(bkc).conf(conf).build();
    // read entries
    FutureUtils.bkResult(cache.asyncReadLastConfirmedAndEntry(desc, 1L, 200L, false));
}
 
Example 5
Source File: TestLedgerHandleCache.java    From distributedlog with Apache License 2.0 5 votes vote down vote up
@Test(timeout = 60000, expected = BKException.BKUnexpectedConditionException.class)
public void testGetLengthWithoutOpeningLedger() throws Exception {
    LedgerDescriptor desc = new LedgerDescriptor(9999, 9999, false);
    LedgerHandleCache cache =
            LedgerHandleCache.newBuilder().bkc(bkc).conf(conf).build();
    // read entries
    cache.getLength(desc);
}