cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1179381 - in /cassandra/branches/cassandra-1.0: ./ bin/ conf/ contrib/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/cql/ src/java/org/apache/cassandra/db/ src/java/...
Date Wed, 05 Oct 2011 18:58:00 GMT
Author: jbellis
Date: Wed Oct  5 18:57:59 2011
New Revision: 1179381

URL: http://svn.apache.org/viewvc?rev=1179381&view=rev
Log:
merge from 1.0.0

Modified:
    cassandra/branches/cassandra-1.0/   (props changed)
    cassandra/branches/cassandra-1.0/CHANGES.txt
    cassandra/branches/cassandra-1.0/bin/cassandra.in.sh
    cassandra/branches/cassandra-1.0/conf/cassandra-env.sh
    cassandra/branches/cassandra-1.0/contrib/   (props changed)
    cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
  (props changed)
    cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
  (props changed)
    cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliClient.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliUtils.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/QueryProcessor.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Truncation.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java
    cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RecoveryManagerTruncateTest.java
    cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java

Propchange: cassandra/branches/cassandra-1.0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct  5 18:57:59 2011
@@ -1,11 +1,11 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7:1026516-1170333,1172024
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
-/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1178554,1178785
+/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1178554,1178785,1179359,1179364
 /cassandra/branches/cassandra-0.8.0:1125021-1130369
 /cassandra/branches/cassandra-0.8.1:1101014-1125018
 /cassandra/branches/cassandra-1.0:1167106,1167185
-/cassandra/branches/cassandra-1.0.0:1167104-1178594,1178787
+/cassandra/branches/cassandra-1.0.0:1167104-1179380
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1:1102511-1125020
 /cassandra/trunk:1167085-1167102,1169870

Modified: cassandra/branches/cassandra-1.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/CHANGES.txt?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-1.0/CHANGES.txt Wed Oct  5 18:57:59 2011
@@ -18,6 +18,13 @@
  * (Hadoop) check all interfaces for a match with split location
    before falling back to random replica (CASSANDRA-3211)
  * Fix stress COUNTER_GET option (CASSANDRA-3301)
+ * Change default heap thresholds to max(min(1/2 ram, 1G), min(1/4 ram, 8GB))
+   (CASSANDRA-3295)
+ * Fix missing fields in CLI `show schema` output (CASSANDRA-3304)
+ * Fix broken CompressedRandomAccessReaderTest (CASSANDRA-3298)
+ * Nodetool no longer leaks threads and closes JMX connections (CASSANDRA-3309)
+ * (CQL) fix type information returned for wildcard queries (CASSANDRA-3311)
+ * fix truncate allowing data to be replayed post-restart (CASSANDRA-3297)
 
 
 1.0.0-rc2

