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


Java SchemaLoader.prepareServer方法代码示例

本文整理汇总了Java中org.apache.cassandra.SchemaLoader.prepareServer方法的典型用法代码示例。如果您正苦于以下问题:Java SchemaLoader.prepareServer方法的具体用法?Java SchemaLoader.prepareServer怎么用?Java SchemaLoader.prepareServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.SchemaLoader的用法示例。


在下文中一共展示了SchemaLoader.prepareServer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: defineSchema

import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
    new Random().nextBytes(entropy);
    DatabaseDescriptor.setCommitLogCompression(new ParameterizedClass("LZ4Compressor", ImmutableMap.of()));
    DatabaseDescriptor.setCommitLogSegmentSize(1);
    DatabaseDescriptor.setCommitLogSync(CommitLogSync.periodic);
    DatabaseDescriptor.setCommitLogSyncPeriod(10 * 1000);
    SchemaLoader.prepareServer();
    SchemaLoader.createKeyspace(KEYSPACE1,
                                KeyspaceParams.simple(1),
                                SchemaLoader.standardCFMD(KEYSPACE1, STANDARD1, 0, AsciiType.instance, BytesType.instance),
                                SchemaLoader.standardCFMD(KEYSPACE1, STANDARD2, 0, AsciiType.instance, BytesType.instance));

    CompactionManager.instance.disableAutoCompaction();
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:CommitLogSegmentManagerTest.java

示例3: 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

示例4: defineSchema

import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
    if (FBUtilities.isWindows())
    {
        standardMode = DatabaseDescriptor.getDiskAccessMode();
        indexMode = DatabaseDescriptor.getIndexAccessMode();

        DatabaseDescriptor.setDiskAccessMode(Config.DiskAccessMode.standard);
        DatabaseDescriptor.setIndexAccessMode(Config.DiskAccessMode.standard);
    }

    SchemaLoader.prepareServer();
    SchemaLoader.createKeyspace(KEYSPACE,
                                KeyspaceParams.simple(1),
                                SchemaLoader.standardCFMD(KEYSPACE, CF),
                                SchemaLoader.standardCFMD(KEYSPACE, CF_SMALL_MAX_VALUE));

    maxValueSize = DatabaseDescriptor.getMaxValueSize();
    DatabaseDescriptor.setMaxValueSize(1024 * 1024); // set max value size to 1MB
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:22,代码来源:SSTableWriterTestBase.java

示例5: defineSchema

import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
    SchemaLoader.prepareServer();

    cfm = CFMetaData.Builder.create(KEYSPACE1, CF_STANDARD1)
                                    .addPartitionKey("pKey", AsciiType.instance)
                                    .addRegularColumn("col1", AsciiType.instance)
                                    .build();
    SchemaLoader.createKeyspace(KEYSPACE1,
                                KeyspaceParams.simple(1),
                                cfm);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:14,代码来源:CacheProviderTest.java

示例6: 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

示例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),
                                CFMetaData.Builder.create(KEYSPACE1, CF_STANDARD1)
                                                  .addPartitionKey("pKey", AsciiType.instance)
                                                  .addRegularColumn("col1", AsciiType.instance)
                                                  .build());
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:12,代码来源:AutoSavingCacheTest.java

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

示例10: defineSchema

import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
    CFMetaData cfMetadata = CFMetaData.Builder.create(KEYSPACE1, CF_STANDARD1)
                                              .addPartitionKey("key", BytesType.instance)
                                              .addClusteringColumn("col1", AsciiType.instance)
                                              .addRegularColumn("a", AsciiType.instance)
                                              .addRegularColumn("b", AsciiType.instance)
                                              .build();
    SchemaLoader.prepareServer();
    SchemaLoader.createKeyspace(KEYSPACE1,
                                KeyspaceParams.simple(1),
                                cfMetadata);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:RowTest.java

示例11: defineSchema

import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws ConfigurationException
{
    CFMetaData cfForReadMetadata = CFMetaData.Builder.create(KEYSPACE1, CF_FOR_READ_TEST)
                                                        .addPartitionKey("key", BytesType.instance)
                                                        .addClusteringColumn("col1", AsciiType.instance)
                                                        .addClusteringColumn("col2", AsciiType.instance)
                                                        .addRegularColumn("a", AsciiType.instance)
                                                        .addRegularColumn("b", AsciiType.instance).build();

    CFMetaData cfForCommitMetadata1 = CFMetaData.Builder.create(KEYSPACE1, CF_FOR_COMMIT_TEST)
                                                   .addPartitionKey("key", BytesType.instance)
                                                   .addClusteringColumn("name", AsciiType.instance)
                                                   .addRegularColumn("commit1", AsciiType.instance).build();

    CFMetaData cfForCommitMetadata2 = CFMetaData.Builder.create(KEYSPACENOCOMMIT, CF_FOR_COMMIT_TEST)
                                                        .addPartitionKey("key", BytesType.instance)
                                                        .addClusteringColumn("name", AsciiType.instance)
                                                        .addRegularColumn("commit2", AsciiType.instance).build();

    SchemaLoader.prepareServer();
    SchemaLoader.createKeyspace(KEYSPACE1,
                                KeyspaceParams.simple(1),
                                SchemaLoader.standardCFMD(KEYSPACE1, CF),
                                cfForReadMetadata,
                                cfForCommitMetadata1);
    SchemaLoader.createKeyspace(KEYSPACENOCOMMIT,
                                KeyspaceParams.simpleTransient(1),
                                SchemaLoader.standardCFMD(KEYSPACENOCOMMIT, CF),
                                cfForCommitMetadata2);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:32,代码来源:ReadMessageTest.java

示例12: 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)
                                            .compaction(CompactionParams.lcs(Collections.singletonMap("sstable_size_in_mb", "1"))),
                                SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD2));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:11,代码来源:OneCompactionTest.java

示例13: defineSchema

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

示例14: defineSchema

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

示例15: defineSchema

import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
@BeforeClass
public static void defineSchema() throws Exception
{
    SchemaLoader.prepareServer();
    setup();
    SchemaLoader.createKeyspace(KEYSPACE1,
                                KeyspaceParams.simple(1),
                                CFMetaData.Builder.create(KEYSPACE1, CF_STANDARD, true, false, false)
                                                  .addPartitionKey("pk", AsciiType.instance)
                                                  .addClusteringColumn("ck", AsciiType.instance)
                                                  .addRegularColumn("val", AsciiType.instance)
                                                  .build());
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:14,代码来源:EmbeddedCassandraServiceTest.java


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