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

PerformanceLogFile only compiles if using JDK 1.7 or above #5729

Closed
juanavelez opened this issue Jul 17, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@juanavelez
Copy link

commented Jul 17, 2015

com.hazelcast.internal.monitors.PerformanceLogFile was recently added (7/15). It makes use of InetSocketAddress.getHostString() which is only public in JDK 1.7 and above.

When compiling using JDK 1.6 (per Maven property jdk.version), this raises an error.

    /**
     * Returns the hostname, or the String form of the address if it
     * doesn't have a hostname (it was created using a literal).
     * This has the benefit of <b>not</b> attempting a reverse lookup.
     *
     * @return the hostname, or String representation of the address.
     * @since 1.7
     */
    public final String getHostString() {
        return holder.getHostString();
    }
    private String getPathName() {
        Member localMember = hazelcastInstance.getCluster().getLocalMember();
        InetSocketAddress address = localMember.getSocketAddress();
        String addressString = address.getHostString().replace(":", "_") + "#" + address.getPort();
        return "performance-" + addressString + "-" + currentTimeMillis() + "-%03d.log";
    }

Please note that building using maven and JDK 1.7 does not generate the compilation error, only when the JDK 1.6 is used.

@Donnerbart

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2015

@pveentjer: Can you have a look? This seems to be a file from your new Metrics functionality, if I'm not wrong.

@pveentjer

This comment has been minimized.

Copy link
Member

commented Jul 18, 2015

I'll have a look at it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.