Modified: cassandra/branches/cassandra-1.0/bin/cassandra.in.sh
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/bin/cassandra.in.sh?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/bin/cassandra.in.sh (original)
+++ cassandra/branches/cassandra-1.0/bin/cassandra.in.sh Wed Oct  5 18:57:59 2011
@@ -39,3 +39,4 @@ CLASSPATH=$CASSANDRA_CONF:$cassandra_bin
 for jar in $CASSANDRA_HOME/lib/*.jar; do
     CLASSPATH=$CLASSPATH:$jar
 done
+echo $CLASSPATH
\ No newline at end of file

Modified: cassandra/branches/cassandra-1.0/conf/cassandra-env.sh
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/conf/cassandra-env.sh?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/conf/cassandra-env.sh (original)
+++ cassandra/branches/cassandra-1.0/conf/cassandra-env.sh Wed Oct  5 18:57:59 2011
@@ -40,7 +40,28 @@ calculate_heap_sizes()
             system_cpu_cores="2"
         ;;
     esac
-    max_heap_size_in_mb=`expr $system_memory_in_mb / 2`
+
+    # set max heap size based on the following
+    # max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB))
+    # calculate 1/2 ram and cap to 1024MB
+    # calculate 1/4 ram and cap to 8192MB
+    # pick the max
+    half_system_memory_in_mb=`expr $system_memory_in_mb / 2`
+    quarter_system_memory_in_mb=`expr $half_system_memory_in_mb / 2`
+    if [ "$half_system_memory_in_mb" -gt "1024" ]
+    then
+        half_system_memory_in_mb="1024"
+    fi
+    if [ "$quarter_system_memory_in_mb" -gt "8192" ]
+    then
+        quarter_system_memory_in_mb="8192"
+    fi
+    if [ "$half_system_memory_in_mb" -gt "$quarter_system_memory_in_mb" ]
+    then
+        max_heap_size_in_mb="$half_system_memory_in_mb"
+    else
+        max_heap_size_in_mb="$quarter_system_memory_in_mb"
+    fi
     MAX_HEAP_SIZE="${max_heap_size_in_mb}M"
 
     # Young gen: min(max_sensible_per_modern_cpu_core * num_cores, 1/4 * heap size)

Propchange: cassandra/branches/cassandra-1.0/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct  5 18:57:59 2011
@@ -1,11 +1,11 @@
 /cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009
 /cassandra/branches/cassandra-0.7/contrib:1026516-1170333,1172024
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
-/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1178554,1178785
+/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1178554,1178785,1179359,1179364
 /cassandra/branches/cassandra-0.8.0/contrib:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/contrib:1101014-1125018
 /cassandra/branches/cassandra-1.0/contrib:1167106,1167185
-/cassandra/branches/cassandra-1.0.0/contrib:1167104-1178594,1178787
+/cassandra/branches/cassandra-1.0.0/contrib:1167104-1179380
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/contrib:1102511-1125020
 /cassandra/trunk/contrib:1167085-1167102,1169870

Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct  5 18:57:59 2011
@@ -1,11 +1,11 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1170333,1172024
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1178554,1178785
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1178554,1178785,1179359,1179364
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1101014-1125018
 /cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167106,1167185
-/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167104-1178594,1178787
+/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167104-1179380
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1102511-1125020
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167085-1167102,1169870

Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct  5 18:57:59 2011
@@ -1,11 +1,11 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1170333,1172024
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1178554,1178785
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1178554,1178785,1179359,1179364
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1101014-1125018
 /cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167106,1167185
-/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167104-1178594,1178787
+/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167104-1179380
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1102511-1125020
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167085-1167102,1169870

Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct  5 18:57:59 2011
@@ -1,11 +1,11 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1170333,1172024
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1178554,1178785
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1178554,1178785,1179359,1179364
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1101014-1125018
 /cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167106,1167185
-/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167104-1178594,1178787
+/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167104-1179380
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1102511-1125020
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167085-1167102,1169870

Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct  5 18:57:59 2011
@@ -1,11 +1,11 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1170333,1172024
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1178554,1178785
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1178554,1178785,1179359,1179364
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1101014-1125018
 /cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167106,1167185
-/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167104-1178594,1178787
+/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167104-1179380
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1102511-1125020
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167085-1167102,1169870

Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct  5 18:57:59 2011
@@ -1,11 +1,11 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1170333,1172024
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1178554,1178785
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1178554,1178785,1179359,1179364
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1101014-1125018
 /cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167106,1167185
-/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167104-1178594,1178787
+/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167104-1179380
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1102511-1125020
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167085-1167102,1169870

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliClient.java?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliClient.java Wed
Oct  5 18:57:59 2011
@@ -1589,16 +1589,19 @@ public class CliClient
         if (ksDef.strategy_options != null && !ksDef.strategy_options.isEmpty())
         {
             final StringBuilder opts = new StringBuilder();
-            opts.append("[{");
+            opts.append("{");
             String prefix = "";
             for (Map.Entry<String, String> opt : ksDef.strategy_options.entrySet())
             {
                 opts.append(prefix + CliUtils.escapeSQLString(opt.getKey()) + " : " + CliUtils.escapeSQLString(opt.getValue()));
                 prefix = ", ";
             }
-            opts.append("}]");
+            opts.append("}");
             writeAttrRaw(sb, false, "strategy_options", opts.toString());
         }
+
+        writeAttr(sb, false, "durable_writes", ksDef.durable_writes);
+
         sb.append(";" + NEWLINE);
         sb.append(NEWLINE);
 
@@ -1624,7 +1627,7 @@ public class CliClient
 
         writeAttr(sb, true, "column_type", cfDef.column_type);
         writeAttr(sb, false, "comparator", normaliseType(cfDef.comparator_type, "org.apache.cassandra.db.marshal"));
-        if (cfDef.column_type == "Super")
+        if (cfDef.column_type.equals("Super"))
             writeAttr(sb, false, "subcomparator", normaliseType(cfDef.subcomparator_type,
"org.apache.cassandra.db.marshal"));
         if (!StringUtils.isEmpty(cfDef.default_validation_class))
             writeAttr(sb, false, "default_validation_class",
@@ -1633,6 +1636,7 @@ public class CliClient
                     normaliseType(cfDef.key_validation_class, "org.apache.cassandra.db.marshal"));
         writeAttr(sb, false, "rows_cached", cfDef.row_cache_size);
         writeAttr(sb, false, "row_cache_save_period", cfDef.row_cache_save_period_in_seconds);
+        writeAttr(sb, false, "row_cache_keys_to_save", cfDef.row_cache_keys_to_save);
         writeAttr(sb, false, "keys_cached", cfDef.key_cache_size);
         writeAttr(sb, false, "key_cache_save_period", cfDef.key_cache_save_period_in_seconds);
         writeAttr(sb, false, "read_repair_chance", cfDef.read_repair_chance);
@@ -1641,6 +1645,32 @@ public class CliClient
         writeAttr(sb, false, "max_compaction_threshold", cfDef.max_compaction_threshold);
         writeAttr(sb, false, "replicate_on_write", cfDef.replicate_on_write);
         writeAttr(sb, false, "row_cache_provider", normaliseType(cfDef.row_cache_provider,
"org.apache.cassandra.cache"));
+        writeAttr(sb, false, "compaction_strategy", cfDef.compaction_strategy);
+
+        if (!cfDef.compaction_strategy_options.isEmpty())
+        {
+            StringBuilder cOptions = new StringBuilder();
+
+            cOptions.append("{");
+
+            Map<String, String> options = cfDef.compaction_strategy_options;
+
+            int i = 0, size = options.size();
+
+            for (Map.Entry<String, String> entry : options.entrySet())
+            {
+                cOptions.append(CliUtils.quote(entry.getKey())).append(" : ").append(CliUtils.quote(entry.getValue()));
+
+                if (i != size - 1)
+                    cOptions.append(", ");
+
+                i++;
+            }
+
+            cOptions.append("}");
+
+            writeAttrRaw(sb, false, "compaction_strategy_options", cOptions.toString());
+        }
 
         if (!StringUtils.isEmpty(cfDef.comment))
             writeAttr(sb, false, "comment", cfDef.comment);

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliUtils.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliUtils.java?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliUtils.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliUtils.java Wed Oct
 5 18:57:59 2011
@@ -118,4 +118,9 @@ public class CliUtils
 
         return null;
     }
+
+    public static String quote(String str)
+    {
+        return String.format("'%s'", str);
+    }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/QueryProcessor.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/QueryProcessor.java?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/QueryProcessor.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/QueryProcessor.java
Wed Oct  5 18:57:59 2011
@@ -588,6 +588,11 @@ public class QueryProcessor
                         {
                             if (c.isMarkedForDelete())
                                 continue;
+
+                            ColumnDefinition cd = metadata.getColumnDefinition(c.name());
+                            if (cd != null)
+                                result.schema.value_types.put(c.name(), TypeParser.getShortName(cd.getValidator()));
+
                             thriftColumns.add(thriftify(c));
                         }
                     }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Wed Oct  5 18:57:59 2011
@@ -714,7 +714,7 @@ public class ColumnFamilyStore implement
 
         if (clean)
         {
-            logger.debug("forceFlush requested but everything is clean");
+            logger.debug("forceFlush requested but everything is clean in {}", columnFamily);
             return null;
         }
 
@@ -1593,7 +1593,7 @@ public class ColumnFamilyStore implement
      * @return a Future to the delete operation. Call the future's get() to make
      * sure the column family has been deleted
      */
