本文整理汇总了Java中org.apache.cassandra.SchemaLoader.standardCFMD方法的典型用法代码示例。如果您正苦于以下问题:Java SchemaLoader.standardCFMD方法的具体用法?Java SchemaLoader.standardCFMD怎么用?Java SchemaLoader.standardCFMD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.SchemaLoader
的用法示例。
在下文中一共展示了SchemaLoader.standardCFMD方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: keyspaceWithTriggers
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
private static KeyspaceMetadata keyspaceWithTriggers()
{
String keyspace = KEYSPACE_PREFIX + "Triggers";
Triggers.Builder triggers = Triggers.builder();
CFMetaData table = SchemaLoader.standardCFMD(keyspace, "WithTriggers");
for (int i = 0; i < 10; i++)
triggers.add(new TriggerMetadata("trigger" + i, "DummyTrigger" + i));
table.triggers(triggers.build());
return KeyspaceMetadata.create(keyspace, KeyspaceParams.simple(1), Tables.of(table));
}
示例3: constructMetadata
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
public Map<MetadataType, MetadataComponent> constructMetadata()
{
ReplayPosition club = new ReplayPosition(11L, 12);
ReplayPosition cllb = new ReplayPosition(9L, 12);
CFMetaData cfm = SchemaLoader.standardCFMD("ks1", "cf1");
MetadataCollector collector = new MetadataCollector(cfm.comparator)
.commitLogIntervals(new IntervalSet(cllb, club));
String partitioner = RandomPartitioner.class.getCanonicalName();
double bfFpChance = 0.1;
Map<MetadataType, MetadataComponent> originalMetadata = collector.finalizeMetadata(partitioner, bfFpChance, 0, SerializationHeader.make(cfm, Collections.emptyList()));
return originalMetadata;
}
示例4: makeTable
import org.apache.cassandra.SchemaLoader; //导入方法依赖的package包/类
/**
* Return a table metadata, we use types with fixed size to increase the chance of detecting corrupt data
*/
private static CFMetaData makeTable(String tableName)
{
return SchemaLoader.standardCFMD(KEYSPACE1, tableName, 1, LongType.instance, LongType.instance, LongType.instance);
}