Merge branch 'cassandra-4.1' into trunk

This commit is contained in:
Ekaterina Dimitrova 2022-06-02 15:33:54 -04:00
commit ce4ae43a31
7 changed files with 37 additions and 9 deletions

View File

@ -8,6 +8,7 @@
* Add guardrail for ALTER TABLE ADD / DROP / REMOVE column operations (CASSANDRA-17495)
* Rename DisableFlag class to EnableFlag on guardrails (CASSANDRA-17544)
Merged from 4.1:
* Revert removal of withBufferSizeInMB(int size) in CQLSSTableWriter.Builder class and deprecate it in favor of withBufferSizeInMiB(int size) (CASSANDRA-17675)
* Remove expired snapshots of dropped tables after restart (CASSANDRA-17619)
* Handle config parameters upper bound on startup; Fix auto_snapshot_ttl and paxos_purge_grace_period min unit validations (CASSANDRA-17571)
* Fix leak of non-standard Java types in our Exceptions as clients using JMX are unable to handle them.

View File

@ -244,6 +244,9 @@ Upgrading
Deprecation
-----------
- `withBufferSizeInMB(int size)` in CQLSSTableWriter.Builder class is deprecated in favor of withBufferSizeInMiB(int size)
No change of functionality in the new one, only name change for clarity in regards to units and to follow naming
standartization.
- The properties `keyspace_count_warn_threshold` and `table_count_warn_threshold` in cassandra.yaml have been
deprecated in favour of the new `guardrails.keyspaces` and `guardrails.tables` properties and will be removed
in a subsequent major version. This also affects the setters and getters for those properties in the JMX MBean

View File

@ -821,13 +821,17 @@ name. Moreover, said statement must use bind variables since these
variables will be bound to values by the resulting SSTable writer. This
is a mandatory option.
|withBufferSizeInMB(int size) |The size of the buffer to use. This
|withBufferSizeInMiB(int size) |The size of the buffer to use. This
defines how much data will be buffered before being written as a new
SSTable. This corresponds roughly to the data size that will have the
created SSTable. The default is 128MB, which should be reasonable for a
1GB heap. If OutOfMemory exception gets generated while using the
SSTable writer, should lower this value.
|withBufferSizeInMB(int size) |Deprecated, and it will be available
at least until next major release. Please use withBufferSizeInMiB(int size)
which is the same method with a new name.
|sorted() |Creates a CQLSSTableWriter that expects sorted inputs. If
this option is used, the resulting SSTable writer will expect rows to be
added in SSTable sorted order (and an exception will be thrown if that

View File

@ -501,6 +501,26 @@ public class CQLSSTableWriter implements Closeable
return this;
}
/**
* This method is deprecated in favor of the new withBufferSizeInMiB(int size)
* The size of the buffer to use.
* <p>
* This defines how much data will be buffered before being written as
* a new SSTable. This correspond roughly to the data size that will have the created
* sstable.
* <p>
* The default is 128MiB, which should be reasonable for a 1GiB heap. If you experience
* OOM while using the writer, you should lower this value.
*
* @param size the size to use in MiB.
* @return this builder.
*/
@Deprecated
public Builder withBufferSizeInMB(int size)
{
return withBufferSizeInMiB(size);
}
/**
* Creates a CQLSSTableWriter that expects sorted inputs.
* <p>

View File

@ -76,7 +76,7 @@ public class CQLSSTableWriterLongTest
.inDirectory(dataDir)
.forTable(schema)
.using(insert)
.withBufferSizeInMiB(1)
.withBufferSizeInMB(1)
.build();
long high = 100;

View File

@ -187,7 +187,7 @@ public class CQLSSTableWriterTest
.inDirectory(dataDir)
.using(insert)
.forTable(schema)
.withBufferSizeInMiB(1)
.withBufferSizeInMB(1)
.build();
ByteBuffer val = ByteBuffer.allocate(1024 * 1050);
@ -215,7 +215,7 @@ public class CQLSSTableWriterTest
.inDirectory(dataDir)
.forTable(schema)
.using(insert)
.withBufferSizeInMiB(1)
.withBufferSizeInMB(1)
.build();
for (int i = 0 ; i < 50000 ; i++) {
@ -926,7 +926,7 @@ public class CQLSSTableWriterTest
.inDirectory(dataDir)
.forTable(schema)
.using(insert)
.withBufferSizeInMiB(1)
.withBufferSizeInMB(1)
.build();
final int ID_OFFSET = 1000;
@ -964,7 +964,7 @@ public class CQLSSTableWriterTest
.inDirectory(dataDir)
.forTable(schema)
.using(insert)
.withBufferSizeInMiB(1)
.withBufferSizeInMB(1)
.build();
for (int i = 0; i < 100; i++)
{
@ -1024,7 +1024,7 @@ public class CQLSSTableWriterTest
.inDirectory(dataDir)
.forTable(schema)
.using(insert)
.withBufferSizeInMiB(1)
.withBufferSizeInMB(1)
.build();
UUID uuid1 = UUIDs.timeBased();
UUID uuid2 = UUIDs.timeBased();
@ -1078,7 +1078,7 @@ public class CQLSSTableWriterTest
.inDirectory(dataDir)
.forTable(schema)
.using(insert)
.withBufferSizeInMiB(1)
.withBufferSizeInMB(1)
.build();
UUID uuid1 = UUIDs.startOf(0L);
UUID uuid2 = UUIDs.startOf(10000000L);

View File

@ -168,7 +168,7 @@ public class SSTableLoaderTest
.inDirectory(dataDir)
.forTable(String.format(schema, KEYSPACE1, CF_STANDARD2))
.using(String.format(query, KEYSPACE1, CF_STANDARD2))
.withBufferSizeInMiB(1)
.withBufferSizeInMB(1)
.build();
int NB_PARTITIONS = 5000; // Enough to write >1MiB and get at least one completed sstable before we've closed the writer