mirror of https://github.com/apache/cassandra
Merge branch 'trunk' of https://git-wip-us.apache.org/repos/asf/cassandra into trunk
This commit is contained in:
commit
dfddeb44c7
|
|
@ -1,4 +1,5 @@
|
|||
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)
|
||||
* Report why native_transport_port fails to bind (CASSANDRA-14544)
|
||||
* Optimize internode messaging protocol (CASSANDRA-14485)
|
||||
|
|
|
|||
|
|
@ -61,7 +61,8 @@ final class HintsDescriptor
|
|||
private static final Logger logger = LoggerFactory.getLogger(HintsDescriptor.class);
|
||||
|
||||
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 ENCRYPTION = "encryption";
|
||||
|
|
@ -215,6 +216,8 @@ final class HintsDescriptor
|
|||
{
|
||||
case VERSION_30:
|
||||
return MessagingService.VERSION_30;
|
||||
case VERSION_40:
|
||||
return MessagingService.VERSION_40;
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,11 @@ import org.junit.Test;
|
|||
|
||||
import org.apache.cassandra.io.compress.LZ4Compressor;
|
||||
import org.apache.cassandra.io.util.DataOutputBuffer;
|
||||
import org.apache.cassandra.net.MessagingService;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNotSame;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
import static junit.framework.Assert.fail;
|
||||
|
||||
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
|
||||
{
|
||||
// serialize to a byte array
|
||||
|
|
|
|||
Loading…
Reference in New Issue