Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2505A200BC2 for ; Thu, 17 Nov 2016 17:54:37 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 24B80160B0B; Thu, 17 Nov 2016 16:54:37 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6D762160AD8 for ; Thu, 17 Nov 2016 17:54:36 +0100 (CET) Received: (qmail 95316 invoked by uid 500); 17 Nov 2016 16:54:27 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 95280 invoked by uid 99); 17 Nov 2016 16:54:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2016 16:54:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C3C5618009B for ; Thu, 17 Nov 2016 16:54:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.821 X-Spam-Level: X-Spam-Status: No, score=-0.821 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 5GkZ7sRG2DgM for ; Thu, 17 Nov 2016 16:54:25 +0000 (UTC) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.54]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id F33805FC72 for ; Thu, 17 Nov 2016 16:54:24 +0000 (UTC) Received: by mail-it0-f54.google.com with SMTP id l8so149304809iti.1 for ; Thu, 17 Nov 2016 08:54:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=9Nwq8JZc6bmC+zDstHMx2+8kiDNr9/iULOcdMbtXNAU=; b=nKUGtF0ji9J7WhrRwuqDr0+sa/wPZZX4hR3sqcVELlIsv8F1H6Enf7WEv3R4qMWRJT C0FOaGbmGnIa3LsXbbEa+hbvh9aHyqfg0g+tTkcwu0i3uWmlJaIfM6UTyfbaab+rEhGQ B/eqK3XmHu8+pr583IcU28qH1lOLKqjIyj3mLZlkEOALSE1k0S/h+1eH8fK7cpaPIkYw 1Jgb33l0lHuVKCUVKL+jL8vMntfvDTbHLHmckSHRNOETeHNGWJpUzHC1trSbtri8oAX4 drdh9OE6KSWMAQglr8jsY7L1nfNPMJZcfkvfZ/dIQ0KPyt6MaiXxyry5SyJLqtTS0sA+ Mcqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=9Nwq8JZc6bmC+zDstHMx2+8kiDNr9/iULOcdMbtXNAU=; b=Js3FV861fXISml1H6fDmI6JRBjs2TIgytaY0dMUzemU039+QRuCc8smAU5X3Rp8RHX VOCROmNae6VS2YrvSbf5IbPQcAhCMhySnkTMj042lpi+VaS20M4MJfC4+UyZoLGMNBLg NUvFI6BOmvbNNISTDeJbpMSK1fmFIaSAygdDMHL9Rc0oLQj00AAObGdj3ap6sx/PXGUB /I5nPifASkcnqqzFwxul8G0nCvKuMUTSupTByabu/KslWLRgZAyyqMWXFIGhnxquB8ke vHbBl5peRxBG5APL/+uGdWw6PPYXGYvNzK7O+oDoXzQuZPQt4FnV9C9oCSlI64p2d9hA bp0w== X-Gm-Message-State: ABUngvfbC4tiwkGPr5+YpNzQiMD/x2xrvNBMUmHoxfr7wmXWdikoqVFRK/n6dS8NgyWOYD1cQBqc+A7A4ugzYg== X-Received: by 10.36.82.22 with SMTP id d22mr3742071itb.53.1479401656716; Thu, 17 Nov 2016 08:54:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.12.198 with HTTP; Thu, 17 Nov 2016 08:54:15 -0800 (PST) From: Muhammad Afzal Date: Thu, 17 Nov 2016 21:54:15 +0500 Message-ID: Subject: Bulkloading using CqlBulkOutputFormat Format To: user@cassandra.apache.org Content-Type: text/plain; charset=UTF-8 archived-at: Thu, 17 Nov 2016 16:54:37 -0000 Hi, I could not find any documentation or help on how to use CqlBulkOutputFormat for bulk loading data into Cassandra. Could anyone please share some guidelines on how to write MR job to bulkload data into Cassandra using CqlBulkOutputFormat. I tried something like shown below, which failed with an exception given at the end: Configuration conf = getConf(); Job job = new Job(conf, this.getClass().toString()); FileInputFormat.setInputPaths(job, inputPath); FileOutputFormat.setOutputPath(job, outputPath); job.setJobName("Test"); job.setJarByClass(Myloader.class); job.setInputFormatClass(TextInputFormat.class); job.setMapOutputKeyClass(Object.class); job.setMapOutputValueClass(List.class); job.setNumReduceTasks(0); job.setMapperClass(Map.class); job.setOutputFormatClass(CqlBulkOutputFormat.class); ConfigHelper.setOutputKeyspace(job.getConfiguration(),KEYSPACE); ConfigHelper.setOutputColumnFamily(job.getConfiguration(),KEYSPACE, TABLE); ConfigHelper.setOutputRpcPort(job.getConfiguration(), "9160"); ConfigHelper.setOutputInitialAddress(job.getConfiguration(), "localhost"); ConfigHelper.setOutputPartitioner(job.getConfiguration(),"Murmur3Partitioner"); CqlBulkOutputFormat.setTableSchema(job.getConfiguration(), TABLE, SCHEMA); CqlBulkOutputFormat.setTableInsertStatement(job.getConfiguration(), TABLE, INSERT_STMT); public static class Map extends Mapper> { @Override public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { .... context.write(someObj, list); } } Even tried setting // conf.set("cassandra.config", "file:///opt/cluster/apache-cassandra-2.2.8/conf/cassandra.yaml"); but it did not work, here is the exception: Error: org.apache.cassandra.exceptions.ConfigurationException: Expecting URI in variable: [cassandra.config]. Please prefix the file with file:/// for local files or file:/// for remote files. Aborting. If you are executing this from an external tool, it needs to set Config.setClientMode(true) to avoid loading configuration. Any help regarding how to fix above issue will be highly appreciated Thank you Afzal