本文整理汇总了C#中ISession.ChangeKeyspace方法的典型用法代码示例。如果您正苦于以下问题:C# ISession.ChangeKeyspace方法的具体用法?C# ISession.ChangeKeyspace怎么用?C# ISession.ChangeKeyspace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISession
的用法示例。
在下文中一共展示了ISession.ChangeKeyspace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
// Create necessary tables
MappingConfiguration config1 = new MappingConfiguration();
config1.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof(EntityWithTimeUuid),
() => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof(EntityWithTimeUuid)));
_tableEntityWithTimeUuid = new Table<EntityWithTimeUuid>(_session, config1);
_tableEntityWithTimeUuid.Create();
MappingConfiguration config2 = new MappingConfiguration();
config2.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof(EntityWithNullableTimeUuid),
() => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof(EntityWithNullableTimeUuid)));
_tableEntityWithNullableTimeUuid = new Table<EntityWithNullableTimeUuid>(_session, config2);
_tableEntityWithNullableTimeUuid.Create();
_expectedTimeUuidObjectList = EntityWithTimeUuid.GetDefaultObjectList();
_expectedNullableTimeUuidObjectList = EntityWithNullableTimeUuid.GetDefaultObjectList();
_dateBefore = DateTimeOffset.Parse("2014-2-1");
_dateAfter = DateTimeOffset.Parse("2014-4-1");
}
示例2: SetupTest
public void SetupTest()
{
_session = TestClusterManager.GetTestCluster(1).Session;
_uniqueKsName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
}
示例3: SetupTest
public void SetupTest()
{
_session = Session;
_uniqueKsName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
}
示例4: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
// Create necessary tables
MappingConfiguration config1 = new MappingConfiguration();
config1.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof (EntityWithTimeUuid),
() => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof (EntityWithTimeUuid)));
_tableEntityWithTimeUuid = new Table<EntityWithTimeUuid>(_session, config1);
_tableEntityWithTimeUuid.Create();
MappingConfiguration config2 = new MappingConfiguration();
config2.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof (EntityWithNullableTimeUuid),
() => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof (EntityWithNullableTimeUuid)));
_tableEntityWithNullableTimeUuid = new Table<EntityWithNullableTimeUuid>(_session, config2);
_tableEntityWithNullableTimeUuid.Create();
_expectedTimeUuidObjectList = EntityWithTimeUuid.GetDefaultObjectList();
for (int i=0; i<_expectedTimeUuidObjectList.Count; i++)
{
_expectedTimeUuidObjectList[i].StringType = i.ToString();
}
}
示例5: SetupTest
public void SetupTest()
{
_session = TestClusterManager.GetTestCluster(1).Session;
_uniqueKsName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_uniqueKsName);
TestUtils.WaitForSchemaAgreement(_session.Cluster);
_session.ChangeKeyspace(_uniqueKsName);
}
示例6: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_uniqueKsName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
}
示例7: TestFixtureSetUp
public void TestFixtureSetUp()
{
var testCluster = TestClusterManager.GetTestCluster(1);
_cluster = Cluster.Builder().AddContactPoint(testCluster.InitialContactPoint).Build();
_session = _cluster.Connect();
_uniqueKsName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
}
示例8: SetupTest
public void SetupTest()
{
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
_entityList = AllDataTypesEntity.SetupDefaultTable(_session);
}
示例9: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
_movieTable = new Table<Movie>(_session, new MappingConfiguration());
_movieTable.Create();
}
示例10: SetupTest
public void SetupTest()
{
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
_entityList = AllDataTypesEntity.SetupDefaultTable(_session);
_table = new Table<AllDataTypesEntity>(_session, new MappingConfiguration());
}
示例11: CreateMultiDcSchema
public void CreateMultiDcSchema(ISession session, int dc1RF = 1, int dc2RF = 1)
{
session.Execute(String.Format(TestUtils.CreateKeyspaceGenericFormat, DefaultKeyspace, "NetworkTopologyStrategy",
string.Format("'dc1' : {0}, 'dc2' : {1}", dc1RF, dc2RF)));
TestUtils.WaitForSchemaAgreement(session.Cluster);
session.ChangeKeyspace(DefaultKeyspace);
TestUtils.WaitForSchemaAgreement(session.Cluster);
session.Execute(String.Format("CREATE TABLE {0} (k int PRIMARY KEY, i int)", TableName));
TestUtils.WaitForSchemaAgreement(session.Cluster);
}
示例12: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
_entityList = AllDataTypesEntity.SetupDefaultTable(_session);
_table = new Table<AllDataTypesEntity>(_session, new MappingConfiguration());
}
示例13: TestFixtureSetUp
public void TestFixtureSetUp()
{
var testCluster = TestClusterManager.GetTestCluster(1, DefaultMaxClusterCreateRetries, true, false);
_cluster = Cluster.Builder().AddContactPoint(testCluster.InitialContactPoint).Build();
_session = _cluster.Connect();
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
_movieTable = new Table<Movie>(_session, new MappingConfiguration());
_movieTable.Create();
}
示例14: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
if (CassandraVersion < Version.Parse("2.1.0"))
Assert.Ignore("Requires Cassandra version >= 2.1");
base.TestFixtureSetUp();
_session = Session;
_session.Execute(String.Format(TestUtils.CreateKeyspaceSimpleFormat, _uniqueKeyspaceName, 1));
_session.ChangeKeyspace(_uniqueKeyspaceName);
_session.Execute("CREATE TYPE song (id uuid, title text, artist text)");
_session.UserDefinedTypes.Define(UdtMap.For<Song>());
}
示例15: CreateSchema
public void CreateSchema(ISession session, int replicationFactor)
{
try
{
session.Execute(String.Format(TestUtils.CreateKeyspaceSimpleFormat, DefaultKeyspace, replicationFactor));
}
catch (AlreadyExistsException)
{
}
TestUtils.WaitForSchemaAgreement(session.Cluster);
session.ChangeKeyspace(DefaultKeyspace);
session.Execute(String.Format("CREATE TABLE {0} (k int PRIMARY KEY, i int)", TableName));
TestUtils.WaitForSchemaAgreement(session.Cluster);
}