Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E73211098E for ; Thu, 11 Jul 2013 00:17:50 +0000 (UTC) Received: (qmail 72658 invoked by uid 500); 11 Jul 2013 00:17:48 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 72597 invoked by uid 500); 11 Jul 2013 00:17:48 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 72391 invoked by uid 99); 11 Jul 2013 00:17:48 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jul 2013 00:17:48 +0000 Date: Thu, 11 Jul 2013 00:17:48 +0000 (UTC) From: "Dave Brosius (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-5733) json2sstable can not read from a pipe even if -n and -s are specified. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-5733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13705266#comment-13705266 ] Dave Brosius commented on CASSANDRA-5733: ----------------------------------------- Patch generally is fine, however 1) you probably should error out on "-" and -s -n 2) please add a close to 'parser' before reopening, probably should also add a close at the end in a finally block as well... Yes not your issue.. existing. formatting 3) cassandra puts curly braces on the next line down 4) no spaces between ) ) 5) there appears to be indenting offset problems > json2sstable can not read from a pipe even if -n and -s are specified. > ---------------------------------------------------------------------- > > Key: CASSANDRA-5733 > URL: https://issues.apache.org/jira/browse/CASSANDRA-5733 > Project: Cassandra > Issue Type: Improvement > Components: Tools > Affects Versions: 1.2.6 > Reporter: Steven Lowenthal > Assignee: Steven Lowenthal > Priority: Minor > Attachments: 5733.txt > > > SSTableImport.importSorted always opens the file twice even if the number of keys are specifed. I changed this to only open the file a second time when -n is not specified. > I moved the second parser = getparser ... call inside the if (keyCountToImport == null) block. > if (keyCountToImport == null) > { > keyCountToImport = 0; > System.out.println("Counting keys to import, please wait... (NOTE: to skip this use -n )"); > parser.nextToken(); // START_ARRAY > while (parser.nextToken() != null) > { > parser.skipChildren(); > if (parser.getCurrentToken() == JsonToken.END_ARRAY) > break; > keyCountToImport++; > } > parser = getParser(jsonFile); // renewing parser only if we read the file already - to support streaming. > } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira