vertex_ids table missing in cassandra under the janusgraph keyspace? - cassandra

Titan graph when used with cassandra creates a table "vertex_ids" under the "titan" keyspace. But when working with janus , I can't seem to find the "vertex_ids" table under the 'janusgrpah' keyspace. Also I read the documentation where they describe how the values are stored but it doesn't tell under which tables.

JanusGraph started from TitanDB 1.0.0. Both are using these below cassandra tables :
edgestore : Store Vertex, Property and Edges as Adjacency List
graphindex : Builtin indexes for vertex and edge properties
titan_ids (TitanDB) janusgraph_ids (JanusGraph) : Store ID Block
txlog : Store Transaction Log
systemlog : Store System Log
system_properties : Store System Properties
edgestore_lock_ : Used to lock edgestore table
graphindex_lock_ : Used to lock graphindex table
system_properties_lock_ : Used to lock system_properties table

Related

Cassandra: Refer a table with multiple names

Can we refer a Cassandra table with multiple names ?
Say I have created a table with keyspacename.maintable
Now I want to refer keyspacename.maintable table as
keyspacename.alternatename1,
keyspacename.alternatename2,
keyspacename.alternatename3.
Is it possible ?
Hope Cassandra doesn't have this feature of alais, but this could be achieved using Cassandra datastax driver, cqlengine object mapper. Using object mapper, you can access a table as object with different object names.

Cassandra keyspace for counters

I am trying to create a table for keeping counters to different hits on my APIs. I am using Cassandra 2.0.6, and aware that there have been some performance improvements to counters starting 2.1.0, but cant upgrade at this moment.
The documentation i read on datastax always starts with creating a separate keyspace like these:
http://www.datastax.com/documentation/cql/3.0/cql/cql_using/use_counter_t.html
http://www.datastax.com/documentation/cql/3.1/cql/cql_using/use_counter_t.html
From documentation:
Create a keyspace on Linux for use in a single data center, single node cluster. Use the default data center name from the output of the nodetool status command, for example datacenter1.
CREATE KEYSPACE counterks WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 1 };
Question:
1)Does it mean that i should keep my counters in a separate keyspace
2)If yes, should i declare the keyspace as defined in documentation examples, or thats just an example and i can set my own replication strategy - specifically replicate across data centers.
Thanks
Sorry you had trouble with the instructions. The instructions need to be changed to make it clear that this is just an example and improved by changing RF to 3, for example.
Using a keyspace for a single data center and single node cluster is not a requirement. You need to keep counters in separate tables, but not separate keyspaces; however, keeping tables in separate keyspaces gives you the flexibility to change the consistency and replication from table to table. Normally you have one keyspace per application. See related single vs mutliple keyspace discussion on http://grokbase.com/t/cassandra/user/145bwd3va8/effect-of-number-of-keyspaces-on-write-throughput.

Spark Cassandra connector - where clause

I am trying to do some analytics on time series data stored in cassandra by using spark and the new connector published by Datastax.
In my schema the Partition key is the meter ID and I want to run spark operations only on specifics series, therefore I need to filter by meter ID.
I would like then to run a query like: Select * from timeseries where series_id = X
I have tried to achieve this by doing:
JavaRDD<CassandraRow> rdd = sc.cassandraTable("test", "timeseries").select(columns).where("series_id = ?",ids).toJavaRDD();
When executing this code the resulting query is:
SELECT "series_id", "timestamp", "value" FROM "timeseries" WHERE token("series_id") > 1059678427073559546 AND token("series_id") <= 1337476147328479245 AND series_id = ? ALLOW FILTERING
A clause is automatically added on my partition key (token("series_id") > X AND token("series_id") <=Y) and then mine is appended after that. This obviously does not work and I get an error saying: "series_id cannot be restricted by more than one relation if it includes an Equal".
Is there a way to get rid of the clause added automatically? Am I missing something?
Thanks in advance
The driver automatically determines the partition key using table metadata it fetches from the cluster itself. It then uses this to append the token ranges to your CQL so that it can read a chunk of data from the specific node it's trying to query. In other words, Cassandra thinks series_id is your partition key and not meter_id. If you run a describe command on your table, I bet you'll be surprised.

cassandra create column family error

I'm starting to learn cassandra. So far I have created a keyspace. Next, I simply want to create a column family. Reading docs, this should simply be:
create column family DATASTORE;
I keep getting the error:
Bad Request: line 1:7 no viable alternative at input 'column'
Installed Cassandra on windows.
I'm using Cassandra CQL.
Thanks.
I suggest reading the "Creating a table with CQL" section of the docs.
This command is only appropriate for the CLI Utility application - and is not valid CQL. This video provides a good overview: https://www.youtube.com/watch?v=WSCrwBueoPI&list=PL3E5AC388940EEC0A
You need to supply more parameters to dictate what the table (also known as a column family) will store.
First create a keyspace (the below is in cql)
CREATE KEYSPACE firstkeyspace
WITH REPLICATION =
{
'class': 'SimpleStrategy',
'replication_factor': '2'
}
Then here is what you want. This will create a table named userz in the firstkeyspace keyspace. The below table will store two columns (columns as in columns of a table).
CREATE TABLE firstkeyspace.userz (
user text,
password text,
PRIMARY KEY (user)
);

Cassandra - Column family exists but is not visible via describe or OpsCenter

I'm currently evaluating Cassandra for an upcoming project and am trying to get my head around the basics.
I have an issue where when creating a column family via the CQL Shell - the column family is created as usable however it does not appear when I issue a DESCRIBE command with the CLI tool or when looking at the Cluster via DataStax OpsCenter.
I've created the keyspace as such:
CREATE KEYSPACE Testing
WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
and defined the column family as:
CREATE TABLE SampleTable(
Id int PRIMARY KEY,
Name text,
OtherValue int
);
I can successfully insert and select data from SampleTable however it does not show up with a Describe command or in OpsCenter.
I can create a visible Column Family using the CLI command line, or the API in FluentCassandra but would like to use the CQL approach.
This is day one with Cassandra so I'm sure I'm missing something simple. Any pointers?
Column families created with CQL3 do not show up when using the thrift API. See the following issues for more information:
https://issues.apache.org/jira/browse/CASSANDRA-4377
https://issues.apache.org/jira/browse/CASSANDRA-4924

Resources