Merge branch 'cassandra-3.11' into trunk

This commit is contained in:
Marcus Eriksson 2018-05-03 15:46:23 +02:00
commit 645d8278bc
6 changed files with 20 additions and 3 deletions

View File

@ -126,6 +126,14 @@ jobs:
exit ${RETURN}
fi
no_output_timeout: 15m
- run:
name: Run eclipse-warnings
command: |
export LANG=en_US.UTF-8
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
export PATH=$PATH:$ANT_HOME/bin:$JAVA_HOME/bin
cd ~/cassandra
ant eclipse-warnings
- persist_to_workspace:
root: /home/cassandra
paths:

View File

@ -34,6 +34,7 @@ public class CassandraKeyspaceWriteHandler implements KeyspaceWriteHandler
}
@Override
@SuppressWarnings("resource") // group is closed when CassandraWriteContext is closed
public WriteContext beginWrite(Mutation mutation, boolean makeDurable) throws RequestExecutionException
{
OpOrder.Group group = null;
@ -60,6 +61,7 @@ public class CassandraKeyspaceWriteHandler implements KeyspaceWriteHandler
}
}
@SuppressWarnings("resource") // group is closed when CassandraWriteContext is closed
private WriteContext createEmptyContext()
{
OpOrder.Group group = null;

View File

@ -144,7 +144,7 @@ public class CassandraStreamReader
{
return header != null? header.toHeader(metadata) : null; //pre-3.0 sstable have no SerializationHeader
}
@SuppressWarnings("resource")
protected SSTableMultiWriter createWriter(ColumnFamilyStore cfs, long totalSize, long repairedAt, UUID pendingRepair, SSTableFormat.Type format) throws IOException
{
Directories.DataDirectory localDir = cfs.getDirectories().getWriteableLocation(totalSize);

View File

@ -98,6 +98,7 @@ public class CassandraStreamReceiver implements StreamReceiver
}
@Override
@SuppressWarnings("resource")
public void received(IncomingStream stream)
{
CassandraIncomingFile file = getFile(stream);

View File

@ -117,7 +117,10 @@ public class MessageIn<T>
{
byte[] value = new byte[in.readInt()];
in.readFully(value);
builder.put(type, type.serializer.deserialize(new DataInputBuffer(value), version));
try (DataInputBuffer buffer = new DataInputBuffer(value))
{
builder.put(type, type.serializer.deserialize(buffer, version));
}
}
else
{

View File

@ -213,7 +213,10 @@ class MessageInHandler extends ByteToMessageDecoder
ParameterType parameterType = ParameterType.byName.get(key);
byte[] value = new byte[in.readInt()];
in.readBytes(value);
parameters.put(parameterType, parameterType.serializer.deserialize(new DataInputBuffer(value), messagingVersion));
try (DataInputBuffer buffer = new DataInputBuffer(value))
{
parameters.put(parameterType, parameterType.serializer.deserialize(buffer, messagingVersion));
}
}
return true;