|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | + * you may not use this file except in compliance with the License. |
| 4 | + * You may obtain a copy of the License at |
| 5 | + * |
| 6 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | + * |
| 8 | + * Unless required by applicable law or agreed to in writing, software |
| 9 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | + * See the License for the specific language governing permissions and |
| 12 | + * limitations under the License. |
| 13 | + */ |
| 14 | +package com.facebook.presto.iceberg; |
| 15 | + |
| 16 | +import com.facebook.presto.spi.ConnectorPageSource; |
| 17 | + |
| 18 | +import java.util.Optional; |
| 19 | + |
| 20 | +import static java.util.Objects.requireNonNull; |
| 21 | + |
| 22 | +public class ConnectorPageSourceWithRowPositions |
| 23 | +{ |
| 24 | + private final ConnectorPageSource delegate; |
| 25 | + private final Optional<Long> startRowPosition; |
| 26 | + private final Optional<Long> endRowPosition; |
| 27 | + |
| 28 | + public ConnectorPageSourceWithRowPositions( |
| 29 | + ConnectorPageSource delegate, |
| 30 | + Optional<Long> startRowPosition, |
| 31 | + Optional<Long> endRowPosition) |
| 32 | + { |
| 33 | + this.delegate = requireNonNull(delegate, "delegate is null"); |
| 34 | + this.startRowPosition = requireNonNull(startRowPosition, "startRowPosition is null"); |
| 35 | + this.endRowPosition = requireNonNull(endRowPosition, "endRowPosition is null"); |
| 36 | + } |
| 37 | + |
| 38 | + public ConnectorPageSource getDelegate() |
| 39 | + { |
| 40 | + return delegate; |
| 41 | + } |
| 42 | + |
| 43 | + public Optional<Long> getStartRowPosition() |
| 44 | + { |
| 45 | + return startRowPosition; |
| 46 | + } |
| 47 | + |
| 48 | + public Optional<Long> getEndRowPosition() |
| 49 | + { |
| 50 | + return endRowPosition; |
| 51 | + } |
| 52 | +} |
0 commit comments