本文整理汇总了Java中org.apache.cassandra.SchemaLoader.createKeyspace方法的典型用法代码示例。如果您正苦于以下问题:Java SchemaLoader.createKeyspace方法的具体用法?Java SchemaLoader.createKeyspace怎么用?Java SchemaLoader.createKeyspace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.SchemaLoader
的用法示例。
在下文中一共展示了SchemaLoader.createKeyspace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWriteReadCycle
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@Test
public void testWriteReadCycle() throws IOException
{
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE, KeyspaceParams.simple(1), SchemaLoader.standardCFMD(KEYSPACE, TABLE));
HintsDescriptor descriptor = new HintsDescriptor(UUID.randomUUID(), System.currentTimeMillis());
File directory = Files.createTempDirectory(null).toFile();
try
{
testWriteReadCycle(directory, descriptor);
}
finally
{
directory.deleteOnExit();
}
}
示例2: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
CFMetaData.Builder.create(KEYSPACE1, CF_STANDARD1)
.addPartitionKey("pKey", AsciiType.instance)
.addRegularColumn("col1", AsciiType.instance)
.addRegularColumn("col", AsciiType.instance)
.addRegularColumn("col311", AsciiType.instance)
.addRegularColumn("col2", AsciiType.instance)
.addRegularColumn("col3", AsciiType.instance)
.addRegularColumn("col7", AsciiType.instance)
.addRegularColumn("col8", MapType.getInstance(AsciiType.instance, AsciiType.instance, true))
.addRegularColumn("shadow", AsciiType.instance)
.build().gcGraceSeconds(0));
}
示例3: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws Exception
{
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD2),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD3),
CFMetaData.Builder.create(KEYSPACE1, CF_STANDARDCOMPOSITE2)
.addPartitionKey("key", AsciiType.instance)
.addClusteringColumn("name", AsciiType.instance)
.addClusteringColumn("int", IntegerType.instance)
.addRegularColumn("val", AsciiType.instance).build(),
SchemaLoader.counterCFMD(KEYSPACE1, CF_COUNTER1));
}
示例4: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD1),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD2));
SchemaLoader.createKeyspace(KEYSPACE2,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE2, CF_STANDARD1));
SchemaLoader.createKeyspace(KEYSPACE_CACHED,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE_CACHED, CF_CACHED).caching(CachingParams.CACHE_EVERYTHING));
SchemaLoader.createKeyspace(KEYSPACE_CQL,
KeyspaceParams.simple(1),
CFMetaData.compile("CREATE TABLE " + CF_CQL + " ("
+ "k int PRIMARY KEY,"
+ "v1 text,"
+ "v2 int"
+ ")", KEYSPACE_CQL));
}
示例5: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD1),
SchemaLoader.counterCFMD(KEYSPACE1, CF_COUNTER1));
SchemaLoader.createKeyspace(KEYSPACE2,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE2, CF_STANDARD3));
}
示例6: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
Map<String, String> leveledOptions = new HashMap<>();
leveledOptions.put("sstable_size_in_mb", "1");
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARDLVL)
.compaction(CompactionParams.lcs(leveledOptions)));
}
示例7: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
sw = Util.switchPartitioner(Murmur3Partitioner.instance);
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD1, 1, BytesType.instance),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD2, 1, BytesType.instance),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD3, 1, BytesType.instance),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD4, 1, BytesType.instance),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD5, 1, BytesType.instance));
}
示例8: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD1));
}
示例9: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
CFMetaData cfMetadata = CFMetaData.Builder.create(KEYSPACE1, CF_STANDARD1)
.addPartitionKey("key", AsciiType.instance)
.addClusteringColumn("col1", Int32Type.instance)
.addRegularColumn("a", Int32Type.instance)
.build();
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
cfMetadata);
}
示例10: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
SchemaLoader.prepareServer();
cfm = SchemaLoader.standardCFMD(KEYSPACE1, CF);
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
cfm);
}
示例11: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws Exception
{
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE,
KeyspaceParams.simple(5));
}
示例12: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
AbstractType<?> dynamicComposite = DynamicCompositeType.getInstance(aliases);
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
SchemaLoader.denseCFMD(KEYSPACE1, CF_STANDARDDYNCOMPOSITE, dynamicComposite));
}
示例13: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws Exception
{
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD, 0, Int32Type.instance, AsciiType.instance, Int32Type.instance));
cfs = Keyspace.open(KEYSPACE1).getColumnFamilyStore(CF_STANDARD);
}
示例14: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
SchemaLoader.counterCFMD(KEYSPACE1, CF1),
SchemaLoader.counterCFMD(KEYSPACE1, CF2));
}
示例15: defineSchema
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
SchemaLoader.prepareServer();
SchemaLoader.createKeyspace(KEYSPACE1,
KeyspaceParams.simple(1),
SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARDDLEVELED)
.compaction(CompactionParams.lcs(Collections.singletonMap("sstable_size_in_mb", "1"))));
}