-    public Future<?> truncate() throws IOException
+    public Future<?> truncate() throws IOException, ExecutionException, InterruptedException
     {
         // We have two goals here:
         // - truncate should delete everything written before truncate was invoked
@@ -1611,11 +1611,15 @@ public class ColumnFamilyStore implement
         //
         // Bonus bonus: simply forceFlush of all the CF is not enough, because if
         // for a given column family the memtable is clean, forceFlush will return
-        // immediately, even though there could be a memtable being flush at the same
-        // time.  So to guarantee that all segments can be cleaned out, we need
+        // immediately, even though there could be a memtable being flushed at the same
+        // time.  So to guarantee that all segments can be cleaned out, we need to
         // "waitForActiveFlushes" after the new segment has been created.
+        logger.debug("truncating {}", columnFamily);
+        // flush the CF being truncated before forcing the new segment
+        forceBlockingFlush();
         CommitLog.instance.forceNewSegment();
         ReplayPosition position = CommitLog.instance.getContext();
+        // now flush everyone else.  re-flushing ourselves is not necessary, but harmless
         for (ColumnFamilyStore cfs : ColumnFamilyStore.all())
             cfs.forceFlush();
         waitForActiveFlushes();

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Truncation.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Truncation.java?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Truncation.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Truncation.java Wed
Oct  5 18:57:59 2011
@@ -55,15 +55,6 @@ public class Truncation implements Messa
         this.columnFamily = columnFamily;
     }
 
