Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 10417 invoked from network); 21 Jun 2010 10:32:31 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Jun 2010 10:32:31 -0000 Received: (qmail 64886 invoked by uid 500); 21 Jun 2010 10:32:30 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 64743 invoked by uid 500); 21 Jun 2010 10:32:26 -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 64735 invoked by uid 99); 21 Jun 2010 10:32:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jun 2010 10:32:25 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO blingymail-a1.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jun 2010 10:32:16 +0000 Received: from [10.0.1.153] (121-73-157-230.cable.telstraclear.net [121.73.157.230]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by blingymail-a1.g.dreamhost.com (Postfix) with ESMTP id EA3885CE13 for ; Mon, 21 Jun 2010 03:31:54 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) Subject: Re: bulk loading From: aaron morton In-Reply-To: Date: Mon, 21 Jun 2010 22:31:52 +1200 Content-Transfer-Encoding: quoted-printable Message-Id: <2D028C88-7CB3-437D-890A-2617FD935591@thelastpickle.com> References: To: user@cassandra.apache.org X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org You should be using the thrift API, or a wrapper around the thrift API. = It looks like you're using internal cassandra classes.=20 There is a Java wrapper called Hector, and there was another talked = about on the mail list recently. There is also a bulk import / export tool see http://wiki.apache.org/cassandra/Operations Aaron On 21 Jun 2010, at 05:50, Torsten Curdt wrote: > I am trying to get the bulk loading example to work for simple CF. >=20 > List columnFamilies =3D new = LinkedList(); >=20 > while(...) { > String[] fields =3D ... >=20 > ColumnFamily columnFamily =3D ColumnFamily.create(keyspace, = family); >=20 > long now =3D System.currentTimeMillis(); >=20 > for (int i =3D 0; i < fields.length; i++) { > columnFamily.addColumn(new QueryPath(family, null, > ("col" + i).getBytes(UTF8)), > fields[i].getBytes(UTF8), > now); > } > columnFamilies.add(columnFamily); >=20 > count +=3D 1; >=20 > if (count % 1000 =3D=3D 0) { > Message message =3D createMessage(keyspace, key.toString(), > family, columnFamilies); > for (InetAddress endpoint: > StorageService.instance.getNaturalEndpoints(keyspace, key.toString())) > { > MessagingService.instance.sendOneWay(message, = endpoint); > } > columnFamilies.clear(); > } > } >=20 > First I tried with my one "cassandra -f" instance then I saw this > requires a separate IP. (Why?) > But even with a separate IPs > "StorageService.instance.getNaturalEndpoints" does not return an > endpoint. >=20 > Any suggestions? >=20 > cheers > -- > Torsten