Function to split an IP prefix into subnets (#2)#23656
Merged
NikhilCollooru merged 1 commit intoprestodb:masterfrom Sep 20, 2024
Merged
Function to split an IP prefix into subnets (#2)#23656NikhilCollooru merged 1 commit intoprestodb:masterfrom
NikhilCollooru merged 1 commit intoprestodb:masterfrom
Conversation
elharo
previously approved these changes
Sep 15, 2024
steveburnett
previously approved these changes
Sep 16, 2024
Contributor
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Pull branch, local doc build, looks good. Thanks!
kaikalur
reviewed
Sep 19, 2024
| { | ||
| private static final BigInteger TWO = BigInteger.valueOf(2); | ||
|
|
||
| private static final Block emptyBlock = IPPREFIX.createBlockBuilder(null, 0).build(); |
Contributor
There was a problem hiding this comment.
We generally use all upper case for static constants
kaikalur
previously approved these changes
Sep 19, 2024
NikhilCollooru
previously approved these changes
Sep 19, 2024
reviewer feedback
014609a
90d4e5a to
014609a
Compare
NikhilCollooru
approved these changes
Sep 19, 2024
25 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change introduces a function
ip_prefix_subnetsthat, given an inputip_prefixand a subnetprefix_length, splits the IP prefix into subnets of the input prefix length. The functions return an array of new prefixes of the new input prefix length.This is a new but identical PR to #23515 that I couldn't not figure out how to recover after a botched attempt to merge and squash.
This is a complimentary sister function to the
ip_prefix_collapsefunction.Motivation and Context
This change addresses issue 23514.
Impact
This change introduces a new user-facing function
ip_prefix_subnets.Test Plan
Unit tests
mvn clean install -Dtest=TestIpPrefixFunctions -Dmaven.javadoc.skip=true -DskipUI -T1C -fn -pl presto-mainContributor checklist