You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ma...@apache.org on 2014/07/31 08:04:52 UTC

[1/4] git commit: Avoid NPE when listing saved caches directory

Repository: cassandra
Updated Branches:
  refs/heads/trunk a88c7e10f -> 90ade6b45


Avoid NPE when listing saved caches directory

Patch by marcuse; reviewed by yukim for CASSANDRA-7632


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1a0aaf04
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1a0aaf04
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1a0aaf04

Branch: refs/heads/trunk
Commit: 1a0aaf04986155eae45b2685d234b928866b681c
Parents: 892bf55
Author: Marcus Eriksson <ma...@apache.org>
Authored: Thu Jul 31 07:53:33 2014 +0200
Committer: Marcus Eriksson <ma...@apache.org>
Committed: Thu Jul 31 07:53:33 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../apache/cassandra/cache/AutoSavingCache.java | 23 ++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a0aaf04/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a6fc837..1fcb556 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -22,6 +22,7 @@
  * Fix error when doing reversed queries with static columns (CASSANDRA-7490)
  * Backport CASSANDRA-6747 (CASSANDRA-7560)
  * Track max/min timestamps for range tombstones (CASSANDRA-7647)
+ * Fix NPE when listing saved caches dir (CASSANDRA-7632)
 Merged from 1.2:
  * Set correct stream ID on responses when non-Exception Throwables
    are thrown while handling native protocol messages (CASSANDRA-7470)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a0aaf04/src/java/org/apache/cassandra/cache/AutoSavingCache.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cache/AutoSavingCache.java b/src/java/org/apache/cassandra/cache/AutoSavingCache.java
index 6554eb3..64234e2 100644
--- a/src/java/org/apache/cassandra/cache/AutoSavingCache.java
+++ b/src/java/org/apache/cassandra/cache/AutoSavingCache.java
@@ -261,19 +261,24 @@ public class AutoSavingCache<K extends CacheKey, V> extends InstrumentingCache<K
         {
             File savedCachesDir = new File(DatabaseDescriptor.getSavedCachesLocation());
             assert savedCachesDir.exists() && savedCachesDir.isDirectory();
-
-            for (File file : savedCachesDir.listFiles())
+            File[] files = savedCachesDir.listFiles();
+            if (files != null)
             {
-                if (!file.isFile())
-                    continue; // someone's been messing with our directory.  naughty!
-
-                if (file.getName().endsWith(cacheType.toString())
-                    || file.getName().endsWith(String.format("%s-%s.db", cacheType.toString(), CURRENT_VERSION)))
+                for (File file : files)
                 {
-                    if (!file.delete())
-                        logger.warn("Failed to delete {}", file.getAbsolutePath());
+                    if (!file.isFile())
+                        continue; // someone's been messing with our directory.  naughty!
+
+                    if (file.getName().endsWith(cacheType.toString())
+                            || file.getName().endsWith(String.format("%s-%s.db", cacheType.toString(), CURRENT_VERSION)))
+                    {
+                        if (!file.delete())
+                            logger.warn("Failed to delete {}", file.getAbsolutePath());
+                    }
                 }
             }
+            else
+                logger.warn("Could not list files in {}", savedCachesDir);
         }
     }
 


[3/4] git commit: Merge branch 'cassandra-2.1.0' into cassandra-2.1

Posted by ma...@apache.org.
Merge branch 'cassandra-2.1.0' into cassandra-2.1


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/63407db7
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/63407db7
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/63407db7

Branch: refs/heads/trunk
Commit: 63407db7e946bbf5aa796367375fd9cb46ba36c4
Parents: 40d7bdf ef099c3
Author: Marcus Eriksson <ma...@apache.org>
Authored: Thu Jul 31 08:00:30 2014 +0200
Committer: Marcus Eriksson <ma...@apache.org>
Committed: Thu Jul 31 08:00:30 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../apache/cassandra/cache/AutoSavingCache.java | 23 ++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/63407db7/CHANGES.txt
----------------------------------------------------------------------


[4/4] git commit: Merge branch 'cassandra-2.1' into trunk

Posted by ma...@apache.org.
Merge branch 'cassandra-2.1' into trunk


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/90ade6b4
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/90ade6b4
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/90ade6b4

Branch: refs/heads/trunk
Commit: 90ade6b45921c1a102cf97fa3fea7fca8462a085
Parents: a88c7e1 63407db
Author: Marcus Eriksson <ma...@apache.org>
Authored: Thu Jul 31 08:00:42 2014 +0200
Committer: Marcus Eriksson <ma...@apache.org>
Committed: Thu Jul 31 08:00:42 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../apache/cassandra/cache/AutoSavingCache.java | 23 ++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/90ade6b4/CHANGES.txt
----------------------------------------------------------------------


