Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提供ip转long,和long转ip公共方法 #314

Merged
merged 24 commits into from
Oct 28, 2020
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d752dc5
broker管理接口修改
Sep 7, 2020
4ceab5b
Merge branch 'master' of https://github.com/chubaostream/joyqueue
Sep 8, 2020
1a9c4f6
Merge branch 'master' of https://github.com/chubaostream/joyqueue
Sep 15, 2020
ea207ed
openapi添加消费者监控
Sep 15, 2020
d7f472b
openapi添加消费者监控
Sep 16, 2020
73e1c4f
修复producer,consumer配置接口多处调用被覆盖的bug
Sep 25, 2020
afedf81
Merge branch 'master' of https://github.com/chubaostream/joyqueue
Sep 25, 2020
6391e53
Merge branch 'master' of https://github.com/chubaostream/joyqueue
Sep 25, 2020
460f7ed
修复producer,consumer配置接口多处调用被覆盖的bug
Sep 27, 2020
abe2de6
broker管理页搜索速度优化
Oct 9, 2020
f763c1e
broker管理页搜索速度优化
Oct 9, 2020
04b310f
openapi更新监控接口
Oct 10, 2020
7d44bfe
Merge branch 'master' of https://github.com/chubaostream/joyqueue int…
Oct 10, 2020
85b960e
topic主页添加查看消费者弹框
Oct 12, 2020
5636223
将ProducerConfig,ConsumerConfig基础类型字段改为装箱类型
Oct 13, 2020
e5dd2fb
将ProducerConfig,ConsumerConfig基础类型字段改为装箱类型
Oct 13, 2020
c019432
将生产者权重更新单独做成接口避免覆盖其他配置
Oct 13, 2020
552b774
将生产者权重更新单独做成接口避免覆盖其他配置
Oct 13, 2020
1d2a271
生产者/消费者配置添加默认值
Oct 15, 2020
99fe180
修改空broker列表查询报错
Oct 15, 2020
bcc946e
Merge branch 'master' of https://github.com/chubaostream/joyqueue int…
Oct 15, 2020
cc78cfa
Merge branch 'master' of https://github.com/chubaostream/joyqueue int…
Oct 20, 2020
0fbb662
提供ip转long,和long转ip公共方法
Oct 26, 2020
497a998
提供ip转long,和long转ip公共方法
Oct 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -985,5 +985,26 @@ public static boolean isValidIpV4Address(String value) {
return periods == 3;
}

public static long ip2Long(final String ip) {
String[] ipItem = ip.split("\\.");
assert ipItem.length == 4;
long[] ipNum = new long[4];
ipNum[0] = Long.parseLong(ipItem[0]);
ipNum[1] = Long.parseLong(ipItem[1]);
ipNum[2] = Long.parseLong(ipItem[2]);
ipNum[3] = Long.parseLong(ipItem[3]);
return (ipNum[0] << 24) + (ipNum[1] << 16) + (ipNum[2] << 8) + ipNum[3];
}

public static String long2Ip(final long num) {
return (num >>> 24) +
"." +
((num & 0x00FFFFFF) >>> 16) +
"." +
((num & 0x0000FFFF) >>> 8) +
"." +
(num & 0x000000FF);
}


}