-    /**
-     * This is equivalent to calling commit. Applies the changes to
-     * to the table that is obtained by calling Table.open().
-     */
-    public void apply() throws IOException
-    {
-        Table.open(keyspace).getColumnFamilyStore(columnFamily).truncate();
-    }
-
     public Message getMessage(Integer version) throws IOException
     {
         FastByteArrayOutputStream bos = new FastByteArrayOutputStream();

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/CommitLog.java?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
Wed Oct  5 18:57:59 2011
@@ -131,6 +131,8 @@ public class CommitLog implements Commit
 
     public void resetUnsafe()
     {
+        for (CommitLogSegment segment : segments)
+            segment.close();
         segments.clear();
         segments.add(new CommitLogSegment());
     }
@@ -484,7 +486,6 @@ public class CommitLog implements Commit
         if (segment.isSafeToDelete() && iter.hasNext())
         {
             logger.info("Discarding obsolete commit log:" + segment);
-            segment.close();
             FileUtils.deleteAsync(segment.getPath());
             // usually this will be the first (remaining) segment, but not always, if segment
A contains
             // writes to a CF that is unflushed but is followed by segment B whose CFs are
all flushed.
@@ -532,34 +533,26 @@ public class CommitLog implements Commit
         return getSize();
     }
 
-    public void forceNewSegment()
+    public void forceNewSegment() throws ExecutionException, InterruptedException
     {
         Callable<?> task = new Callable()
         {
             public Object call() throws IOException
             {
-                createNewSegment();
+                if (currentSegment().length() > 0)
+                    createNewSegment();
                 return null;
             }
         };
 
-        try
-        {
-            executor.submit(task).get();
-        }
-        catch (InterruptedException e)
-        {
-            throw new AssertionError(e);
-        }
-        catch (ExecutionException e)
-        {
-            throw new RuntimeException(e);
-        }
+        executor.submit(task).get();
     }
 
     private void createNewSegment() throws IOException
     {
+        assert !segments.isEmpty();
         sync();
+        segments.getLast().close();
         segments.add(new CommitLogSegment());
 
         // Maintain desired CL size cap

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
Wed Oct  5 18:57:59 2011
@@ -48,6 +48,7 @@ public class CommitLogSegment
 
     public final long id;
     private final SequentialWriter logWriter;
+    private long finalSize = -1;
 
     // cache which cf is dirty in this segment to avoid having to lookup all ReplayPositions
to decide if we could delete this segment
     public final Map<Integer, Integer> cfLastWrite = new HashMap<Integer, Integer>();
@@ -159,6 +160,9 @@ public class CommitLogSegment
 
     public long length()
     {
+        if (finalSize >= 0)
+            return finalSize;
+        
         try
         {
             return logWriter.length();
@@ -171,8 +175,12 @@ public class CommitLogSegment
 
     public void close()
     {
+        if (finalSize >= 0)
+            return;
+
         try
         {
+            finalSize = logWriter.length();
             logWriter.close();
         }
         catch (IOException e)

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java Wed
Oct  5 18:57:59 2011
@@ -588,134 +588,148 @@ public class NodeCmd
         {
             err(ioe, "Error connection to remote JMX agent!");
         }
-
-        NodeCommand command = null;
-
         try
         {
-            command = cmd.getCommand();
-        }
-        catch (IllegalArgumentException e)
-        {
-            badUse(e.getMessage());
-        }
-
+            NodeCommand command = null;
 
-        NodeCmd nodeCmd = new NodeCmd(probe);
+            try
+            {
+                command = cmd.getCommand();
+            }
+            catch (IllegalArgumentException e)
+            {
+                badUse(e.getMessage());
+            }
 
-        // Execute the requested command.
-        String[] arguments = cmd.getCommandArguments();
 
-        switch (command)
-        {
-            case RING            : nodeCmd.printRing(System.out); break;
-            case INFO            : nodeCmd.printInfo(System.out); break;
-            case CFSTATS         : nodeCmd.printColumnFamilyStats(System.out); break;
-            case DECOMMISSION    : probe.decommission(); break;
-            case TPSTATS         : nodeCmd.printThreadPoolStats(System.out); break;
-            case VERSION         : nodeCmd.printReleaseVersion(System.out); break;
-            case COMPACTIONSTATS : nodeCmd.printCompactionStats(System.out); break;
-            case DISABLEGOSSIP   : probe.stopGossiping(); break;
-            case ENABLEGOSSIP    : probe.startGossiping(); break;
-            case DISABLETHRIFT   : probe.stopThriftServer(); break;
-            case ENABLETHRIFT    : probe.startThriftServer(); break;
-            case STATUSTHRIFT    : nodeCmd.printIsThriftServerRunning(System.out); break;
+            NodeCmd nodeCmd = new NodeCmd(probe);
 
-            case DRAIN :
-                try { probe.drain(); }
-                catch (ExecutionException ee) { err(ee, "Error occured during flushing");
}
-                break;
+            // Execute the requested command.
+            String[] arguments = cmd.getCommandArguments();
 
-            case NETSTATS :
-                if (arguments.length > 0) { nodeCmd.printNetworkStats(InetAddress.getByName(arguments[0]),
System.out); }
-                else                      { nodeCmd.printNetworkStats(null, System.out);
}
-                break;
+            switch (command)
+            {
+                case RING            : nodeCmd.printRing(System.out); break;
+                case INFO            : nodeCmd.printInfo(System.out); break;
+                case CFSTATS         : nodeCmd.printColumnFamilyStats(System.out); break;
+                case DECOMMISSION    : probe.decommission(); break;
+                case TPSTATS         : nodeCmd.printThreadPoolStats(System.out); break;
+                case VERSION         : nodeCmd.printReleaseVersion(System.out); break;
+                case COMPACTIONSTATS : nodeCmd.printCompactionStats(System.out); break;
+                case DISABLEGOSSIP   : probe.stopGossiping(); break;
+                case ENABLEGOSSIP    : probe.startGossiping(); break;
+                case DISABLETHRIFT   : probe.stopThriftServer(); break;
+                case ENABLETHRIFT    : probe.startThriftServer(); break;
+                case STATUSTHRIFT    : nodeCmd.printIsThriftServerRunning(System.out); break;
+    
+                case DRAIN :
+                    try { probe.drain(); }
+                    catch (ExecutionException ee) { err(ee, "Error occured during flushing");
}
+                    break;
 
-            case SNAPSHOT :
-            case CLEARSNAPSHOT :
-                String tag = cmd.getOptionValue(TAG_OPT.left);
-                handleSnapshots(command, tag, arguments, probe);
-                break;
+                case NETSTATS :
+                    if (arguments.length > 0) { nodeCmd.printNetworkStats(InetAddress.getByName(arguments[0]),
System.out); }
+                    else                      { nodeCmd.printNetworkStats(null, System.out);
}
+                    break;
 
-            case MOVE :
-                if (arguments.length != 1) { badUse("Missing token argument for move.");
}
-                probe.move(arguments[0]);
-                break;
+                case SNAPSHOT :
+                case CLEARSNAPSHOT :
+                    String tag = cmd.getOptionValue(TAG_OPT.left);
+                    handleSnapshots(command, tag, arguments, probe);
+                    break;
 
-            case JOIN:
-                if (probe.isJoined())
-                {
-                    System.err.println("This node has already joined the ring.");
-                    System.exit(1);
-                }
+                case MOVE :
+                    if (arguments.length != 1) { badUse("Missing token argument for move.");
}
+                    probe.move(arguments[0]);
+                    break;
 
-                probe.joinRing();
-                break;
+                case JOIN:
+                    if (probe.isJoined())
+                    {
+                        System.err.println("This node has already joined the ring.");
+                        System.exit(1);
+                    }
 
-            case SETCOMPACTIONTHROUGHPUT :
-                if (arguments.length != 1) { badUse("Missing value argument."); }
-                probe.setCompactionThroughput(Integer.valueOf(arguments[0]));
-                break;
+                    probe.joinRing();
+                    break;
 
-            case REMOVETOKEN :
-                if (arguments.length != 1) { badUse("Missing an argument for removetoken
(either status, force, or a token)"); }
-                else if (arguments[0].equals("status")) { nodeCmd.printRemovalStatus(System.out);
}
-                else if (arguments[0].equals("force"))  { nodeCmd.printRemovalStatus(System.out);
probe.forceRemoveCompletion(); }
-                else                                    { probe.removeToken(arguments[0]);
}
-                break;
+                case SETCOMPACTIONTHROUGHPUT :
+                    if (arguments.length != 1) { badUse("Missing value argument."); }
+                    probe.setCompactionThroughput(Integer.valueOf(arguments[0]));
+                    break;
 
-            case CLEANUP :
-            case COMPACT :
-            case REPAIR  :
-            case FLUSH   :
-            case SCRUB   :
-            case INVALIDATEKEYCACHE :
-            case INVALIDATEROWCACHE :
-                optionalKSandCFs(command, cmd, arguments, probe);
-                break;
+                case REMOVETOKEN :
+                    if (arguments.length != 1) { badUse("Missing an argument for removetoken
(either status, force, or a token)"); }
+                    else if (arguments[0].equals("status")) { nodeCmd.printRemovalStatus(System.out);
}
+                    else if (arguments[0].equals("force"))  { nodeCmd.printRemovalStatus(System.out);
probe.forceRemoveCompletion(); }
+                    else                                    { probe.removeToken(arguments[0]);
}
+                    break;
 
-            case GETCOMPACTIONTHRESHOLD :
-                if (arguments.length != 2) { badUse("getcompactionthreshold requires ks and
cf args."); }
-                probe.getCompactionThreshold(System.out, arguments[0], arguments[1]);
-                break;
+                case CLEANUP :
+                case COMPACT :
+                case REPAIR  :
+                case FLUSH   :
+                case SCRUB   :
+                case INVALIDATEKEYCACHE :
+                case INVALIDATEROWCACHE :
+                    optionalKSandCFs(command, cmd, arguments, probe);
+                    break;
 
-            case CFHISTOGRAMS :
-                if (arguments.length != 2) { badUse("cfhistograms requires ks and cf args");
}
-                nodeCmd.printCfHistograms(arguments[0], arguments[1], System.out);
-                break;
+                case GETCOMPACTIONTHRESHOLD :
+                    if (arguments.length != 2) { badUse("getcompactionthreshold requires
ks and cf args."); }
+                    probe.getCompactionThreshold(System.out, arguments[0], arguments[1]);
+                    break;
 
-            case SETCACHECAPACITY :
-                if (arguments.length != 4) { badUse("setcachecapacity requires ks, cf, keycachecap,
and rowcachecap args."); }
-                probe.setCacheCapacities(arguments[0], arguments[1], Integer.parseInt(arguments[2]),
Integer.parseInt(arguments[3]));
-                break;
+                case CFHISTOGRAMS :
+                    if (arguments.length != 2) { badUse("cfhistograms requires ks and cf
args"); }
+                    nodeCmd.printCfHistograms(arguments[0], arguments[1], System.out);
+                    break;
 
-            case SETCOMPACTIONTHRESHOLD :
-                if (arguments.length != 4) { badUse("setcompactionthreshold requires ks,
cf, min, and max threshold args."); }
-                int minthreshold = Integer.parseInt(arguments[2]);
-                int maxthreshold = Integer.parseInt(arguments[3]);
-                if ((minthreshold < 0) || (maxthreshold < 0)) { badUse("Thresholds
must be positive integers"); }
-                if (minthreshold > maxthreshold)              { badUse("Min threshold
cannot be greater than max."); }
-                if (minthreshold < 2 && maxthreshold != 0)    { badUse("Min threshold
must be at least 2"); }
-                probe.setCompactionThreshold(arguments[0], arguments[1], minthreshold, maxthreshold);
-                break;
+                case SETCACHECAPACITY :
+                    if (arguments.length != 4) { badUse("setcachecapacity requires ks, cf,
keycachecap, and rowcachecap args."); }
+                    probe.setCacheCapacities(arguments[0], arguments[1], Integer.parseInt(arguments[2]),
Integer.parseInt(arguments[3]));
+                    break;
 
-            case GETENDPOINTS :
-                if (arguments.length != 3) { badUse("getendpoints requires ks, cf and key
args"); }
-                nodeCmd.printEndPoints(arguments[0], arguments[1], arguments[2], System.out);
-                break;
+                case SETCOMPACTIONTHRESHOLD :
+                    if (arguments.length != 4) { badUse("setcompactionthreshold requires
ks, cf, min, and max threshold args."); }
+                    int minthreshold = Integer.parseInt(arguments[2]);
+                    int maxthreshold = Integer.parseInt(arguments[3]);
+                    if ((minthreshold < 0) || (maxthreshold < 0)) { badUse("Thresholds
must be positive integers"); }
+                    if (minthreshold > maxthreshold)              { badUse("Min threshold
cannot be greater than max."); }
+                    if (minthreshold < 2 && maxthreshold != 0)    { badUse("Min
threshold must be at least 2"); }
+                    probe.setCompactionThreshold(arguments[0], arguments[1], minthreshold,
maxthreshold);
+                    break;
 
-            case REFRESH:
-                if (arguments.length != 2) { badUse("load_new_sstables requires ks and cf
args"); }
-                probe.loadNewSSTables(arguments[0], arguments[1]);
-                break;
+                case GETENDPOINTS :
+                    if (arguments.length != 3) { badUse("getendpoints requires ks, cf and
key args"); }
+                    nodeCmd.printEndPoints(arguments[0], arguments[1], arguments[2], System.out);
+                    break;
 
-            case GOSSIPINFO : nodeCmd.printGossipInfo(System.out); break;
+                case REFRESH:
+                    if (arguments.length != 2) { badUse("load_new_sstables requires ks and
cf args"); }
+                    probe.loadNewSSTables(arguments[0], arguments[1]);
+                    break;
 
-            default :
-                throw new RuntimeException("Unreachable code.");
+                case GOSSIPINFO : nodeCmd.printGossipInfo(System.out); break;
 
+                default :
+                    throw new RuntimeException("Unreachable code.");
+            }
+        }
+        finally
+        {
+            if (probe != null)
+            {
+                try
+                {
+                    probe.close();
+                }
+                catch (IOException ex)
+                {
+                    // swallow the exception so the user will see the real one.
+                }
+            }
         }
-
         System.exit(0);
     }
 

Modified: cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RecoveryManagerTruncateTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RecoveryManagerTruncateTest.java?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RecoveryManagerTruncateTest.java
(original)
+++ cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RecoveryManagerTruncateTest.java
Wed Oct  5 18:57:59 2011
@@ -48,7 +48,7 @@ public class RecoveryManagerTruncateTest
 		RowMutation rm;
 		ColumnFamily cf;
 
-		// trucate clears memtable
+		// add a single cell
 		rm = new RowMutation("Keyspace1", ByteBufferUtil.bytes("keymulti"));
 		cf = ColumnFamily.create("Keyspace1", "Standard1");
 		cf.addColumn(column("col1", "val1", 1L));
@@ -60,22 +60,11 @@ public class RecoveryManagerTruncateTest
 
 		// and now truncate it
 		cfs.truncate().get();
+        CommitLog.instance.resetUnsafe();
 		CommitLog.recover();
 
 		// and validate truncation.
 		assertNull(getFromTable(table, "Standard1", "keymulti", "col1"));
-
-		// truncate clears sstable
-		rm = new RowMutation("Keyspace1", ByteBufferUtil.bytes("keymulti"));
-		cf = ColumnFamily.create("Keyspace1", "Standard1");
-		cf.addColumn(column("col1", "val1", 1L));
-		rm.add(cf);
-		rm.apply();
-		cfs.forceBlockingFlush();
-		cfs.truncate().get();
-        CommitLog.instance.resetUnsafe();
-		CommitLog.recover();
-		assertNull(getFromTable(table, "Standard1", "keymulti", "col1"));
 	}
 
 	private IColumn getFromTable(Table table, String cfName, String keyName, String columnName)

Modified: cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java?rev=1179381&r1=1179380&r2=1179381&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
(original)
+++ cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
Wed Oct  5 18:57:59 2011
@@ -36,22 +36,21 @@ public class CompressedRandomAccessReade
     public void testResetAndTruncate() throws IOException
     {
         // test reset in current buffer or previous one
-        testResetAndTruncate(false, 10);
-        testResetAndTruncate(false, CompressionParameters.DEFAULT_CHUNK_LENGTH);
+        testResetAndTruncate(File.createTempFile("normal", "1"), false, 10);
+        testResetAndTruncate(File.createTempFile("normal", "2"), false, CompressionParameters.DEFAULT_CHUNK_LENGTH);
     }
 
     @Test
     public void testResetAndTruncateCompressed() throws IOException
     {
         // test reset in current buffer or previous one
-        testResetAndTruncate(true, 10);
-        testResetAndTruncate(true, CompressionParameters.DEFAULT_CHUNK_LENGTH);
+        testResetAndTruncate(File.createTempFile("compressed", "1"), true, 10);
+        testResetAndTruncate(File.createTempFile("compressed", "2"), true, CompressionParameters.DEFAULT_CHUNK_LENGTH);
     }
 
-    private void testResetAndTruncate(boolean compressed, int junkSize) throws IOException
+    private void testResetAndTruncate(File f, boolean compressed, int junkSize) throws IOException
     {
-        String filename = "corruptFile";
-        File f = new File(filename);
+        final String filename = f.getAbsolutePath();
 
         try
         {



Mime
View raw message