incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@vafer.org>
Subject bulk loading
Date Sun, 20 Jun 2010 17:50:00 GMT
I am trying to get the bulk loading example to work for simple CF.

    List<ColumnFamily> columnFamilies = new LinkedList<ColumnFamily>();

    while(...) {
        String[] fields = ...

        ColumnFamily columnFamily = ColumnFamily.create(keyspace, family);

        long now = System.currentTimeMillis();

        for (int i = 0; i < fields.length; i++) {
            columnFamily.addColumn(new QueryPath(family, null,
                ("col" + i).getBytes(UTF8)),
                fields[i].getBytes(UTF8),
                now);
        }
        columnFamilies.add(columnFamily);

        count += 1;

        if (count % 1000 == 0) {
            Message message = createMessage(keyspace, key.toString(),
family, columnFamilies);
            for (InetAddress endpoint:
StorageService.instance.getNaturalEndpoints(keyspace, key.toString()))
{
                MessagingService.instance.sendOneWay(message, endpoint);
            }
            columnFamilies.clear();
        }
    }

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.

Any suggestions?

cheers
--
Torsten

Mime
View raw message