Search in sources :

Example 6 with BuildInfo

use of com.hazelcast.instance.BuildInfo in project hazelcast by hazelcast.

the class BuildInfoPluginTest method test.

@Test
public void test() throws IOException {
    plugin.run(logWriter);
    BuildInfo buildInfo = BuildInfoProvider.getBuildInfo();
    assertContains("BuildNumber=" + buildInfo.getBuildNumber());
    assertContains("Build=" + buildInfo.getBuild());
    assertContains("Revision=" + buildInfo.getRevision());
    assertContains("Version=" + buildInfo.getVersion());
    assertContains("SerialVersion=" + buildInfo.getSerializationVersion());
    assertContains("Enterprise=" + buildInfo.isEnterprise());
}
Also used : BuildInfo(com.hazelcast.instance.BuildInfo) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 7 with BuildInfo

use of com.hazelcast.instance.BuildInfo in project hazelcast-simulator by hazelcast.

the class HazelcastTestUtils method failOnVersionMismatch.

public static void failOnVersionMismatch(String minVersion, String message) {
    BuildInfo buildInfo = BuildInfoProvider.getBuildInfo();
    String actualVersion = buildInfo.getVersion();
    LOGGER.info("Compare version " + actualVersion + " with minimum version " + minVersion + ": " + isMinVersion(minVersion, actualVersion));
    if (!isMinVersion(minVersion, actualVersion)) {
        fail(format(message, minVersion));
    }
}
Also used : BuildInfo(com.hazelcast.instance.BuildInfo)

Example 8 with BuildInfo

use of com.hazelcast.instance.BuildInfo in project hazelcast by hazelcast.

the class ClusterJoinManager method sendMasterQuestion.

/**
 * Send a {@link WhoisMasterOp} to designated address.
 *
 * @param toAddress the address to which the operation will be sent.
 * @return {@code true} if the operation was sent, otherwise {@code false}.
 */
public boolean sendMasterQuestion(Address toAddress) {
    checkNotNull(toAddress, "No endpoint is specified!");
    BuildInfo buildInfo = node.getBuildInfo();
    Address thisAddress = node.getThisAddress();
    JoinMessage joinMessage = new JoinMessage(Packet.VERSION, buildInfo.getBuildNumber(), node.getVersion(), thisAddress, clusterService.getThisUuid(), node.isLiteMember(), node.createConfigCheck());
    return nodeEngine.getOperationService().send(new WhoisMasterOp(joinMessage), toAddress);
}
Also used : Address(com.hazelcast.cluster.Address) WhoisMasterOp(com.hazelcast.internal.cluster.impl.operations.WhoisMasterOp) BuildInfo(com.hazelcast.instance.BuildInfo)

Example 9 with BuildInfo

use of com.hazelcast.instance.BuildInfo in project hazelcast by hazelcast.

the class OperationExecutorImpl_AbstractTest method setup.

@Before
public void setup() throws Exception {
    loggingService = new LoggingServiceImpl("foo", "jdk", new BuildInfo("1", "1", "1", 1, false, (byte) 1, "1"), true, null);
    serializationService = new DefaultSerializationServiceBuilder().build();
    config = smallInstanceConfig();
    thisAddress = new Address("localhost", 5701);
    Node node = Mockito.mock(Node.class);
    when(node.getConfig()).thenReturn(config);
    when(node.getProperties()).thenReturn(new HazelcastProperties(config));
    when(node.getVersion()).thenReturn(new MemberVersion(0, 0, 0));
    nodeExtension = new DefaultNodeExtension(node);
    handlerFactory = new DummyOperationRunnerFactory();
    responsePacketConsumer = new DummyResponsePacketConsumer();
}
Also used : DefaultSerializationServiceBuilder(com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder) HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) DefaultNodeExtension(com.hazelcast.instance.impl.DefaultNodeExtension) Address(com.hazelcast.cluster.Address) LoggingServiceImpl(com.hazelcast.logging.impl.LoggingServiceImpl) BuildInfo(com.hazelcast.instance.BuildInfo) Node(com.hazelcast.instance.impl.Node) MemberVersion(com.hazelcast.version.MemberVersion) Before(org.junit.Before)

Example 10 with BuildInfo

use of com.hazelcast.instance.BuildInfo in project hazelcast by hazelcast.

the class LifecycleServiceImpl method fireLifecycleEvent.

public void fireLifecycleEvent(LifecycleEvent.LifecycleState lifecycleState) {
    final LifecycleEvent lifecycleEvent = new LifecycleEvent(lifecycleState);
    String revision = buildInfo.getRevision();
    if (isNullOrEmpty(revision)) {
        revision = "";
    } else {
        revision = " - " + revision;
        BuildInfo upstreamInfo = buildInfo.getUpstreamBuildInfo();
        if (upstreamInfo != null) {
            String upstreamRevision = upstreamInfo.getRevision();
            if (!isNullOrEmpty(upstreamRevision)) {
                revision += ", " + upstreamRevision;
            }
        }
    }
    getLogger().info("HazelcastClient " + buildInfo.getVersion() + " (" + buildInfo.getBuild() + revision + ") is " + lifecycleEvent.getState());
    executor.execute(new Runnable() {

        @Override
        public void run() {
            for (LifecycleListener lifecycleListener : lifecycleListeners.values()) {
                lifecycleListener.stateChanged(lifecycleEvent);
            }
        }
    });
}
Also used : BuildInfo(com.hazelcast.instance.BuildInfo) LifecycleEvent(com.hazelcast.core.LifecycleEvent) LifecycleListener(com.hazelcast.core.LifecycleListener)

Aggregations

BuildInfo (com.hazelcast.instance.BuildInfo)11 Address (com.hazelcast.cluster.Address)2 LifecycleEvent (com.hazelcast.core.LifecycleEvent)2 LifecycleListener (com.hazelcast.core.LifecycleListener)2 JetBuildInfo (com.hazelcast.instance.JetBuildInfo)1 DefaultNodeExtension (com.hazelcast.instance.impl.DefaultNodeExtension)1 Node (com.hazelcast.instance.impl.Node)1 WhoisMasterOp (com.hazelcast.internal.cluster.impl.operations.WhoisMasterOp)1 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)1 LoggingServiceImpl (com.hazelcast.logging.impl.LoggingServiceImpl)1 PrivateApi (com.hazelcast.spi.annotation.PrivateApi)1 HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 MemberVersion (com.hazelcast.version.MemberVersion)1 Before (org.junit.Before)1 Test (org.junit.Test)1