add CALCULATE_SEGMENT API proto ,update to generate java code