@Override public void setClientVersion(String version) { clientVersionString = version; clientVersion = BuildInfo.calculateVersion(version); }
@Override public void setClientVersion(String version) { clientVersionString = version; clientVersion = BuildInfo.calculateVersion(version); }
public void setConnectedServerVersion(String connectedServerVersion) { this.connectedServerVersionString = connectedServerVersion; this.connectedServerVersion = BuildInfo.calculateVersion(connectedServerVersion); }
public void setConnectedServerVersion(String connectedServerVersion) { this.connectedServerVersionString = connectedServerVersion; this.connectedServerVersion = BuildInfo.calculateVersion(connectedServerVersion); }
public void listenPartitionTable(Connection ownerConnection) throws Exception { //when we connect to cluster back we need to reset partition state version lastPartitionStateVersion = -1; if (((ClientConnection) ownerConnection).getConnectedServerVersion() >= BuildInfo.calculateVersion("3.9")) { //Servers after 3.9 supports listeners ClientMessage clientMessage = ClientAddPartitionListenerCodec.encodeRequest(); ClientInvocation invocation = new ClientInvocation(client, clientMessage, null, ownerConnection); invocation.setEventHandler(this); invocation.invokeUrgent().get(); } }
public void listenPartitionTable(Connection ownerConnection) throws Exception { //when we connect to cluster back we need to reset partition state version lastPartitionStateVersion = -1; if (((ClientConnection) ownerConnection).getConnectedServerVersion() >= BuildInfo.calculateVersion("3.9")) { //Servers after 3.9 supports listeners ClientMessage clientMessage = ClientAddPartitionListenerCodec.encodeRequest(); ClientInvocation invocation = new ClientInvocation(client, clientMessage, null, ownerConnection); invocation.setEventHandler(this); invocation.invokeUrgent().get(); } }
private void monitor(ClientEndpoint clientEndpoint) { // C++ client does not send heartbeat over its owner connection for versions before 3.10 // We are skipping checking heartbeat for cpp owner connection on those versions. if (clientEndpoint.isOwnerConnection() && ClientType.CPP.equals(clientEndpoint.getClientType()) && clientEndpoint.getClientVersion() < BuildInfo.calculateVersion("3.10")) { return; } Connection connection = clientEndpoint.getConnection(); long lastTimePacketReceived = connection.lastReadTimeMillis(); long timeoutInMillis = SECONDS.toMillis(heartbeatTimeoutSeconds); long currentTimeMillis = Clock.currentTimeMillis(); if (lastTimePacketReceived + timeoutInMillis < currentTimeMillis) { String message = "Client heartbeat is timed out, closing connection to " + connection + ". Now: " + timeToString(currentTimeMillis) + ". LastTimePacketReceived: " + timeToString(lastTimePacketReceived); connection.close(message, null); } } }
private void monitor(ClientEndpoint clientEndpoint) { // C++ client does not send heartbeat over its owner connection for versions before 3.10 // We are skipping checking heartbeat for cpp owner connection on those versions. if (clientEndpoint.isOwnerConnection() && ClientType.CPP.equals(clientEndpoint.getClientType()) && clientEndpoint.getClientVersion() < BuildInfo.calculateVersion("3.10")) { return; } Connection connection = clientEndpoint.getConnection(); long lastTimePacketReceived = connection.lastReadTimeMillis(); long timeoutInMillis = SECONDS.toMillis(heartbeatTimeoutSeconds); long currentTimeMillis = Clock.currentTimeMillis(); if (lastTimePacketReceived + timeoutInMillis < currentTimeMillis) { String message = "Client heartbeat is timed out, closing connection to " + connection + ". Now: " + timeToString(currentTimeMillis) + ". LastTimePacketReceived: " + timeToString(lastTimePacketReceived); connection.close(message, null); } } }