|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | + * contributor license agreements. See the NOTICE file distributed with |
| 4 | + * this work for additional information regarding copyright ownership. |
| 5 | + * The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | + * (the "License"); you may not use this file except in compliance with |
| 7 | + * the License. You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | +package org.apache.kafka.streams.state.internals; |
| 18 | + |
| 19 | +import org.apache.kafka.streams.state.HeadersBytesStore; |
| 20 | +import org.apache.kafka.streams.state.TimestampedBytesStore; |
| 21 | + |
| 22 | +/** |
| 23 | + * RocksDB-backed timestamped window store with support for record headers. |
| 24 | + * <p> |
| 25 | + * This store extends {@link RocksDBWindowStore} and implements both |
| 26 | + * {@link TimestampedBytesStore} (for timestamp support) and {@link HeadersBytesStore} |
| 27 | + * (for header support) marker interfaces. |
| 28 | + * <p> |
| 29 | + * The storage format for values is: [headersSize(varint)][headersBytes][timestamp(8)][value] |
| 30 | + * <p> |
| 31 | + * This implementation uses segment-level versioning for backward compatibility: |
| 32 | + * <ul> |
| 33 | + * <li>Old segments continue to use the legacy format without headers</li> |
| 34 | + * <li>New segments use the header-embedded format</li> |
| 35 | + * <li>Legacy values are served with empty headers on read</li> |
| 36 | + * <li>All new writes use the new format</li> |
| 37 | + * </ul> |
| 38 | + * |
| 39 | + * @see RocksDBWindowStore |
| 40 | + * @see HeadersBytesStore |
| 41 | + * @see TimestampedBytesStore |
| 42 | + */ |
| 43 | +class RocksDBTimestampedWindowStoreWithHeaders extends RocksDBWindowStore implements TimestampedBytesStore, HeadersBytesStore { |
| 44 | + |
| 45 | + RocksDBTimestampedWindowStoreWithHeaders(final SegmentedBytesStore bytesStore, |
| 46 | + final boolean retainDuplicates, |
| 47 | + final long windowSize) { |
| 48 | + super(bytesStore, retainDuplicates, windowSize); |
| 49 | + } |
| 50 | +} |
0 commit comments