当前位置: 首页>>代码示例>>Java>>正文


Java SchemaLoader.createKeyspace方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:19,代码来源:HintsWriteThenReadTest.java

示例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));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:19,代码来源:TTLExpiryTest.java

示例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));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:SSTableMetadataTest.java

示例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));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:23,代码来源:CompactionsPurgeTest.java

示例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));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:13,代码来源:RecoveryManagerTest.java

示例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)));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:12,代码来源:LongLeveledCompactionStrategyTest.java

示例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));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:14,代码来源:BatchlogManagerTest.java

示例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));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:9,代码来源:CFMetaDataTest.java

示例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);

}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:RowAndDeletionMergeIteratorTest.java

示例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);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:10,代码来源:AntiCompactionTest.java

示例11: defineSchema

import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws Exception
{
    SchemaLoader.prepareServer();
    SchemaLoader.createKeyspace(KEYSPACE,
                                KeyspaceParams.simple(5));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:ReplicationStrategyEndpointCacheTest.java

示例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));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:10,代码来源:DynamicCompositeTypeTest.java

示例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);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:10,代码来源:BigTableWriterTest.java

示例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));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:10,代码来源:CounterMutationTest.java

示例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"))));
    }
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:10,代码来源:LeveledCompactionStrategyTest.java


注:本文中的org.apache.cassandra.SchemaLoader.createKeyspace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。