incubator-crail
incubator-crail copied to clipboard
can locationClass work properly?
in my view, the locationClass is initialized by this function:
public static CrailLocationClass getLocationClass() throws UnknownHostException{
return CrailLocationClass.get(InetAddress.getLocalHost().getCanonicalHostName().hashCode());
}
The locationClass is a String's hashCode, so it can be a negative number. However, in your code, the negative locationClass doesn't work at all.I think remove the judge of locationClass will be better.
Thanks for catching this. It seems, though, there are more changes required to fix this. Like this check here: https://github.com/apache/incubator-crail/blob/95275d3bb15df5f99e1418cbaeed2e6c8fd8073e/namenode/src/main/java/org/apache/crail/namenode/NameNodeService.java#L95
should probably be != 0