com.facebook.presto.spi.predicate.Marker Java Examples
The following examples show how to use
com.facebook.presto.spi.predicate.Marker.
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: EthereumBlockRange.java From presto-ethereum with Apache License 2.0 | 5 votes |
public static EthereumBlockRange fromMarkers(Marker low, Marker high) { long startBlock; long endBlock; if (low.isLowerUnbounded()) { startBlock = 1L; } else if (low.getBound() == Marker.Bound.EXACTLY) { startBlock = (long) low.getValue(); } else if (low.getBound() == Marker.Bound.ABOVE) { startBlock = (long) low.getValue() + 1L; } else { throw new IllegalArgumentException("Low bound cannot be BELOW"); } if (high.isUpperUnbounded()) { endBlock = -1L; } else if (high.getBound() == Marker.Bound.EXACTLY) { endBlock = (long) high.getValue(); } else if (high.getBound() == Marker.Bound.BELOW) { endBlock = (long) high.getValue() - 1L; } else { throw new IllegalArgumentException("High bound cannot be ABOVE"); } if (startBlock > endBlock && endBlock != -1L) { throw new IllegalArgumentException("Low bound is greater than high bound"); } return new EthereumBlockRange(startBlock, endBlock); }