cassandra git commit: fail fast if the system property 'legacy-sstable-root' is not set properly

2016-07-23 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk e7064b2d4 -> eaa06942a


fail fast if the system property 'legacy-sstable-root' is not set properly


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

Branch: refs/heads/trunk
Commit: eaa06942a6b5f54fb72bc7fe53d469cd034c2106
Parents: e7064b2
Author: Dave Brosius 
Authored: Sat Jul 23 20:52:07 2016 -0400
Committer: Dave Brosius 
Committed: Sat Jul 23 20:52:07 2016 -0400

--
 .../cassandra/io/sstable/LegacySSTableTest.java | 24 
 1 file changed, 15 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/eaa06942/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
--
diff --git a/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java 
b/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
index 9a37f66..cc2011f 100644
--- a/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
@@ -90,6 +90,12 @@ public class LegacySSTableTest
 @BeforeClass
 public static void defineSchema() throws ConfigurationException
 {
+String scp = System.getProperty(LEGACY_SSTABLE_PROP);
+Assert.assertNotNull("System property " + LEGACY_SSTABLE_ROOT + " not 
set", scp);
+
+LEGACY_SSTABLE_ROOT = new File(scp).getAbsoluteFile();
+Assert.assertTrue("System property " + LEGACY_SSTABLE_ROOT + " does 
not specify a directory", LEGACY_SSTABLE_ROOT.isDirectory());
+
 SchemaLoader.prepareServer();
 StorageService.instance.initServer();
 Keyspace.setInitialized();
@@ -98,10 +104,7 @@ public class LegacySSTableTest
 {
 createTables(legacyVersion);
 }
-String scp = System.getProperty(LEGACY_SSTABLE_PROP);
-assert scp != null;
-LEGACY_SSTABLE_ROOT = new File(scp).getAbsoluteFile();
-assert LEGACY_SSTABLE_ROOT.isDirectory();
+
 }
 
 @After
@@ -454,7 +457,9 @@ public class LegacySSTableTest
 
 private static void copySstablesToTestData(String legacyVersion, String 
table, File cfDir) throws IOException
 {
-for (File file : getTableDir(legacyVersion, table).listFiles())
+File tableDir = getTableDir(legacyVersion, table);
+Assert.assertTrue("The table directory " + tableDir + " was not 
found", tableDir.isDirectory());
+for (File file : tableDir.listFiles())
 {
 copyFile(cfDir, file);
 }
@@ -472,10 +477,11 @@ public class LegacySSTableTest
 {
 File target = new File(cfDir, file.getName());
 int rd;
-FileInputStream is = new FileInputStream(file);
-FileOutputStream os = new FileOutputStream(target);
-while ((rd = is.read(buf)) >= 0)
-os.write(buf, 0, rd);
+try (FileInputStream is = new FileInputStream(file);
+ FileOutputStream os = new FileOutputStream(target);) {
+while ((rd = is.read(buf)) >= 0)
+os.write(buf, 0, rd);
+}
 }
 }
 }



[jira] [Commented] (CASSANDRA-12154) "SELECT * FROM foo LIMIT ;" does not error out

2016-07-23 Thread Thomas Boucher (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-12154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15390847#comment-15390847
 ] 

Thomas Boucher commented on CASSANDRA-12154:


Hello,

I think this is due to a typo in Parser.g:
{code}
intValue returns [Term.Raw value]
: 
| t=INTEGER { $value = Constants.Literal.integer($t.text); }
| ':' id=noncol_ident  { $value = newBindVariables(id); }
| QMARK { $value = newBindVariables(null); }
;
{code}
should be
{code}
intValue returns [Term.Raw value]
: t=INTEGER { $value = Constants.Literal.integer($t.text); }
| ':' id=noncol_ident  { $value = newBindVariables(id); }
| QMARK { $value = newBindVariables(null); }
;
{code}

With this change, I get an error with {{SELECT * FROM test LIMIT;}}, as 
expected.

> "SELECT * FROM foo LIMIT ;" does not error out
> --
>
> Key: CASSANDRA-12154
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12154
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: Robert Stupp
>Assignee: Mahdi Mohammadi
>Priority: Minor
>  Labels: lhf
>
> We found out that {{SELECT * FROM foo LIMIT ;}} is unanimously accepted and 
> executed but it should not.
> Have not dug deeper why that is possible (it's not a big issue IMO) but it is 
> strange. Seems it doesn't parse {{LIMIT}} as {{K_LIMIT}} because otherwise it 
> would require an int argument.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (CASSANDRA-12154) "SELECT * FROM foo LIMIT ;" does not error out

2016-07-23 Thread Mahdi Mohammadi (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-12154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahdi Mohammadi reassigned CASSANDRA-12154:
---

Assignee: Mahdi Mohammadi

> "SELECT * FROM foo LIMIT ;" does not error out
> --
>
> Key: CASSANDRA-12154
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12154
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: Robert Stupp
>Assignee: Mahdi Mohammadi
>Priority: Minor
>  Labels: lhf
>
> We found out that {{SELECT * FROM foo LIMIT ;}} is unanimously accepted and 
> executed but it should not.
> Have not dug deeper why that is possible (it's not a big issue IMO) but it is 
> strange. Seems it doesn't parse {{LIMIT}} as {{K_LIMIT}} because otherwise it 
> would require an int argument.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-12133) Failed to load Java8 implementation ohc-core-j8

2016-07-23 Thread Robert Stupp (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-12133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15390686#comment-15390686
 ] 

Robert Stupp commented on CASSANDRA-12133:
--

Yup, rebased + scheduled CI again. Looks fine now.

> Failed to load Java8 implementation ohc-core-j8
> ---
>
> Key: CASSANDRA-12133
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12133
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: Ubuntu 14.04, Java 1.8.0_91
>Reporter: Mike
>Assignee: Robert Stupp
>Priority: Trivial
> Fix For: 3.0.x
>
>
> After enabling row cache in cassandra.yaml by setting row_cache_size_in_mb, I 
> receive this warning in system.log during startup:
> {noformat}
> WARN  [main] 2016-07-05 13:36:14,671 Uns.java:169 - Failed to load Java8 
> implementation ohc-core-j8 : java.lang.NoSuchMethodException: 
> org.caffinitas.ohc.linked.UnsExt8.(java.lang.Class)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-12284) Cqlsh not supporting Copy command

2016-07-23 Thread Abhinav Johri (JIRA)
Abhinav Johri created CASSANDRA-12284:
-

 Summary: Cqlsh not supporting Copy command
 Key: CASSANDRA-12284
 URL: https://issues.apache.org/jira/browse/CASSANDRA-12284
 Project: Cassandra
  Issue Type: Bug
  Components: CQL
 Environment: Debian and OSX(yosemite)
Reporter: Abhinav Johri
 Fix For: 3.3


I installed cqlsh for my cassandra server using pip command.

I wanted to copy a table as CSV to my local system so I used COPY TO command 
but it threw me the following error.

Traceback (most recent call last):
  File "/usr/local/bin/cqlsh", line 1133, in onecmd
self.handle_statement(st, statementtext)
  File "/usr/local/bin/cqlsh", line 1170, in handle_statement
return custom_handler(parsed)
  File "/usr/local/bin/cqlsh", line 1837, in do_copy
rows = self.perform_csv_export(ks, cf, columns, fname, opts)
  File "/usr/local/bin/cqlsh", line 1956, in perform_csv_export
csv_options, dialect_options, unrecognized_options = 
copyutil.parse_options(self, opts)
AttributeError: 'module' object has no attribute 'parse_options'




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)