mirror of https://github.com/apache/cassandra
Bump the hints messaging version to match the current one
patch by Jay Zhuang; reviewed by Aleksey Yeschenko for CASSANDRA-14536
This commit is contained in:
parent
5cc68a8735
commit
062ca4c7ca
|
|
@ -1,4 +1,5 @@
|
||||||
4.0
|
4.0
|
||||||
|
* Bump the hints messaging version to match the current one (CASSANDRA-14536)
|
||||||
* OffsetAwareConfigurationLoader doesn't set ssl storage port causing bind errors in CircleCI (CASSANDRA-14546)
|
* OffsetAwareConfigurationLoader doesn't set ssl storage port causing bind errors in CircleCI (CASSANDRA-14546)
|
||||||
* Report why native_transport_port fails to bind (CASSANDRA-14544)
|
* Report why native_transport_port fails to bind (CASSANDRA-14544)
|
||||||
* Optimize internode messaging protocol (CASSANDRA-14485)
|
* Optimize internode messaging protocol (CASSANDRA-14485)
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,8 @@ final class HintsDescriptor
|
||||||
private static final Logger logger = LoggerFactory.getLogger(HintsDescriptor.class);
|
private static final Logger logger = LoggerFactory.getLogger(HintsDescriptor.class);
|
||||||
|
|
||||||
static final int VERSION_30 = 1;
|
static final int VERSION_30 = 1;
|
||||||
static final int CURRENT_VERSION = VERSION_30;
|
static final int VERSION_40 = 2;
|
||||||
|
static final int CURRENT_VERSION = VERSION_40;
|
||||||
|
|
||||||
static final String COMPRESSION = "compression";
|
static final String COMPRESSION = "compression";
|
||||||
static final String ENCRYPTION = "encryption";
|
static final String ENCRYPTION = "encryption";
|
||||||
|
|
@ -215,6 +216,8 @@ final class HintsDescriptor
|
||||||
{
|
{
|
||||||
case VERSION_30:
|
case VERSION_30:
|
||||||
return MessagingService.VERSION_30;
|
return MessagingService.VERSION_30;
|
||||||
|
case VERSION_40:
|
||||||
|
return MessagingService.VERSION_40;
|
||||||
default:
|
default:
|
||||||
throw new AssertionError();
|
throw new AssertionError();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,11 @@ import org.junit.Test;
|
||||||
|
|
||||||
import org.apache.cassandra.io.compress.LZ4Compressor;
|
import org.apache.cassandra.io.compress.LZ4Compressor;
|
||||||
import org.apache.cassandra.io.util.DataOutputBuffer;
|
import org.apache.cassandra.io.util.DataOutputBuffer;
|
||||||
|
import org.apache.cassandra.net.MessagingService;
|
||||||
|
|
||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
import static junit.framework.Assert.assertNotSame;
|
import static junit.framework.Assert.assertNotSame;
|
||||||
|
import static junit.framework.Assert.assertTrue;
|
||||||
import static junit.framework.Assert.fail;
|
import static junit.framework.Assert.fail;
|
||||||
|
|
||||||
public class HintsDescriptorTest
|
public class HintsDescriptorTest
|
||||||
|
|
@ -115,6 +117,17 @@ public class HintsDescriptorTest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testMessagingVersion()
|
||||||
|
{
|
||||||
|
String errorMsg = "Please update the current Hints messaging version to match the current messaging version";
|
||||||
|
int messageVersion = HintsDescriptor.messagingVersion(HintsDescriptor.CURRENT_VERSION);
|
||||||
|
assertEquals(errorMsg, messageVersion, MessagingService.current_version);
|
||||||
|
|
||||||
|
HintsDescriptor descriptor = new HintsDescriptor(UUID.randomUUID(), HintsDescriptor.CURRENT_VERSION, System.currentTimeMillis(), ImmutableMap.of());
|
||||||
|
assertEquals(errorMsg, descriptor.messagingVersion(), MessagingService.current_version);
|
||||||
|
}
|
||||||
|
|
||||||
private static void testSerializeDeserializeLoop(HintsDescriptor descriptor) throws IOException
|
private static void testSerializeDeserializeLoop(HintsDescriptor descriptor) throws IOException
|
||||||
{
|
{
|
||||||
// serialize to a byte array
|
// serialize to a byte array
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue