Search in sources :

Example 31 with Storage

use of org.zalando.nakadi.domain.Storage in project nakadi by zalando.

the class StorageDbRepository method buildStorage.

static Storage buildStorage(final ObjectMapper mapper, final String id, final String type, final String config) throws SQLException {
    final Storage result = new Storage();
    result.setId(id);
    result.setType(Storage.Type.valueOf(type));
    try {
        result.parseConfiguration(mapper, config);
    } catch (final IOException ex) {
        throw new SQLException("Failed to restore storage with id " + result.getId(), ex);
    }
    return result;
}
Also used : Storage(org.zalando.nakadi.domain.Storage) SQLException(java.sql.SQLException) IOException(java.io.IOException)

Aggregations

Storage (org.zalando.nakadi.domain.Storage)31 Test (org.junit.Test)16 Timeline (org.zalando.nakadi.domain.Timeline)14 NakadiCursor (org.zalando.nakadi.domain.NakadiCursor)10 PartitionStatistics (org.zalando.nakadi.domain.PartitionStatistics)7 TopicRepository (org.zalando.nakadi.repository.TopicRepository)7 Date (java.util.Date)6 DefaultStorage (org.zalando.nakadi.domain.DefaultStorage)6 List (java.util.List)4 EventType (org.zalando.nakadi.domain.EventType)4 ServiceUnavailableException (org.zalando.nakadi.exceptions.ServiceUnavailableException)4 IOException (java.io.IOException)3 Collectors (java.util.stream.Collectors)3 DuplicatedStorageException (org.zalando.nakadi.exceptions.runtime.DuplicatedStorageException)3 TimelineService (org.zalando.nakadi.service.timeline.TimelineService)3 Cursor (org.zalando.nakadi.view.Cursor)3 SubscriptionCursorWithoutToken (org.zalando.nakadi.view.SubscriptionCursorWithoutToken)3 Collections (java.util.Collections)2 Optional (java.util.Optional)2 Logger (org.slf4j.Logger)2