本文整理汇总了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));
}
示例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();
}
示例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));
}
示例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
}
示例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);
}
示例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);
}
示例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),
CFMetaData.Builder.create(KEYSPACE1, CF_STANDARD1)
.addPartitionKey("pKey", AsciiType.instance)
.addRegularColumn("col1", AsciiType.instance)
.build());
}
示例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"));
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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));
}
示例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());
}