[2/4] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1.0

Posted by ma...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1.0

Conflicts:
	CHANGES.txt


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/ef099c31
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ef099c31
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ef099c31

Branch: refs/heads/trunk
Commit: ef099c317a59ac3161713d1cf6f2b113129bba09
Parents: cde5666 1a0aaf0
Author: Marcus Eriksson <ma...@apache.org>
Authored: Thu Jul 31 08:00:03 2014 +0200
Committer: Marcus Eriksson <ma...@apache.org>
Committed: Thu Jul 31 08:00:03 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../apache/cassandra/cache/AutoSavingCache.java | 23 ++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ef099c31/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 3b2f35c,1fcb556..0ce0eaa
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,44 -1,10 +1,45 @@@
 -2.0.10
 +2.1.0-final
   * Remove shuffle and taketoken (CASSANDRA-7601)
 - * Switch liveRatio-related log messages to DEBUG (CASSANDRA-7467)
 - * (cqlsh) Add tab-completion for CREATE/DROP USER IF [NOT] EXISTS (CASSANDRA-7611)
 - * Always merge ranges owned by a single node (CASSANDRA-6930)
 - * Pig support for hadoop CqlInputFormat (CASSANDRA-6454)
 + * Clean up Windows batch scripts (CASSANDRA-7619)
 + * Fix native protocol drop user type notification (CASSANDRA-7571)
 + * Give read access to system.schema_usertypes to all authenticated users
 +   (CASSANDRA-7578)
 + * (cqlsh) Fix cqlsh display when zero rows are returned (CASSANDRA-7580)
 + * Get java version correctly when JAVA_TOOL_OPTIONS is set (CASSANDRA-7572)
 + * Fix NPE when dropping index from non-existent keyspace, AssertionError when
 +   dropping non-existent index with IF EXISTS (CASSANDRA-7590)
 + * Fix sstablelevelresetter hang (CASSANDRA-7614)
 + * (cqlsh) Fix deserialization of blobs (CASSANDRA-7603)
 + * Use "keyspace updated" schema change message for UDT changes in v1 and
 +   v2 protocols (CASSANDRA-7617)
 + * Fix tracing of range slices and secondary index lookups that are local
 +   to the coordinator (CASSANDRA-7599)
 + * Set -Dcassandra.storagedir for all tool shell scripts (CASSANDRA-7587)
 + * Don't swap max/min col names when mutating sstable metadata (CASSANDRA-7596)
 + * (cqlsh) Correctly handle paged result sets (CASSANDRA-7625)
 + * (cqlsh) Improve waiting for a trace to complete (CASSANDRA-7626)
 + * Fix tracing of concurrent range slices and 2ary index queries (CASSANDRA-7626)
 +Merged from 2.0:
   * Fix ReversedType(DateType) mapping to native protocol (CASSANDRA-7576)
 + * Always merge ranges owned by a single node (CASSANDRA-6930)
 + * Track max/min timestamps for range tombstones (CASSANDRA-7647)
++ * Fix NPE when listing saved caches dir (CASSANDRA-7632)
 +
 +
 +2.1.0-rc4
 + * Fix word count hadoop example (CASSANDRA-7200)
 + * Updated memtable_cleanup_threshold and memtable_flush_writers defaults 
 +   (CASSANDRA-7551)
 + * (Windows) fix startup when WMI memory query fails (CASSANDRA-7505)
 + * Anti-compaction proceeds if any part of the repair failed (CASANDRA-7521)
 + * Add missing table name to DROP INDEX responses and notifications (CASSANDRA-7539)
 + * Bump CQL version to 3.2.0 and update CQL documentation (CASSANDRA-7527)
 + * Fix configuration error message when running nodetool ring (CASSANDRA-7508)
 + * Support conditional updates, tuple type, and the v3 protocol in cqlsh (CASSANDRA-7509)
 + * Handle queries on multiple secondary index types (CASSANDRA-7525)
 + * Fix cqlsh authentication with v3 native protocol (CASSANDRA-7564)
 + * Fix NPE when unknown prepared statement ID is used (CASSANDRA-7454)
 +Merged from 2.0:
   * (Windows) force range-based repair to non-sequential mode (CASSANDRA-7541)
   * Fix range merging when DES scores are zero (CASSANDRA-7535)
   * Warn when SSL certificates have expired (CASSANDRA-7528)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ef099c31/src/java/org/apache/cassandra/cache/AutoSavingCache.java
----------------------------------------------------------------------