Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. [edward@tablitha apache-cassandra-1.2.0-beta1]$ bin/cqlsh -3
  2. Connected to Test Cluster at localhost:9160.
  3. [cqlsh 2.2.0 | Cassandra 1.2.0-beta1 | CQL spec 3.0.0 | Thrift protocol 19.34.0]
  4. Use HELP for help.
  5. cqlsh> use videos;
  6. cqlsh:videos> SELECT * FROM videos WHERE videoname = 'My funny cat';
  7. videoid | videoname | description | tags | upload_date | username
  8. --------------------------------------+--------------+-------------------------------------------+----------------+--------------------------+----------
  9. 99051fe9-6a9c-46c2-b949-38ef78858dd0 | My funny cat | My cat likes to play the piano! So funny. | cats,piano,lol | 2012-06-01 08:00:00+0000 | ctodd
  10.  
  11.  
  12. cqlsh:videos> exit;
  13. [edward@tablitha apache-cassandra-1.2.0-beta1]$ bin/cassandra-cli
  14. Connected to: "Test Cluster" on 127.0.0.1/9160
  15. Welcome to Cassandra CLI version 1.2.0-beta1
  16.  
  17. Type 'help;' or '?' for help.
  18. Type 'quit;' or 'exit;' to quit.
  19.  
  20. [default@unknown] use videos;
  21. Authenticated to keyspace: videos
  22. [default@videos] list videos;
  23. videos not found in current keyspace.
  24. [default@videos] show schema;
  25. create keyspace videos
  26. with placement_strategy = 'NetworkTopologyStrategy'
  27. and strategy_options = {datacenter1 : 1}
  28. and durable_writes = true;
  29.  
  30. use videos;
  31.  
  32.  
  33.  
  34.  
  35. cqlsh> use videos;
  36. cqlsh:videos> show schema;
  37. Improper show command.
  38. cqlsh:videos> describe schema;
  39.  
  40. CREATE KEYSPACE abc WITH strategy_class = 'NetworkTopologyStrategy'
  41. AND strategy_options:datacenter1 = '1';
  42.  
  43. CREATE KEYSPACE system WITH strategy_class = 'LocalStrategy';
  44.  
  45. USE system;
  46.  
  47. CREATE TABLE hints (
  48. target_id uuid PRIMARY KEY
  49. ) WITH
  50. comment='hints awaiting delivery' AND
  51. comparator='org.apache.cassandra.db.marshal.CompositeType'<timeuuid, int> AND
  52. read_repair_chance=0.000000 AND
  53. gc_grace_seconds=0 AND
  54. default_validation=blob AND
  55. replicate_on_write='true' AND
  56. compaction_strategy_class='SizeTieredCompactionStrategy' AND
  57. compaction_strategy_options:min_threshold='0' AND
  58. compaction_strategy_options:max_threshold='0' AND
  59. compression_parameters:sstable_compression='SnappyCompressor';
  60.  
  61. CREATE TABLE "Schema" (
  62. KEY blob PRIMARY KEY
  63. ) WITH
  64. comment='unused' AND
  65. comparator=text AND
  66. read_repair_chance=0.000000 AND
  67. gc_grace_seconds=0 AND
  68. default_validation=blob AND
  69. replicate_on_write='true' AND
  70. compaction_strategy_class='SizeTieredCompactionStrategy';
  71.  
  72. CREATE TABLE schema_keyspaces (
  73. keyspace_name text PRIMARY KEY,
  74. strategy_options text,
  75. durable_writes boolean,
  76. strategy_class text
  77. ) WITH
  78. comment='keyspace definitions' AND
  79. comparator=text AND
  80. read_repair_chance=0.000000 AND
  81. gc_grace_seconds=8640 AND
  82. default_validation=text AND
  83. replicate_on_write='true' AND
  84. compaction_strategy_class='SizeTieredCompactionStrategy' AND
  85. compression_parameters:sstable_compression='SnappyCompressor';
  86.  
  87. CREATE TABLE "HintsColumnFamily" (
  88. KEY blob PRIMARY KEY
  89. ) WITH
  90. comment='unused' AND
  91. comparator=blob AND
  92. read_repair_chance=0.000000 AND
  93. gc_grace_seconds=0 AND
  94. default_validation=blob AND
  95. replicate_on_write='true' AND
  96. compaction_strategy_class='SizeTieredCompactionStrategy';
  97.  
  98. CREATE TABLE "NodeIdInfo" (
  99. "key" text PRIMARY KEY
  100. ) WITH
  101. comment='counter node IDs' AND
  102. comparator=timeuuid AND
  103. read_repair_chance=0.000000 AND
  104. gc_grace_seconds=0 AND
  105. default_validation=text AND
  106. replicate_on_write='true' AND
  107. compaction_strategy_class='SizeTieredCompactionStrategy' AND
  108. compression_parameters:sstable_compression='SnappyCompressor';
  109.  
  110. CREATE TABLE "IndexInfo" (
  111. table_name text PRIMARY KEY
  112. ) WITH
  113. comment='indexes that have been completed' AND
  114. comparator=text AND
  115. read_repair_chance=0.000000 AND
  116. gc_grace_seconds=0 AND
  117. default_validation=text AND
  118. replicate_on_write='true' AND
  119. compaction_strategy_class='SizeTieredCompactionStrategy' AND
  120. compression_parameters:sstable_compression='SnappyCompressor';
  121.  
  122. CREATE TABLE "Migrations" (
  123. KEY blob PRIMARY KEY
  124. ) WITH
  125. comment='unused' AND
  126. comparator=timeuuid AND
  127. read_repair_chance=0.000000 AND
  128. gc_grace_seconds=0 AND
  129. default_validation=blob AND
  130. replicate_on_write='true' AND
  131. compaction_strategy_class='SizeTieredCompactionStrategy';
  132.  
  133. CREATE TABLE "LocationInfo" (
  134. KEY blob PRIMARY KEY
  135. ) WITH
  136. comment='unused' AND
  137. comparator=blob AND
  138. read_repair_chance=0.000000 AND
  139. gc_grace_seconds=0 AND
  140. default_validation=blob AND
  141. replicate_on_write='true' AND
  142. compaction_strategy_class='SizeTieredCompactionStrategy';
  143.  
  144. CREATE KEYSPACE testks WITH strategy_class = 'NetworkTopologyStrategy'
  145. AND strategy_options:datacenter1 = '1';
  146.  
  147. USE testks;
  148.  
  149.  
  150. CREATE KEYSPACE videos WITH strategy_class = 'NetworkTopologyStrategy'
  151. AND strategy_options:datacenter1 = '1';
  152.  
  153. CREATE KEYSPACE system_traces WITH strategy_class = 'SimpleStrategy'
  154. AND strategy_options:replication_factor = '1';
  155.  
  156. cqlsh:videos>
  157.  
  158.  
  159.  
  160. cqlsh:videos> describe table videos;
  161.  
  162. CREATE TABLE videos (
  163. videoid uuid,
  164. videoname text,
  165. description text,
  166. tags text,
  167. upload_date timestamp,
  168. username text,
  169. PRIMARY KEY (videoid, videoname)
  170. ) WITH
  171. comment='' AND
  172. caching='KEYS_ONLY' AND
  173. read_repair_chance=0.100000 AND
  174. gc_grace_seconds=864000 AND
  175. replicate_on_write='true' AND
  176. compaction_strategy_class='SizeTieredCompactionStrategy' AND
  177. compression_parameters:sstable_compression='SnappyCompressor';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement