incubator-crail icon indicating copy to clipboard operation
incubator-crail copied to clipboard

can locationClass work properly?

Open eillon opened this issue 5 years ago • 1 comments

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.

eillon avatar Mar 25 '19 15:03 eillon

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

patrickstuedi avatar Jun 11 '19 08:06 patrickstuedi