You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2009/07/30 02:29:29 UTC
svn commit: r799140 [3/3] - in /incubator/cassandra/trunk: conf/ interface/
interface/gen-java/org/apache/cassandra/service/
src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/config/
src/java/org/apache/cassandra/db/ src/java/org/apache/...
Modified: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/ConsistencyLevel.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/ConsistencyLevel.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/ConsistencyLevel.java (original)
+++ incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/ConsistencyLevel.java Thu Jul 30 00:29:28 2009
@@ -19,12 +19,7 @@
public static final int QUORUM = 2;
public static final int ALL = 3;
- public static final IntRangeSet VALID_VALUES = new IntRangeSet(
- ZERO,
- ONE,
- QUORUM,
- ALL );
-
+ public static final IntRangeSet VALID_VALUES = new IntRangeSet(ZERO, ONE, QUORUM, ALL);
public static final Map<Integer, String> VALUES_TO_NAMES = new HashMap<Integer, String>() {{
put(ZERO, "ZERO");
put(ONE, "ONE");
Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g Thu Jul 30 00:29:28 2009
@@ -178,8 +178,8 @@
K_QUIT: 'QUIT';
K_SET: 'SET';
K_SHOW: 'SHOW';
-K_TABLE: 'TABLE';
-K_TABLES: 'TABLES';
+K_TABLE: 'KEYSPACE';
+K_TABLES: 'KEYSPACES';
K_THRIFT: 'THRIFT';
K_VERSION: 'VERSION';
Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Thu Jul 30 00:29:28 2009
@@ -93,14 +93,14 @@
css_.out.println("List of all CLI commands:");
css_.out.println("? Same as help.");
css_.out.println("connect <hostname>/<port> Connect to Cassandra's thrift service.");
- css_.out.println("describe table <tbl> Describe table.");
+ css_.out.println("describe keyspace <keyspacename> Describe keyspace.");
css_.out.println("exit Exit CLI.");
css_.out.println("explain plan [<set stmt>|<get stmt>|<select stmt>] Explains the PLAN for specified stmt.");
css_.out.println("help Display this help.");
css_.out.println("quit Exit CLI.");
css_.out.println("show config file Display contents of config file");
css_.out.println("show cluster name Display cassandra server version");
- css_.out.println("show tables Show list of tables.");
+ css_.out.println("show keyspaces Show list of keyspaces.");
css_.out.println("show version Show server version.");
css_.out.println("select ... CQL select statement (TBD).");
css_.out.println("get ... CQL data retrieval statement.");
@@ -229,7 +229,7 @@
if (!CliMain.isConnected())
return;
- List<String> tables = thriftClient_.get_string_list_property("tables");
+ List<String> tables = thriftClient_.get_string_list_property("keyspaces");
for (String table : tables)
{
css_.out.println(table);
@@ -250,7 +250,7 @@
// Describe and display
Map<String, Map<String, String>> columnFamiliesMap;
try {
- columnFamiliesMap = thriftClient_.describe_table(tableName);
+ columnFamiliesMap = thriftClient_.describe_keyspace(tableName);
for (String columnFamilyName: columnFamiliesMap.keySet()) {
Map<String, String> columnMap = columnFamiliesMap.get(columnFamilyName);
String desc = columnMap.get("Desc");
@@ -264,7 +264,7 @@
css_.out.println("------");
}
} catch (NotFoundException e) {
- css_.out.println("Table " + tableName + " could not be found.");
+ css_.out.println("Keyspace " + tableName + " could not be found.");
}
return;
Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Thu Jul 30 00:29:28 2009
@@ -327,7 +327,7 @@
}
/* Read the table related stuff from config */
- NodeList tables = xmlUtils.getRequestedNodeList("/Storage/Tables/Table");
+ NodeList tables = xmlUtils.getRequestedNodeList("/Storage/Keyspaces/Keyspace");
int size = tables.getLength();
for ( int i = 0; i < size; ++i )
{
@@ -346,7 +346,7 @@
tables_.add(tName);
tableToCFMetaDataMap_.put(tName, new HashMap<String, CFMetaData>());
- String xqlCacheSize = "/Storage/Tables/Table[@Name='" + tName + "']/KeysCachedFraction";
+ String xqlCacheSize = "/Storage/Keyspaces/Keyspace[@Name='" + tName + "']/KeysCachedFraction";
value = xmlUtils.getNodeValue(xqlCacheSize);
if (value == null)
{
@@ -357,7 +357,7 @@
tableKeysCachedFractions_.put(tName, Double.valueOf(value));
}
- String xqlTable = "/Storage/Tables/Table[@Name='" + tName + "']/";
+ String xqlTable = "/Storage/Keyspaces/Keyspace[@Name='" + tName + "']/";
NodeList columnFamilies = xmlUtils.getRequestedNodeList(xqlTable + "ColumnFamily");
// get name of the rowKey for this table
Copied: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/KeyspaceNotDefinedException.java (from r799065, incubator/cassandra/trunk/src/java/org/apache/cassandra/db/TableNotDefinedException.java)
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/KeyspaceNotDefinedException.java?p2=incubator/cassandra/trunk/src/java/org/apache/cassandra/db/KeyspaceNotDefinedException.java&p1=incubator/cassandra/trunk/src/java/org/apache/cassandra/db/TableNotDefinedException.java&r1=799065&r2=799140&rev=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/TableNotDefinedException.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/KeyspaceNotDefinedException.java Thu Jul 30 00:29:28 2009
@@ -20,9 +20,9 @@
import org.apache.cassandra.service.InvalidRequestException;
-public class TableNotDefinedException extends InvalidRequestException
+public class KeyspaceNotDefinedException extends InvalidRequestException
{
- public TableNotDefinedException(String why)
+ public KeyspaceNotDefinedException(String why)
{
super(why);
}
Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraDaemon.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraDaemon.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraDaemon.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraDaemon.java Thu Jul 30 00:29:28 2009
@@ -85,7 +85,7 @@
for (String table : tables)
{
if (logger.isDebugEnabled())
- logger.debug("opening table " + table);
+ logger.debug("opening keyspace " + table);
Table tbl = Table.open(table);
tbl.onStart();
}
Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java Thu Jul 30 00:29:28 2009
@@ -463,7 +463,7 @@
public List<String> get_string_list_property(String propertyName)
{
- if (propertyName.equals("tables"))
+ if (propertyName.equals("keyspaces"))
{
return DatabaseDescriptor.getTables();
}
@@ -473,11 +473,11 @@
}
}
- public Map<String,Map<String,String>> describe_table(String tableName) throws NotFoundException
+ public Map<String, Map<String, String>> describe_keyspace(String table) throws NotFoundException
{
Map <String, Map<String, String>> columnFamiliesMap = new HashMap<String, Map<String, String>> ();
- Map<String, CFMetaData> tableMetaData = DatabaseDescriptor.getTableMetaData(tableName);
+ Map<String, CFMetaData> tableMetaData = DatabaseDescriptor.getTableMetaData(table);
// table doesn't exist
if (tableMetaData == null) {
throw new NotFoundException();
Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/ThriftValidation.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/ThriftValidation.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/ThriftValidation.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/ThriftValidation.java Thu Jul 30 00:29:28 2009
@@ -1,8 +1,7 @@
package org.apache.cassandra.service;
-import org.apache.cassandra.db.TableNotDefinedException;
+import org.apache.cassandra.db.KeyspaceNotDefinedException;
import org.apache.cassandra.db.ColumnFamilyNotDefinedException;
-import org.apache.cassandra.db.RowMutation;
import org.apache.cassandra.config.DatabaseDescriptor;
public class ThriftValidation
@@ -21,7 +20,7 @@
}
}
- static void validateCommand(String tablename, String... columnFamilyNames) throws TableNotDefinedException, ColumnFamilyNotDefinedException
+ static void validateCommand(String tablename, String... columnFamilyNames) throws KeyspaceNotDefinedException, ColumnFamilyNotDefinedException
{
validateTable(tablename);
for (String cfName : columnFamilyNames)
@@ -33,11 +32,11 @@
}
}
- private static void validateTable(String tablename) throws TableNotDefinedException
+ private static void validateTable(String tablename) throws KeyspaceNotDefinedException
{
if (!DatabaseDescriptor.getTables().contains(tablename))
{
- throw new TableNotDefinedException("Table " + tablename + " does not exist in this schema.");
+ throw new KeyspaceNotDefinedException("Keyspace " + tablename + " does not exist in this schema.");
}
}
Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java Thu Jul 30 00:29:28 2009
@@ -328,7 +328,7 @@
double tableTotalReadTime = 0.0f;
double tableTotalWriteTime = 0.0f;
- outs.println("Table: " + tableName);
+ outs.println("Keyspace: " + tableName);
for (ColumnFamilyStoreMBean cfstore: columnFamilies) {
int writeCount = cfstore.getWriteCount();
int readCount = cfstore.getReadCount();
Modified: incubator/cassandra/trunk/test/conf/storage-conf.xml
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/conf/storage-conf.xml?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/conf/storage-conf.xml (original)
+++ incubator/cassandra/trunk/test/conf/storage-conf.xml Thu Jul 30 00:29:28 2009
@@ -40,21 +40,21 @@
<StagingFileDirectory>build/test/cassandra/staging</StagingFileDirectory>
<MemtableSizeInMB>1</MemtableSizeInMB>
<MemtableObjectCountInMillions>0.00002</MemtableObjectCountInMillions> <!-- 20 -->
- <Tables>
- <Table Name = "Table1">
+ <Keyspaces>
+ <Keyspace Name = "Keyspace1">
<ColumnFamily Name="Standard1"/>
<ColumnFamily Name="Standard2"/>
<ColumnFamily CompareWith="LongType" Name="StandardLong1"/>
<ColumnFamily CompareWith="LongType" Name="StandardLong2"/>
<ColumnFamily ColumnType="Super" CompareSubcolumnsWith="LongType" Name="Super1"/>
<ColumnFamily ColumnType="Super" CompareSubcolumnsWith="LongType" Name="Super2"/>
- </Table>
- <Table Name = "Table2">
+ </Keyspace>
+ <Keyspace Name = "Keyspace2">
<ColumnFamily Name="Standard1"/>
<ColumnFamily Name="Standard3"/>
<ColumnFamily ColumnType="Super" Name="Super3"/>
- </Table>
- </Tables>
+ </Keyspace>
+ </Keyspaces>
<Seeds>
<!-- Add names of hosts that are deemed contact points -->
<Seed>127.0.0.1</Seed>
Modified: incubator/cassandra/trunk/test/system/test_server.py
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/system/test_server.py?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/system/test_server.py (original)
+++ incubator/cassandra/trunk/test/system/test_server.py Thu Jul 30 00:29:28 2009
@@ -39,8 +39,8 @@
consistencyLevel = ConsistencyLevel.ONE
else:
consistencyLevel = ConsistencyLevel.ZERO
- client.insert('Table1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 0, consistencyLevel)
- client.insert('Table1', 'key1', ColumnPath('Standard1', column='c2'), 'value2', 0, consistencyLevel)
+ client.insert('Keyspace1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 0, consistencyLevel)
+ client.insert('Keyspace1', 'key1', ColumnPath('Standard1', column='c2'), 'value2', 0, consistencyLevel)
def _insert_batch(block):
cfmap = {'Standard1': _SIMPLE_COLUMNS,
@@ -50,68 +50,68 @@
else:
consistencyLevel = ConsistencyLevel.ZERO
- client.batch_insert('Table1', BatchMutation(key='key1', cfmap=cfmap), consistencyLevel)
+ client.batch_insert('Keyspace1', BatchMutation(key='key1', cfmap=cfmap), consistencyLevel)
def _verify_batch():
_verify_simple()
- L = client.get_slice('Table1', 'key1', ColumnParent('Standard2'), '', '', True, 1000, ConsistencyLevel.ONE)
+ L = client.get_slice('Keyspace1', 'key1', ColumnParent('Standard2'), '', '', True, 1000, ConsistencyLevel.ONE)
assert L == _SIMPLE_COLUMNS, L
def _verify_simple():
- assert client.get_column('Table1', 'key1', ColumnPath('Standard1', column='c1'), ConsistencyLevel.ONE) == Column('c1', 'value1', 0)
- L = client.get_slice('Table1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE)
+ assert client.get_column('Keyspace1', 'key1', ColumnPath('Standard1', column='c1'), ConsistencyLevel.ONE) == Column('c1', 'value1', 0)
+ L = client.get_slice('Keyspace1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE)
assert L == _SIMPLE_COLUMNS, L
def _insert_super():
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc1', _i64(4)), 'value4', 0, ConsistencyLevel.ZERO)
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 0, ConsistencyLevel.ZERO)
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(6)), 'value6', 0, ConsistencyLevel.ZERO)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc1', _i64(4)), 'value4', 0, ConsistencyLevel.ZERO)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 0, ConsistencyLevel.ZERO)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(6)), 'value6', 0, ConsistencyLevel.ZERO)
time.sleep(0.1)
def _insert_range():
- client.insert('Table1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 0, ConsistencyLevel.ONE)
- client.insert('Table1', 'key1', ColumnPath('Standard1', column='c2'), 'value2', 0, ConsistencyLevel.ONE)
- client.insert('Table1', 'key1', ColumnPath('Standard1', column='c3'), 'value3', 0, ConsistencyLevel.ONE)
+ client.insert('Keyspace1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 0, ConsistencyLevel.ONE)
+ client.insert('Keyspace1', 'key1', ColumnPath('Standard1', column='c2'), 'value2', 0, ConsistencyLevel.ONE)
+ client.insert('Keyspace1', 'key1', ColumnPath('Standard1', column='c3'), 'value3', 0, ConsistencyLevel.ONE)
time.sleep(0.1)
def _verify_range():
- result = client.get_slice('Table1','key1', ColumnParent('Standard1'), 'c1', 'c2', True, 1000, ConsistencyLevel.ONE)
+ result = client.get_slice('Keyspace1','key1', ColumnParent('Standard1'), 'c1', 'c2', True, 1000, ConsistencyLevel.ONE)
assert len(result) == 2
assert result[0].name == 'c1'
assert result[1].name == 'c2'
- result = client.get_slice('Table1','key1', ColumnParent('Standard1'), 'c3', 'c2', False, 1000, ConsistencyLevel.ONE)
+ result = client.get_slice('Keyspace1','key1', ColumnParent('Standard1'), 'c3', 'c2', False, 1000, ConsistencyLevel.ONE)
assert len(result) == 2
assert result[0].name == 'c3'
assert result[1].name == 'c2'
- result = client.get_slice('Table1','key1', ColumnParent('Standard1'), 'a', 'z' , True, 1000, ConsistencyLevel.ONE)
+ result = client.get_slice('Keyspace1','key1', ColumnParent('Standard1'), 'a', 'z' , True, 1000, ConsistencyLevel.ONE)
assert len(result) == 3, result
- result = client.get_slice('Table1','key1', ColumnParent('Standard1'), 'a', 'z' , True, 2, ConsistencyLevel.ONE)
+ result = client.get_slice('Keyspace1','key1', ColumnParent('Standard1'), 'a', 'z' , True, 2, ConsistencyLevel.ONE)
assert len(result) == 2, result
def _insert_super_range():
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc1', _i64(4)), 'value4', 0, False)
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 0, False)
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(6)), 'value6', 0, False)
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc3', _i64(7)), 'value7', 0, False)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc1', _i64(4)), 'value4', 0, False)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 0, False)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(6)), 'value6', 0, False)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc3', _i64(7)), 'value7', 0, False)
time.sleep(0.1)
def _verify_super_range():
- result = client.get_slice_super('Table1','key1', 'Super1', 'sc2', 'sc3', True, 2, ConsistencyLevel.ONE)
+ result = client.get_slice_super('Keyspace1','key1', 'Super1', 'sc2', 'sc3', True, 2, ConsistencyLevel.ONE)
assert len(result) == 2
assert result[0].name == 'sc2'
assert result[1].name == 'sc3'
- result = client.get_slice_super('Table1','key1', 'Super1', 'sc3', 'sc2', False, 2, ConsistencyLevel.ONE)
+ result = client.get_slice_super('Keyspace1','key1', 'Super1', 'sc3', 'sc2', False, 2, ConsistencyLevel.ONE)
assert len(result) == 2
assert result[0].name == 'sc3'
assert result[1].name == 'sc2'
def _verify_super(supercf='Super1'):
- assert client.get_column('Table1', 'key1', ColumnPath(supercf, 'sc1', _i64(4)), ConsistencyLevel.ONE) == Column(_i64(4), 'value4', 0)
- slice = client.get_slice_super('Table1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
+ assert client.get_column('Keyspace1', 'key1', ColumnPath(supercf, 'sc1', _i64(4)), ConsistencyLevel.ONE) == Column(_i64(4), 'value4', 0)
+ slice = client.get_slice_super('Keyspace1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
assert slice == _SUPER_COLUMNS, slice
def _expect_exception(fn, type_):
@@ -132,21 +132,21 @@
_verify_simple()
def test_empty_slice(self):
- assert client.get_slice('Table1', 'key1', ColumnParent('Standard2'), '', '', True, 1000, ConsistencyLevel.ONE) == []
+ assert client.get_slice('Keyspace1', 'key1', ColumnParent('Standard2'), '', '', True, 1000, ConsistencyLevel.ONE) == []
def test_empty_slice_super(self):
- assert client.get_slice_super('Table1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE) == []
+ assert client.get_slice_super('Keyspace1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE) == []
def test_missing_super(self):
- _expect_missing(lambda: client.get_column('Table1', 'key1', ColumnPath('Super1', 'sc1', 'c1'), ConsistencyLevel.ONE))
+ _expect_missing(lambda: client.get_column('Keyspace1', 'key1', ColumnPath('Super1', 'sc1', 'c1'), ConsistencyLevel.ONE))
def test_count(self):
_insert_simple()
_insert_super()
- assert client.get_column_count('Table1', 'key1', ColumnParent('Standard2'), ConsistencyLevel.ONE) == 0
- assert client.get_column_count('Table1', 'key1', ColumnParent('Standard1'), ConsistencyLevel.ONE) == 2
- assert client.get_column_count('Table1', 'key1', ColumnParent('Super1', 'sc2'), ConsistencyLevel.ONE) == 2
- assert client.get_column_count('Table1', 'key1', ColumnParent('Super1'), ConsistencyLevel.ONE) == 2
+ assert client.get_column_count('Keyspace1', 'key1', ColumnParent('Standard2'), ConsistencyLevel.ONE) == 0
+ assert client.get_column_count('Keyspace1', 'key1', ColumnParent('Standard1'), ConsistencyLevel.ONE) == 2
+ assert client.get_column_count('Keyspace1', 'key1', ColumnParent('Super1', 'sc2'), ConsistencyLevel.ONE) == 2
+ assert client.get_column_count('Keyspace1', 'key1', ColumnParent('Super1'), ConsistencyLevel.ONE) == 2
def test_insert_blocking(self):
_insert_simple()
@@ -166,18 +166,18 @@
_verify_batch()
def test_bad_calls(self):
- _expect_exception(lambda: client.insert('Table1', 'key1', ColumnPath('Standard1', 'x', 'y'), 'value', 0, ConsistencyLevel.ONE), InvalidRequestException)
+ _expect_exception(lambda: client.insert('Keyspace1', 'key1', ColumnPath('Standard1', 'x', 'y'), 'value', 0, ConsistencyLevel.ONE), InvalidRequestException)
- _expect_exception(lambda: client.get_column('Table1', 'key1', ColumnPath('Standard1'), ConsistencyLevel.ONE), InvalidRequestException)
- _expect_exception(lambda: client.get_column('Table1', 'key1', ColumnPath('Standard1', 'x', 'y'), ConsistencyLevel.ONE), InvalidRequestException)
- _expect_exception(lambda: client.get_column('Table1', 'key1', ColumnPath('Super1'), ConsistencyLevel.ONE), InvalidRequestException)
- _expect_exception(lambda: client.get_column('Table1', 'key1', ColumnPath('Super1', 'x'), ConsistencyLevel.ONE), InvalidRequestException)
- _expect_exception(lambda: client.get_key_range('Table1', 'S', '', '', 1000), InvalidRequestException)
+ _expect_exception(lambda: client.get_column('Keyspace1', 'key1', ColumnPath('Standard1'), ConsistencyLevel.ONE), InvalidRequestException)
+ _expect_exception(lambda: client.get_column('Keyspace1', 'key1', ColumnPath('Standard1', 'x', 'y'), ConsistencyLevel.ONE), InvalidRequestException)
+ _expect_exception(lambda: client.get_column('Keyspace1', 'key1', ColumnPath('Super1'), ConsistencyLevel.ONE), InvalidRequestException)
+ _expect_exception(lambda: client.get_column('Keyspace1', 'key1', ColumnPath('Super1', 'x'), ConsistencyLevel.ONE), InvalidRequestException)
+ _expect_exception(lambda: client.get_key_range('Keyspace1', 'S', '', '', 1000), InvalidRequestException)
def test_batch_insert_super(self):
cfmap = {'Super1': _SUPER_COLUMNS,
'Super2': _SUPER_COLUMNS}
- client.batch_insert_super_column('Table1', BatchMutation(key='key1', cfmap=cfmap), ConsistencyLevel.ZERO)
+ client.batch_insert_super_column('Keyspace1', BatchMutation(key='key1', cfmap=cfmap), ConsistencyLevel.ZERO)
time.sleep(0.1)
_verify_super('Super1')
_verify_super('Super2')
@@ -185,32 +185,32 @@
def test_batch_insert_super_blocking(self):
cfmap = {'Super1': _SUPER_COLUMNS,
'Super2': _SUPER_COLUMNS}
- client.batch_insert_super_column('Table1', BatchMutation(key='key1', cfmap=cfmap), ConsistencyLevel.ONE)
+ client.batch_insert_super_column('Keyspace1', BatchMutation(key='key1', cfmap=cfmap), ConsistencyLevel.ONE)
_verify_super('Super1')
_verify_super('Super2')
def test_cf_remove_column(self):
_insert_simple()
- client.remove('Table1', 'key1', ColumnPathOrParent('Standard1', column='c1'), 1, ConsistencyLevel.ONE)
- _expect_missing(lambda: client.get_column('Table1', 'key1', ColumnPath('Standard1', column='c1'), ConsistencyLevel.ONE))
- assert client.get_column('Table1', 'key1', ColumnPath('Standard1', column='c2'), ConsistencyLevel.ONE) \
+ client.remove('Keyspace1', 'key1', ColumnPathOrParent('Standard1', column='c1'), 1, ConsistencyLevel.ONE)
+ _expect_missing(lambda: client.get_column('Keyspace1', 'key1', ColumnPath('Standard1', column='c1'), ConsistencyLevel.ONE))
+ assert client.get_column('Keyspace1', 'key1', ColumnPath('Standard1', column='c2'), ConsistencyLevel.ONE) \
== Column('c2', 'value2', 0)
- assert client.get_slice('Table1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) \
+ assert client.get_slice('Keyspace1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) \
== [Column('c2', 'value2', 0)]
# New insert, make sure it shows up post-remove:
- client.insert('Table1', 'key1', ColumnPath('Standard1', column='c3'), 'value3', 0, ConsistencyLevel.ONE)
- assert client.get_slice('Table1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == \
+ client.insert('Keyspace1', 'key1', ColumnPath('Standard1', column='c3'), 'value3', 0, ConsistencyLevel.ONE)
+ assert client.get_slice('Keyspace1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == \
[Column('c2', 'value2', 0), Column('c3', 'value3', 0)]
# Test resurrection. First, re-insert the value w/ older timestamp,
# and make sure it stays removed
- client.insert('Table1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 0, ConsistencyLevel.ONE)
- assert client.get_slice('Table1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == \
+ client.insert('Keyspace1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 0, ConsistencyLevel.ONE)
+ assert client.get_slice('Keyspace1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == \
[Column('c2', 'value2', 0), Column('c3', 'value3', 0)]
# Next, w/ a newer timestamp; it should come back:
- client.insert('Table1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 2, ConsistencyLevel.ONE)
- assert client.get_slice('Table1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == \
+ client.insert('Keyspace1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 2, ConsistencyLevel.ONE)
+ assert client.get_slice('Keyspace1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == \
[Column('c1', 'value1', 2), Column('c2', 'value2', 0), Column('c3', 'value3', 0)]
@@ -219,17 +219,17 @@
_insert_super()
# Remove the key1:Standard1 cf:
- client.remove('Table1', 'key1', ColumnPathOrParent('Standard1'), 3, ConsistencyLevel.ONE)
- assert client.get_slice('Table1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == []
+ client.remove('Keyspace1', 'key1', ColumnPathOrParent('Standard1'), 3, ConsistencyLevel.ONE)
+ assert client.get_slice('Keyspace1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == []
_verify_super()
# Test resurrection. First, re-insert a value w/ older timestamp,
# and make sure it stays removed:
- client.insert('Table1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 0, ConsistencyLevel.ONE)
- assert client.get_slice('Table1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == []
+ client.insert('Keyspace1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 0, ConsistencyLevel.ONE)
+ assert client.get_slice('Keyspace1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == []
# Next, w/ a newer timestamp; it should come back:
- client.insert('Table1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 4, ConsistencyLevel.ONE)
- assert client.get_slice('Table1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == \
+ client.insert('Keyspace1', 'key1', ColumnPath('Standard1', column='c1'), 'value1', 4, ConsistencyLevel.ONE)
+ assert client.get_slice('Keyspace1', 'key1', ColumnParent('Standard1'), '', '', True, 1000, ConsistencyLevel.ONE) == \
[Column('c1', 'value1', 4)]
@@ -238,33 +238,33 @@
_insert_super()
# Make sure remove clears out what it's supposed to, and _only_ that:
- client.remove('Table1', 'key1', ColumnPathOrParent('Super1', 'sc2', _i64(5)), 5, ConsistencyLevel.ONE)
- _expect_missing(lambda: client.get_column('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), ConsistencyLevel.ONE))
- assert client.get_slice_super('Table1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE) == \
+ client.remove('Keyspace1', 'key1', ColumnPathOrParent('Super1', 'sc2', _i64(5)), 5, ConsistencyLevel.ONE)
+ _expect_missing(lambda: client.get_column('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), ConsistencyLevel.ONE))
+ assert client.get_slice_super('Keyspace1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE) == \
[SuperColumn(name='sc1', columns=[Column(_i64(4), 'value4', 0)]),
SuperColumn(name='sc2', columns=[Column(_i64(6), 'value6', 0)])]
_verify_simple()
# New insert, make sure it shows up post-remove:
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(7)), 'value7', 0, ConsistencyLevel.ONE)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(7)), 'value7', 0, ConsistencyLevel.ONE)
scs = [SuperColumn(name='sc1',
columns=[Column(_i64(4), 'value4', 0)]),
SuperColumn(name='sc2',
columns=[Column(_i64(6), 'value6', 0), Column(_i64(7), 'value7', 0)])]
- actual = client.get_slice_super('Table1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
- assert client.get_slice_super('Table1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE) == scs, actual
+ actual = client.get_slice_super('Keyspace1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
+ assert client.get_slice_super('Keyspace1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE) == scs, actual
# Test resurrection. First, re-insert the value w/ older timestamp,
# and make sure it stays removed:
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 0, ConsistencyLevel.ONE)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 0, ConsistencyLevel.ONE)
- actual = client.get_slice_super('Table1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
+ actual = client.get_slice_super('Keyspace1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
assert actual == scs, actual
# Next, w/ a newer timestamp; it should come back
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 6, ConsistencyLevel.ONE)
- actual = client.get_slice_super('Table1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 6, ConsistencyLevel.ONE)
+ actual = client.get_slice_super('Keyspace1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
assert actual == \
[SuperColumn(name='sc1', columns=[Column(_i64(4), 'value4', 0)]),
SuperColumn(name='sc2', columns=[Column(_i64(5), 'value5', 6),
@@ -276,72 +276,72 @@
_insert_super()
# Make sure remove clears out what it's supposed to, and _only_ that:
- client.remove('Table1', 'key1', ColumnPathOrParent('Super1', 'sc2'), 5, ConsistencyLevel.ONE)
- _expect_missing(lambda: client.get_column('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), ConsistencyLevel.ONE))
- actual = client.get_slice('Table1', 'key1', ColumnParent('Super1', 'sc2'), '', '', True, 1000, ConsistencyLevel.ONE)
+ client.remove('Keyspace1', 'key1', ColumnPathOrParent('Super1', 'sc2'), 5, ConsistencyLevel.ONE)
+ _expect_missing(lambda: client.get_column('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), ConsistencyLevel.ONE))
+ actual = client.get_slice('Keyspace1', 'key1', ColumnParent('Super1', 'sc2'), '', '', True, 1000, ConsistencyLevel.ONE)
assert actual == [], actual
scs = [SuperColumn(name='sc1', columns=[Column(_i64(4), 'value4', 0)])]
- actual = client.get_slice_super('Table1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
+ actual = client.get_slice_super('Keyspace1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
assert actual == scs, actual
_verify_simple()
# Test resurrection. First, re-insert the value w/ older timestamp,
# and make sure it stays removed:
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 0, ConsistencyLevel.ONE)
- actual = client.get_slice_super('Table1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 0, ConsistencyLevel.ONE)
+ actual = client.get_slice_super('Keyspace1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
assert actual == scs, actual
# Next, w/ a newer timestamp; it should come back
- client.insert('Table1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 6, ConsistencyLevel.ONE)
- actual = client.get_slice_super('Table1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
+ client.insert('Keyspace1', 'key1', ColumnPath('Super1', 'sc2', _i64(5)), 'value5', 6, ConsistencyLevel.ONE)
+ actual = client.get_slice_super('Keyspace1', 'key1', 'Super1', '', '', True, 1000, ConsistencyLevel.ONE)
assert actual == \
[SuperColumn(name='sc1', columns=[Column(_i64(4), 'value4', 0)]),
SuperColumn(name='sc2', columns=[Column(_i64(5), 'value5', 6)])], actual
def test_empty_range(self):
- assert client.get_key_range('Table1', 'Standard1', '', '', 1000) == []
+ assert client.get_key_range('Keyspace1', 'Standard1', '', '', 1000) == []
_insert_simple()
- assert client.get_key_range('Table1', 'Super1', '', '', 1000) == []
+ assert client.get_key_range('Keyspace1', 'Super1', '', '', 1000) == []
def test_range_with_remove(self):
_insert_simple()
- assert client.get_key_range('Table1', 'Standard1', 'key1', '', 1000) == ['key1']
+ assert client.get_key_range('Keyspace1', 'Standard1', 'key1', '', 1000) == ['key1']
- client.remove('Table1', 'key1', ColumnPathOrParent('Standard1', column='c1'), 1, ConsistencyLevel.ONE)
- client.remove('Table1', 'key1', ColumnPathOrParent('Standard1', column='c2'), 1, ConsistencyLevel.ONE)
- actual = client.get_key_range('Table1', 'Standard1', '', '', 1000)
+ client.remove('Keyspace1', 'key1', ColumnPathOrParent('Standard1', column='c1'), 1, ConsistencyLevel.ONE)
+ client.remove('Keyspace1', 'key1', ColumnPathOrParent('Standard1', column='c2'), 1, ConsistencyLevel.ONE)
+ actual = client.get_key_range('Keyspace1', 'Standard1', '', '', 1000)
assert actual == [], actual
def test_range_with_remove_cf(self):
_insert_simple()
- assert client.get_key_range('Table1', 'Standard1', 'key1', '', 1000) == ['key1']
+ assert client.get_key_range('Keyspace1', 'Standard1', 'key1', '', 1000) == ['key1']
- client.remove('Table1', 'key1', ColumnPathOrParent('Standard1'), 1, ConsistencyLevel.ONE)
- actual = client.get_key_range('Table1', 'Standard1', '', '', 1000)
+ client.remove('Keyspace1', 'key1', ColumnPathOrParent('Standard1'), 1, ConsistencyLevel.ONE)
+ actual = client.get_key_range('Keyspace1', 'Standard1', '', '', 1000)
assert actual == [], actual
def test_range_collation(self):
for key in ['-a', '-b', 'a', 'b'] + [str(i) for i in xrange(100)]:
- client.insert('Table1', key, ColumnPath('Standard1', column=key), 'v', 0, ConsistencyLevel.ONE)
- L = client.get_key_range('Table1', 'Standard1', '', '', 1000)
+ client.insert('Keyspace1', key, ColumnPath('Standard1', column=key), 'v', 0, ConsistencyLevel.ONE)
+ L = client.get_key_range('Keyspace1', 'Standard1', '', '', 1000)
# note the collated ordering rather than ascii
assert L == ['0', '1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '23', '24', '25', '26', '27','28', '29', '3', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '4', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '5', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '6', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '7', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '8', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '9', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', 'a', '-a', 'b', '-b'], L
def test_range_partial(self):
for key in ['-a', '-b', 'a', 'b'] + [str(i) for i in xrange(100)]:
- client.insert('Table1', key, ColumnPath('Standard1', column=key), 'v', 0, ConsistencyLevel.ONE)
+ client.insert('Keyspace1', key, ColumnPath('Standard1', column=key), 'v', 0, ConsistencyLevel.ONE)
- L = client.get_key_range('Table1', 'Standard1', 'a', '', 1000)
+ L = client.get_key_range('Keyspace1', 'Standard1', 'a', '', 1000)
assert L == ['a', '-a', 'b', '-b'], L
- L = client.get_key_range('Table1', 'Standard1', '', '15', 1000)
+ L = client.get_key_range('Keyspace1', 'Standard1', '', '15', 1000)
assert L == ['0', '1', '10', '11', '12', '13', '14', '15'], L
- L = client.get_key_range('Table1', 'Standard1', '50', '51', 1000)
+ L = client.get_key_range('Keyspace1', 'Standard1', '50', '51', 1000)
assert L == ['50', '51'], L
- L = client.get_key_range('Table1', 'Standard1', '1', '', 10)
+ L = client.get_key_range('Keyspace1', 'Standard1', '1', '', 10)
assert L == ['1', '10', '11', '12', '13', '14', '15', '16', '17', '18'], L
def test_get_slice_range(self):
@@ -354,12 +354,12 @@
def test_get_slice_by_names(self):
_insert_range()
- result = client.get_slice_by_names('Table1','key1', ColumnParent('Standard1'), ['c1', 'c2'], ConsistencyLevel.ONE)
+ result = client.get_slice_by_names('Keyspace1', 'key1', ColumnParent('Standard1'), ['c1', 'c2'], ConsistencyLevel.ONE)
assert len(result) == 2
assert result[0].name == 'c1'
assert result[1].name == 'c2'
_insert_super()
- result = client.get_slice_by_names('Table1','key1', ColumnParent('Super1', 'sc1'), [_i64(4)], ConsistencyLevel.ONE)
+ result = client.get_slice_by_names('Keyspace1', 'key1', ColumnParent('Super1', 'sc1'), [_i64(4)], ConsistencyLevel.ONE)
assert len(result) == 1
assert result[0].name == _i64(4)
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java Thu Jul 30 00:29:28 2009
@@ -103,12 +103,12 @@
@Test
public void testGetColumnWithWrongBF() throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore store = table.getColumnFamilyStore("Standard1");
RowMutation rm;
// add data
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.add(new QueryPath("Standard1", null, "Column1".getBytes()), "asdf".getBytes(), 0);
rm.add(new QueryPath("Standard1", null, "Column2".getBytes()), "asdf".getBytes(), 0);
rm.apply();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyTest.java Thu Jul 30 00:29:28 2009
@@ -40,7 +40,7 @@
{
ColumnFamily cf;
- cf = ColumnFamily.create("Table1", "Standard1");
+ cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("C", "v", 1));
DataOutputBuffer bufOut = new DataOutputBuffer();
ColumnFamily.serializer().serialize(cf, bufOut);
@@ -65,7 +65,7 @@
}
// write
- cf = ColumnFamily.create("Table1", "Standard1");
+ cf = ColumnFamily.create("Keyspace1", "Standard1");
DataOutputBuffer bufOut = new DataOutputBuffer();
for (String cName : map.navigableKeySet())
{
@@ -87,7 +87,7 @@
@Test
public void testGetColumnCount()
{
- ColumnFamily cf = ColumnFamily.create("Table1", "Standard1");
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1", "", 1));
cf.addColumn(column("col2", "", 2));
@@ -100,7 +100,7 @@
@Test
public void testTimestamp()
{
- ColumnFamily cf = ColumnFamily.create("Table1", "Standard1");
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1", "val1", 2));
cf.addColumn(column("col1", "val2", 2)); // same timestamp, new value
@@ -112,9 +112,9 @@
@Test
public void testMergeAndAdd()
{
- ColumnFamily cf_new = ColumnFamily.create("Table1", "Standard1");
- ColumnFamily cf_old = ColumnFamily.create("Table1", "Standard1");
- ColumnFamily cf_result = ColumnFamily.create("Table1", "Standard1");
+ ColumnFamily cf_new = ColumnFamily.create("Keyspace1", "Standard1");
+ ColumnFamily cf_old = ColumnFamily.create("Keyspace1", "Standard1");
+ ColumnFamily cf_result = ColumnFamily.create("Keyspace1", "Standard1");
byte val[] = "sample value".getBytes();
byte val2[] = "x value ".getBytes();
@@ -136,7 +136,7 @@
@Test
public void testEmptyDigest()
{
- ColumnFamily cf = ColumnFamily.create("Table1", "Standard1");
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
assert cf.digest().length == 0;
}
}
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CommitLogTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CommitLogTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CommitLogTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CommitLogTest.java Thu Jul 30 00:29:28 2009
@@ -34,7 +34,7 @@
assert CommitLog.getSegmentCount() == 0;
CommitLog.setSegmentSize(1000);
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore store1 = table.getColumnFamilyStore("Standard1");
ColumnFamilyStore store2 = table.getColumnFamilyStore("Standard2");
RowMutation rm;
@@ -43,7 +43,7 @@
// add data. use relatively large values to force quick segment creation since we have a low flush threshold in the test config.
for (int i = 0; i < 10; i++)
{
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.add(new QueryPath("Standard1", null, "Column1".getBytes()), value, 0);
rm.add(new QueryPath("Standard2", null, "Column1".getBytes()), value, 0);
rm.apply();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsTest.java Thu Jul 30 00:29:28 2009
@@ -38,7 +38,7 @@
public void testCompactions() throws IOException, ExecutionException, InterruptedException
{
// this test does enough rows to force multiple block indexes to be used
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore store = table.getColumnFamilyStore("Standard1");
final int ROWS_PER_SSTABLE = 10;
@@ -46,7 +46,7 @@
for (int j = 0; j < (SSTableReader.indexInterval() * 3) / ROWS_PER_SSTABLE; j++) {
for (int i = 0; i < ROWS_PER_SSTABLE; i++) {
String key = String.valueOf(i % 2);
- RowMutation rm = new RowMutation("Table1", key);
+ RowMutation rm = new RowMutation("Keyspace1", key);
rm.add(new QueryPath("Standard1", null, String.valueOf(i / 2).getBytes()), new byte[0], j * ROWS_PER_SSTABLE + i);
rm.apply();
inserted.add(key);
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/MultitableTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/MultitableTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/MultitableTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/MultitableTest.java Thu Jul 30 00:29:28 2009
@@ -14,20 +14,20 @@
@Test
public void testSameCFs() throws IOException, ExecutionException, InterruptedException
{
- Table table1 = Table.open("Table1");
- Table table2 = Table.open("Table2");
+ Table table1 = Table.open("Keyspace1");
+ Table table2 = Table.open("Keyspace2");
RowMutation rm;
ColumnFamily cf;
- rm = new RowMutation("Table1", "keymulti");
- cf = ColumnFamily.create("Table1", "Standard1");
+ rm = new RowMutation("Keyspace1", "keymulti");
+ cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1", "val1", 1L));
rm.add(cf);
rm.apply();
- rm = new RowMutation("Table2", "keymulti");
- cf = ColumnFamily.create("Table2", "Standard1");
+ rm = new RowMutation("Keyspace2", "keymulti");
+ cf = ColumnFamily.create("Keyspace2", "Standard1");
cf.addColumn(column("col2", "val2", 1L));
rm.add(cf);
rm.apply();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/NameSortTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/NameSortTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/NameSortTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/NameSortTest.java Thu Jul 30 00:29:28 2009
@@ -58,7 +58,7 @@
private void testNameSort(int N) throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
for (int i = 0; i < N; ++i)
{
@@ -69,7 +69,7 @@
for (int j = 0; j < 8; ++j)
{
byte[] bytes = j % 2 == 0 ? "a".getBytes() : "b".getBytes();
- rm = new RowMutation("Table1", key);
+ rm = new RowMutation("Keyspace1", key);
rm.add(new QueryPath("Standard1", null, ("Column-" + j).getBytes()), bytes, j);
rm.apply();
}
@@ -77,7 +77,7 @@
// super
for (int j = 0; j < 8; ++j)
{
- rm = new RowMutation("Table1", key);
+ rm = new RowMutation("Keyspace1", key);
for (int k = 0; k < 4; ++k)
{
String value = (j + k) % 2 == 0 ? "a" : "b";
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/OneCompactionTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/OneCompactionTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/OneCompactionTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/OneCompactionTest.java Thu Jul 30 00:29:28 2009
@@ -34,13 +34,13 @@
{
private void testCompaction(String columnFamilyName, int insertsPerTable) throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore store = table.getColumnFamilyStore(columnFamilyName);
Set<String> inserted = new HashSet<String>();
for (int j = 0; j < insertsPerTable; j++) {
String key = "0";
- RowMutation rm = new RowMutation("Table1", key);
+ RowMutation rm = new RowMutation("Keyspace1", key);
rm.add(new QueryPath(columnFamilyName, null, "0".getBytes()), new byte[0], j);
rm.apply();
inserted.add(key);
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java Thu Jul 30 00:29:28 2009
@@ -44,15 +44,15 @@
ReadCommand rm, rm2;
- rm = new SliceByNamesReadCommand("Table1", "row1", new QueryPath("Standard1"), colList);
+ rm = new SliceByNamesReadCommand("Keyspace1", "row1", new QueryPath("Standard1"), colList);
rm2 = serializeAndDeserializeReadMessage(rm);
assert rm2.toString().equals(rm.toString());
- rm = new SliceFromReadCommand("Table1", "row1", new QueryPath("Standard1"), ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, true, 2);
+ rm = new SliceFromReadCommand("Keyspace1", "row1", new QueryPath("Standard1"), ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, true, 2);
rm2 = serializeAndDeserializeReadMessage(rm);
assert rm2.toString().equals(rm.toString());
- rm = new SliceFromReadCommand("Table1", "row1", new QueryPath("Standard1"), "a".getBytes(), "z".getBytes(), true, 5);
+ rm = new SliceFromReadCommand("Keyspace1", "row1", new QueryPath("Standard1"), "a".getBytes(), "z".getBytes(), true, 5);
rm2 = serializeAndDeserializeReadMessage(rm);
assertEquals(rm2.toString(), rm.toString());
}
@@ -71,15 +71,15 @@
@Test
public void testGetColumn() throws IOException, ColumnFamilyNotDefinedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
RowMutation rm;
// add data
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.add(new QueryPath("Standard1", null, "Column1".getBytes()), "abcd".getBytes(), 0);
rm.apply();
- ReadCommand command = new SliceByNamesReadCommand("Table1", "key1", new QueryPath("Standard1"), Arrays.asList("Column1".getBytes()));
+ ReadCommand command = new SliceByNamesReadCommand("Keyspace1", "key1", new QueryPath("Standard1"), Arrays.asList("Column1".getBytes()));
Row row = command.getRow(table);
ColumnFamily cf = row.getColumnFamily("Standard1");
IColumn col = cf.getColumn("Column1".getBytes());
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RecoveryManager2Test.java Thu Jul 30 00:29:28 2009
@@ -16,14 +16,14 @@
@Test
public void testWithFlush() throws IOException, ExecutionException, InterruptedException
{
- Table table1 = Table.open("Table1");
+ Table table1 = Table.open("Keyspace1");
Set<String> keys = new HashSet<String>();
for (int i = 0; i < 100; i++)
{
String key = "key" + i;
- RowMutation rm = new RowMutation("Table1", key);
- ColumnFamily cf = ColumnFamily.create("Table1", "Standard1");
+ RowMutation rm = new RowMutation("Keyspace1", key);
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1", "val1", 1L));
rm.add(cf);
rm.apply();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RecoveryManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RecoveryManagerTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RecoveryManagerTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RecoveryManagerTest.java Thu Jul 30 00:29:28 2009
@@ -42,20 +42,20 @@
@Test
public void testOne() throws IOException, ExecutionException, InterruptedException
{
- Table table1 = Table.open("Table1");
- Table table2 = Table.open("Table2");
+ Table table1 = Table.open("Keyspace1");
+ Table table2 = Table.open("Keyspace2");
RowMutation rm;
ColumnFamily cf;
- rm = new RowMutation("Table1", "keymulti");
- cf = ColumnFamily.create("Table1", "Standard1");
+ rm = new RowMutation("Keyspace1", "keymulti");
+ cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1", "val1", 1L));
rm.add(cf);
rm.apply();
- rm = new RowMutation("Table2", "keymulti");
- cf = ColumnFamily.create("Table2", "Standard3");
+ rm = new RowMutation("Keyspace2", "keymulti");
+ cf = ColumnFamily.create("Keyspace2", "Standard3");
cf.addColumn(column("col2", "val2", 1L));
rm.add(cf);
rm.apply();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyTest.java Thu Jul 30 00:29:28 2009
@@ -32,17 +32,17 @@
@Test
public void testRemoveColumnFamily() throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore store = table.getColumnFamilyStore("Standard1");
RowMutation rm;
// add data
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.add(new QueryPath("Standard1", null, "Column1".getBytes()), "asdf".getBytes(), 0);
rm.apply();
// remove
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.delete(new QueryPath("Standard1"), 1);
rm.apply();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyWithFlush1Test.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyWithFlush1Test.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyWithFlush1Test.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyWithFlush1Test.java Thu Jul 30 00:29:28 2009
@@ -32,19 +32,19 @@
@Test
public void testRemoveColumnFamilyWithFlush1() throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore store = table.getColumnFamilyStore("Standard1");
RowMutation rm;
// add data
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.add(new QueryPath("Standard1", null, "Column1".getBytes()), "asdf".getBytes(), 0);
rm.add(new QueryPath("Standard1", null, "Column2".getBytes()), "asdf".getBytes(), 0);
rm.apply();
store.forceBlockingFlush();
// remove
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.delete(new QueryPath("Standard1"), 1);
rm.apply();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyWithFlush2Test.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyWithFlush2Test.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyWithFlush2Test.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyWithFlush2Test.java Thu Jul 30 00:29:28 2009
@@ -32,16 +32,16 @@
@Test
public void testRemoveColumnFamilyWithFlush2() throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore store = table.getColumnFamilyStore("Standard1");
RowMutation rm;
// add data
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.add(new QueryPath("Standard1", null, "Column1".getBytes()), "asdf".getBytes(), 0);
rm.apply();
// remove
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.delete(new QueryPath("Standard1"), 1);
rm.apply();
store.forceBlockingFlush();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnTest.java Thu Jul 30 00:29:28 2009
@@ -33,18 +33,18 @@
@Test
public void testRemoveColumn() throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore store = table.getColumnFamilyStore("Standard1");
RowMutation rm;
// add data
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.add(new QueryPath("Standard1", null, "Column1".getBytes()), "asdf".getBytes(), 0);
rm.apply();
store.forceBlockingFlush();
// remove
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.delete(new QueryPath("Standard1", null, "Column1".getBytes()), 1);
rm.apply();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveSubColumnTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveSubColumnTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveSubColumnTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveSubColumnTest.java Thu Jul 30 00:29:28 2009
@@ -34,18 +34,18 @@
@Test
public void testRemoveSubColumn() throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore store = table.getColumnFamilyStore("Super1");
RowMutation rm;
// add data
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
addMutation(rm, "Super1", "SC1", 1, "asdf", 0);
rm.apply();
store.forceBlockingFlush();
// remove
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.delete(new QueryPath("Super1", "SC1".getBytes(), getBytes(1)), 1);
rm.apply();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveSuperColumnTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveSuperColumnTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveSuperColumnTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveSuperColumnTest.java Thu Jul 30 00:29:28 2009
@@ -38,17 +38,17 @@
@Test
public void testRemoveSuperColumn() throws IOException, ExecutionException, InterruptedException
{
- ColumnFamilyStore store = Table.open("Table1").getColumnFamilyStore("Super1");
+ ColumnFamilyStore store = Table.open("Keyspace1").getColumnFamilyStore("Super1");
RowMutation rm;
// add data
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
addMutation(rm, "Super1", "SC1", 1, "val1", 0);
rm.apply();
store.forceBlockingFlush();
// remove
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.delete(new QueryPath("Super1", "SC1".getBytes()), 1);
rm.apply();
@@ -65,7 +65,7 @@
private void validateRemoveTwoSources() throws IOException
{
- ColumnFamilyStore store = Table.open("Table1").getColumnFamilyStore("Super1");
+ ColumnFamilyStore store = Table.open("Keyspace1").getColumnFamilyStore("Super1");
ColumnFamily resolved = store.getColumnFamily(new NamesQueryFilter("key1", new QueryPath("Super1"), "SC1".getBytes()));
assert resolved.getSortedColumns().iterator().next().getMarkedForDeleteAt() == 1;
assert resolved.getSortedColumns().iterator().next().getSubColumns().size() == 0;
@@ -75,7 +75,7 @@
private void validateRemoveCompacted() throws IOException
{
- ColumnFamilyStore store = Table.open("Table1").getColumnFamilyStore("Super1");
+ ColumnFamilyStore store = Table.open("Keyspace1").getColumnFamilyStore("Super1");
ColumnFamily resolved = store.getColumnFamily(new NamesQueryFilter("key1", new QueryPath("Super1"), "SC1".getBytes()));
assert resolved.getSortedColumns().iterator().next().getMarkedForDeleteAt() == 1;
Collection<IColumn> subColumns = resolved.getSortedColumns().iterator().next().getSubColumns();
@@ -85,22 +85,22 @@
@Test
public void testRemoveSuperColumnWithNewData() throws IOException, ExecutionException, InterruptedException
{
- ColumnFamilyStore store = Table.open("Table1").getColumnFamilyStore("Super2");
+ ColumnFamilyStore store = Table.open("Keyspace1").getColumnFamilyStore("Super2");
RowMutation rm;
// add data
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
addMutation(rm, "Super2", "SC1", 1, "val1", 0);
rm.apply();
store.forceBlockingFlush();
// remove
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
rm.delete(new QueryPath("Super2", "SC1".getBytes()), 1);
rm.apply();
// new data
- rm = new RowMutation("Table1", "key1");
+ rm = new RowMutation("Keyspace1", "key1");
addMutation(rm, "Super2", "SC1", 2, "val2", 2);
rm.apply();
@@ -117,7 +117,7 @@
private void validateRemoveWithNewData() throws IOException
{
- ColumnFamilyStore store = Table.open("Table1").getColumnFamilyStore("Super2");
+ ColumnFamilyStore store = Table.open("Keyspace1").getColumnFamilyStore("Super2");
ColumnFamily resolved = store.getColumnFamily(new NamesQueryFilter("key1", new QueryPath("Super2", "SC1".getBytes()), getBytes(2)));
Collection<IColumn> subColumns = resolved.getSortedColumns().iterator().next().getSubColumns();
assert subColumns.size() == 1;
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RowTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RowTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RowTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RowTest.java Thu Jul 30 00:29:28 2009
@@ -32,10 +32,10 @@
@Test
public void testDiffColumnFamily()
{
- ColumnFamily cf1 = ColumnFamily.create("Table1", "Standard1");
+ ColumnFamily cf1 = ColumnFamily.create("Keyspace1", "Standard1");
cf1.addColumn(column("one", "onev", 0));
- ColumnFamily cf2 = ColumnFamily.create("Table1", "Standard1");
+ ColumnFamily cf2 = ColumnFamily.create("Keyspace1", "Standard1");
cf2.delete(0, 0);
ColumnFamily cfDiff = cf1.diff(cf2);
@@ -61,15 +61,15 @@
public void testRepair()
{
Row row1 = new Row();
- ColumnFamily cf1 = ColumnFamily.create("Table1", "Standard1");
+ ColumnFamily cf1 = ColumnFamily.create("Keyspace1", "Standard1");
cf1.addColumn(column("one", "A", 0));
row1.addColumnFamily(cf1);
Row row2 = new Row();
- ColumnFamily cf2 = ColumnFamily.create("Table1", "Standard1");
+ ColumnFamily cf2 = ColumnFamily.create("Keyspace1", "Standard1");
cf2.addColumn(column("one", "B", 1));
cf2.addColumn(column("two", "C", 1));
- ColumnFamily cf3 = ColumnFamily.create("Table2", "Standard3");
+ ColumnFamily cf3 = ColumnFamily.create("Keyspace2", "Standard3");
cf3.addColumn(column("three", "D", 1));
row2.addColumnFamily(cf2);
row2.addColumnFamily(cf3);
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.java Thu Jul 30 00:29:28 2009
@@ -62,7 +62,7 @@
@Test
public void testGetRowSingleColumn() throws Throwable
{
- final Table table = Table.open("Table1");
+ final Table table = Table.open("Keyspace1");
final ColumnFamilyStore cfStore = table.getColumnFamilyStore("Standard1");
Runner setup = new Runner()
@@ -93,10 +93,10 @@
public void testGetRowSliceByRange() throws Throwable
{
String key = TEST_KEY+"slicerow";
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore cfStore = table.getColumnFamilyStore("Standard1");
- RowMutation rm = new RowMutation("Table1", key);
- ColumnFamily cf = ColumnFamily.create("Table1", "Standard1");
+ RowMutation rm = new RowMutation("Keyspace1", key);
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
// First write "a", "b", "c"
cf.addColumn(column("a", "val1", 1L));
cf.addColumn(column("b", "val2", 1L));
@@ -119,8 +119,8 @@
private RowMutation makeSimpleRowMutation()
{
- RowMutation rm = new RowMutation("Table1",TEST_KEY);
- ColumnFamily cf = ColumnFamily.create("Table1", "Standard1");
+ RowMutation rm = new RowMutation("Keyspace1",TEST_KEY);
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1","val1", 1L));
cf.addColumn(column("col2","val2", 1L));
cf.addColumn(column("col3","val3", 1L));
@@ -131,9 +131,9 @@
@Test
public void testGetSliceNoMatch() throws Throwable
{
- Table table = Table.open("Table1");
- RowMutation rm = new RowMutation("Table1", "row1000");
- ColumnFamily cf = ColumnFamily.create("Table1", "Standard2");
+ Table table = Table.open("Keyspace1");
+ RowMutation rm = new RowMutation("Keyspace1", "row1000");
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard2");
cf.addColumn(column("col1", "val1", 1));
rm.add(cf);
rm.apply();
@@ -166,15 +166,15 @@
public void testGetSliceFromBasic() throws Throwable
{
// tests slicing against data from one row in a memtable and then flushed to an sstable
- final Table table = Table.open("Table1");
+ final Table table = Table.open("Keyspace1");
final ColumnFamilyStore cfStore = table.getColumnFamilyStore("Standard1");
final String ROW = "row1";
Runner setup = new Runner()
{
public void run() throws Exception
{
- RowMutation rm = new RowMutation("Table1", ROW);
- ColumnFamily cf = ColumnFamily.create("Table1", "Standard1");
+ RowMutation rm = new RowMutation("Keyspace1", ROW);
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1", "val1", 1L));
cf.addColumn(column("col3", "val3", 1L));
cf.addColumn(column("col4", "val4", 1L));
@@ -184,7 +184,7 @@
rm.add(cf);
rm.apply();
- rm = new RowMutation("Table1", ROW);
+ rm = new RowMutation("Keyspace1", ROW);
rm.delete(new QueryPath("Standard1", null, "col4".getBytes()), 2L);
rm.apply();
}
@@ -225,15 +225,15 @@
public void testGetSliceFromAdvanced() throws Throwable
{
// tests slicing against data from one row spread across two sstables
- final Table table = Table.open("Table1");
+ final Table table = Table.open("Keyspace1");
final ColumnFamilyStore cfStore = table.getColumnFamilyStore("Standard1");
final String ROW = "row2";
Runner setup = new Runner()
{
public void run() throws Exception
{
- RowMutation rm = new RowMutation("Table1", ROW);
- ColumnFamily cf = ColumnFamily.create("Table1", "Standard1");
+ RowMutation rm = new RowMutation("Keyspace1", ROW);
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1", "val1", 1L));
cf.addColumn(column("col2", "val2", 1L));
cf.addColumn(column("col3", "val3", 1L));
@@ -244,8 +244,8 @@
rm.apply();
cfStore.forceBlockingFlush();
- rm = new RowMutation("Table1", ROW);
- cf = ColumnFamily.create("Table1", "Standard1");
+ rm = new RowMutation("Keyspace1", ROW);
+ cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1", "valx", 2L));
cf.addColumn(column("col2", "valx", 2L));
cf.addColumn(column("col3", "valx", 2L));
@@ -275,11 +275,11 @@
public void testGetSliceFromLarge() throws Throwable
{
// tests slicing against 1000 columns in an sstable
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore cfStore = table.getColumnFamilyStore("Standard1");
String ROW = "row3";
- RowMutation rm = new RowMutation("Table1", ROW);
- ColumnFamily cf = ColumnFamily.create("Table1", "Standard1");
+ RowMutation rm = new RowMutation("Keyspace1", ROW);
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
for (int i = 1000; i < 2000; i++)
cf.addColumn(column("col" + i, ("vvvvvvvvvvvvvvvv" + i), 1L));
rm.add(cf);
@@ -315,15 +315,15 @@
public void testGetSliceFromSuperBasic() throws Throwable
{
// tests slicing against data from one row spread across two sstables
- final Table table = Table.open("Table1");
+ final Table table = Table.open("Keyspace1");
final ColumnFamilyStore cfStore = table.getColumnFamilyStore("Super1");
final String ROW = "row2";
Runner setup = new Runner()
{
public void run() throws Exception
{
- RowMutation rm = new RowMutation("Table1", ROW);
- ColumnFamily cf = ColumnFamily.create("Table1", "Super1");
+ RowMutation rm = new RowMutation("Keyspace1", ROW);
+ ColumnFamily cf = ColumnFamily.create("Keyspace1", "Super1");
SuperColumn sc = new SuperColumn("sc1".getBytes(), new LongType());
sc.addColumn(new Column(getBytes(1), "val1".getBytes(), 1L));
cf.addColumn(sc);
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/TimeSortTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/TimeSortTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/TimeSortTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/TimeSortTest.java Thu Jul 30 00:29:28 2009
@@ -37,16 +37,16 @@
@Test
public void testMixedSources() throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore cfStore = table.getColumnFamilyStore("StandardLong1");
RowMutation rm;
- rm = new RowMutation("Table1", "key0");
+ rm = new RowMutation("Keyspace1", "key0");
rm.add(new QueryPath("StandardLong1", null, getBytes(100)), "a".getBytes(), 100);
rm.apply();
cfStore.forceBlockingFlush();
- rm = new RowMutation("Table1", "key0");
+ rm = new RowMutation("Keyspace1", "key0");
rm.add(new QueryPath("StandardLong1", null, getBytes(0)), "b".getBytes(), 0);
rm.apply();
@@ -58,12 +58,12 @@
@Test
public void testTimeSort() throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Table1");
+ Table table = Table.open("Keyspace1");
ColumnFamilyStore cfStore = table.getColumnFamilyStore("StandardLong1");
for (int i = 900; i < 1000; ++i)
{
- RowMutation rm = new RowMutation("Table1", Integer.toString(i));
+ RowMutation rm = new RowMutation("Keyspace1", Integer.toString(i));
for (int j = 0; j < 8; ++j)
{
rm.add(new QueryPath("StandardLong1", null, getBytes(j * 2)), "a".getBytes(), j * 2);
@@ -78,14 +78,14 @@
// interleave some new data to test memtable + sstable
String key = "900";
- RowMutation rm = new RowMutation("Table1", key);
+ RowMutation rm = new RowMutation("Keyspace1", key);
for (int j = 0; j < 4; ++j)
{
rm.add(new QueryPath("StandardLong1", null, getBytes(j * 2 + 1)), "b".getBytes(), j * 2 + 1);
}
rm.apply();
// and some overwrites
- rm = new RowMutation("Table1", key);
+ rm = new RowMutation("Keyspace1", key);
rm.add(new QueryPath("StandardLong1", null, getBytes(0)), "c".getBytes(), 100);
rm.add(new QueryPath("StandardLong1", null, getBytes(10)), "c".getBytes(), 100);
rm.apply();
Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/service/CassandraServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/service/CassandraServerTest.java?rev=799140&r1=799139&r2=799140&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/service/CassandraServerTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/service/CassandraServerTest.java Thu Jul 30 00:29:28 2009
@@ -40,17 +40,17 @@
cfmap.put("Standard1", columns);
cfmap.put("Standard2", columns);
- BatchMutation m = new BatchMutation("Table1", "key1", cfmap);
+ BatchMutation m = new BatchMutation("Keyspace1", "key1", cfmap);
server.batch_insert(m, 1);
Column column;
- column = server.get_column("Table1", "key1", "Standard1:c2");
+ column = server.get_column("Keyspace1", "key1", "Standard1:c2");
assert column.value.equals("0");
- column = server.get_column("Table1", "key1", "Standard2:c2");
+ column = server.get_column("Keyspace1", "key1", "Standard2:c2");
assert column.value.equals("0");
- ArrayList<Column> Columns = server.get_slice_strong("Table1", "key1", "Standard1", -1, -1);
+ ArrayList<Column> Columns = server.get_slice_strong("Keyspace1", "key1", "Standard1", -1, -1);
assert Columns.size() == 2;
} finally {
server.shutdown();