Database Reference
In-Depth Information
You can do the same thing if you're using Windows, but Windows doesn't include a tail program
natively. So to achieve this, you'll need to download and install Cygwin, which is a Bash shell
emulator. Cygwin allows you to have a Linux-style interface and use a variety of Linux tools on
Windows. You can get Cygwin for free from http://www.cygwin.com .
Then you can start Cassandra regularly and tail the logfile using this command:
eben@lucky~$ tail -f C:\\var\\log\\cassandra\\system.log
This will show the output in the console in the same way as if it were foregrounded.
General Tips
Following along
Once you're running the server with debug logging enabled, you can see a lot more happening
that can help during debugging. For example, here we can see the output when writing and then
reading a simple value to the database:
DEBUG 12:55:09,778 insert
DEBUG 12:55:09,779 insert writing local key mycol
DEBUG 12:55:36,387 get
DEBUG 12:55:36,390 weakreadlocal reading SliceByNamesReadCommand(
table='Keyspace1', key='mycol',
columnParent='QueryPath(columnFamilyName='Standard1',
superColumnName='null', columnName='null')',
columns=[6b6579393939,])
That's the server output generated by executing this command in the CLI:
cassandra> set Keyspace1.Standard1['mycol']['key999']='value999'
Value inserted.
cassandra> get Keyspace1.Standard1['mycol']['key999']
=> ( column=6b6579393939 , value=value999, timestamp=1277409309778000
Notice what's happened here. We've inserted a value in the column family named Standard1 .
When we perform a get request, the column key key999 is translated to 6b6579393939 , be-
cause the Standard1 column family is defined as using BytesType as a CompareWith value.
However, if we use the Standard2 column family, we'll see the key column name on the get
request as we typed it because that column family is defined as using a CompareWith of UTF-8.
So again we'll do a set and then a get request for the same value. The CLI output is shown
here:
cassandra> set Keyspace1.Standard2['mycol']['key888']='value888'
Value inserted.
Search WWH ::




Custom Search