forked from vesoft-inc/nebula-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support to convert internal storage address to available address for …
…client (vesoft-inc#604)
- Loading branch information
Showing
3 changed files
with
115 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* Copyright (c) 2024 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
package com.vesoft.nebula.util; | ||
|
||
import com.vesoft.nebula.HostAddr; | ||
|
||
/** | ||
* The util of network | ||
* | ||
* @Author jiangyiwang-jk | ||
* @Date 2024/2/1 15:36 | ||
*/ | ||
public class NetUtil { | ||
|
||
public static HostAddr parseHostAddr(String hostAddress) { | ||
assert hostAddress != null : "Host address should not be null"; | ||
String[] hostPort = hostAddress.split(":"); | ||
assert hostPort.length == 2 : String.format("Invalid host address %s", hostAddress); | ||
return new HostAddr(hostPort[0].trim(), Integer.parseInt(hostPort[1].trim())); | ||
} | ||
|
||
} |