You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2022/05/13 11:59:36 UTC

[cassandra] branch cassandra-4.1 updated (f57c8d2c25 -> 7dbea1a8cb)

This is an automated email from the ASF dual-hosted git repository.

brandonwilliams pushed a change to branch cassandra-4.1
in repository https://gitbox.apache.org/repos/asf/cassandra.git


    from f57c8d2c25 Fix repair_request_timeout_in_ms and remove paxos_auto_repair_threshold_mb patch by Benedict Elliott Smith and Ekaterina Dimitrova; reviewed by Benedict Elliott Smith and Blake Eggleston for CASSANDRA-17557
     new 5d427ff6e5 Fsync TOC and Digest files after they're written
     new d043217ff0 Merge branch 'cassandra-3.0' into cassandra-3.11
     new ac0266be69 Merge branch 'cassandra-3.11' into cassandra-4.0
     new 7dbea1a8cb Merge branch 'cassandra-4.0' into cassandra-4.1

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGES.txt                                               |  1 +
 src/java/org/apache/cassandra/io/sstable/SSTable.java     |  6 +++++-
 src/java/org/apache/cassandra/io/util/ChecksumWriter.java | 11 ++++++-----
 3 files changed, 12 insertions(+), 6 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[cassandra] 01/01: Merge branch 'cassandra-4.0' into cassandra-4.1

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brandonwilliams pushed a commit to branch cassandra-4.1
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 7dbea1a8cb92d14f97532615b39d9aa20625b403
Merge: f57c8d2c25 ac0266be69
Author: Brandon Williams <br...@apache.org>
AuthorDate: Fri May 13 06:54:46 2022 -0500

    Merge branch 'cassandra-4.0' into cassandra-4.1

 CHANGES.txt                                               |  1 +
 src/java/org/apache/cassandra/io/sstable/SSTable.java     |  6 +++++-
 src/java/org/apache/cassandra/io/util/ChecksumWriter.java | 11 ++++++-----
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --cc src/java/org/apache/cassandra/io/sstable/SSTable.java
index c7de53604f,20aac5ef0a..488a7dc45a
--- a/src/java/org/apache/cassandra/io/sstable/SSTable.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTable.java
@@@ -46,6 -39,6 +46,7 @@@ import org.apache.cassandra.dht.IPartit
  import org.apache.cassandra.dht.Token;
  import org.apache.cassandra.io.FSWriteError;
  import org.apache.cassandra.io.util.DiskOptimizationStrategy;
++import org.apache.cassandra.io.util.FileOutputStreamPlus;
  import org.apache.cassandra.io.util.FileUtils;
  import org.apache.cassandra.io.util.RandomAccessReader;
  import org.apache.cassandra.schema.TableMetadata;
@@@ -351,10 -336,13 +352,13 @@@ public abstract class SSTabl
      protected static void appendTOC(Descriptor descriptor, Collection<Component> components)
      {
          File tocFile = new File(descriptor.filenameFor(Component.TOC));
-         try (PrintWriter w = new PrintWriter(tocFile.newWriter(APPEND)))
 -        try (FileOutputStream fos = new FileOutputStream(tocFile);
 -             PrintWriter w = new PrintWriter(fos))
++        try (FileOutputStreamPlus out = tocFile.newOutputStream(APPEND);
++             PrintWriter w = new PrintWriter(out))
          {
              for (Component component : components)
                  w.println(component.name);
+             w.flush();
 -            fos.getFD().sync();
++            out.sync();
          }
          catch (IOException e)
          {
diff --cc src/java/org/apache/cassandra/io/util/ChecksumWriter.java
index d8ba360bb3,50aaccbc7c..93030a2fd4
--- a/src/java/org/apache/cassandra/io/util/ChecksumWriter.java
+++ b/src/java/org/apache/cassandra/io/util/ChecksumWriter.java
@@@ -25,12 -25,8 +25,10 @@@ import java.util.zip.CRC32
  
  import javax.annotation.Nonnull;
  
- import com.google.common.base.Charsets;
- 
  import org.apache.cassandra.io.FSWriteError;
  
 +import org.apache.cassandra.io.util.File;
 +
  public class ChecksumWriter
  {
      private final CRC32 incrementalChecksum = new CRC32();
@@@ -92,9 -88,12 +90,12 @@@
  
      public void writeFullChecksum(@Nonnull File digestFile)
      {
-         try (BufferedWriter out = Files.newBufferedWriter(digestFile.toPath(), Charsets.UTF_8))
 -        try (FileOutputStream fos = new FileOutputStream(digestFile);
++        try (FileOutputStream fos = new FileOutputStream(digestFile.toJavaIOFile());
+              DataOutputStream out = new DataOutputStream(new BufferedOutputStream(fos)))
          {
-             out.write(String.valueOf(fullChecksum.getValue()));
+             out.write(String.valueOf(fullChecksum.getValue()).getBytes(StandardCharsets.UTF_8));
+             out.flush();
+             fos.getFD().sync();
          }
          catch (IOException e)
          {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org