Hi
I am using 0.7.0-beta1 , and trying to get the contrib/client_only
example
to work.
I am running cassandra on host1, and trying to access it from host2.
When using thirft (via cassandra-cli) and in my application; I am
able to
connect and do all operations as expected.
But I am not able to connect to cassandra when using the code in
client_only
(or far that matter using contrib/bmt_example). Since my test
requires to
do bulk insertion of about 1.4 TB of data, so I need to use a non-
thirft
interface.
The error that I am getting is follows (the keyspace and the column
family
exist and can be used via Thirft) :
10/09/16 12:35:31 INFO config.DatabaseDescriptor: DiskAccessMode
'auto'
determined to be mmap, indexAccessMode is mmap
10/09/16 12:35:31 INFO service.StorageService: Starting up client
gossip
Exception in thread "main" java.lang.IllegalArgumentException:
Unknown
ColumnFamily Standard1 in keyspace Keyspace1
at
org
.apache
.cassandra
.config.DatabaseDescriptor.getComparator(DatabaseDescriptor.java:
1009)
at
org
.apache
.cassandra.db.ColumnFamily.getComparatorFor(ColumnFamily.java:418)
at gaia.cu7.cassandra.input.Ingestor.testWriting(Ingestor.java:103)
at gaia.cu7.cassandra.input.Ingestor.main(Ingestor.java:187)
I am using the following code (from client_only example) (also
passing JVM
parameter -Dstorage-config=path_2_cassandra.yaml)
public static void main(String[] args) throws Exception {
System.setProperty("storage-config","cassandra.yaml");
testWriting();
}
// from client_only example
private static void testWriting() throws Exception
{
StorageService.instance.initClient();
// sleep for a bit so that gossip can do its thing.
try
{
Thread.sleep(10000L);
}
catch (Exception ex)
{
throw new AssertionError(ex);
}
// do some writing.
final AbstractType comp =
ColumnFamily.getComparatorFor("Keyspace1",
"Standard1", null);
for (int i = 0; i < 100; i++)
{
RowMutation change = new RowMutation("Keyspace1",
("key" +
i).getBytes());
ColumnPath cp = new
ColumnPath("Standard1").setColumn(("colb").getBytes());
change.add(new QueryPath(cp), ("value" + i).getBytes(),
new
TimestampClock(0));
// don't call change.apply(). The reason is that is
makes a
static call into Table, which will perform
// local storage initialization, which creates local
directories.
// change.apply();
StorageProxy.mutate(Arrays.asList(change));
System.out.println("wrote key" + i);
}
System.out.println("Done writing.");
StorageService.instance.stopClient();
}