本文整理汇总了Java中me.prettyprint.cassandra.service.ThriftCfDef类的典型用法代码示例。如果您正苦于以下问题:Java ThriftCfDef类的具体用法?Java ThriftCfDef怎么用?Java ThriftCfDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ThriftCfDef类属于me.prettyprint.cassandra.service包,在下文中一共展示了ThriftCfDef类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getColumnFamilyDefinitions
import me.prettyprint.cassandra.service.ThriftCfDef; //导入依赖的package包/类
public List<ColumnFamilyDefinition> getColumnFamilyDefinitions() {
List<ColumnFamilyDefinition> list = new ArrayList<>();
for (String key: this.columnFamilyDefinitions.keySet()) {
ColumnFamilyDefinition columnFamilyDefinition = this.columnFamilyDefinitions.get(key);
ThriftCfDef thriftCfDef = new ThriftCfDef(columnFamilyDefinition);
list.add(thriftCfDef);
}
return list;
}
开发者ID:jianglibo,项目名称:gora-boot,代码行数:11,代码来源:CassandraMapping.java
示例2: createCF_PO_Sx
import me.prettyprint.cassandra.service.ThriftCfDef; //导入依赖的package包/类
/**
* Creates POS? column family.
*
* @param cfName the column family name.
* @return the POS? column family definition.
*/
protected ColumnFamilyDefinition createCF_PO_Sx(final String cfName) {
final ColumnFamilyDefinition cfdef = HFactory.createColumnFamilyDefinition(_dataAccessLayerFactory.getKeyspaceName(), cfName, ComparatorType.COMPOSITETYPE);
cfdef.setColumnType(ColumnType.STANDARD);
cfdef.setKeyValidationClass(ComparatorType.BYTESTYPE.getClassName());
cfdef.setDefaultValidationClass(ComparatorType.BYTESTYPE.getClassName());
cfdef.setComparatorTypeAlias("(DoubleType, BytesType)");
cfdef.setCompactionStrategy("LeveledCompactionStrategy");
cfdef.setCompressionOptions(_compressionOptions);
return new ThriftCfDef(cfdef);
}
开发者ID:cumulusrdf,项目名称:cumulusrdf,代码行数:19,代码来源:Cassandra12xTripleIndexDAO.java
示例3: createCF_RDT_PO_S
import me.prettyprint.cassandra.service.ThriftCfDef; //导入依赖的package包/类
/**
* Creates POS? column family used for date range queries.
*
* @param cfName the column family name.
* @return the POS? column family definition.
*/
protected ColumnFamilyDefinition createCF_RDT_PO_S(final String cfName) {
final ColumnFamilyDefinition cfdef = HFactory.createColumnFamilyDefinition(_dataAccessLayerFactory.getKeyspaceName(), cfName, ComparatorType.COMPOSITETYPE);
cfdef.setColumnType(ColumnType.STANDARD);
cfdef.setKeyValidationClass(ComparatorType.BYTESTYPE.getClassName());
cfdef.setDefaultValidationClass(ComparatorType.BYTESTYPE.getClassName());
cfdef.setComparatorTypeAlias("(LongType, BytesType)");
cfdef.setCompactionStrategy("LeveledCompactionStrategy");
cfdef.setCompressionOptions(_compressionOptions);
return new ThriftCfDef(cfdef);
}
开发者ID:cumulusrdf,项目名称:cumulusrdf,代码行数:18,代码来源:Cassandra12xTripleIndexDAO.java
示例4: createCF_RDT_SP_O
import me.prettyprint.cassandra.service.ThriftCfDef; //导入依赖的package包/类
/**
* Creates SPO? column family used for date range queries.
*
* @param cfName the column family name.
* @return the SPO? column family definition.
*/
protected ColumnFamilyDefinition createCF_RDT_SP_O(final String cfName) {
final ColumnFamilyDefinition cfdef = HFactory.createColumnFamilyDefinition(_dataAccessLayerFactory.getKeyspaceName(), cfName, ComparatorType.LONGTYPE);
cfdef.setColumnType(ColumnType.STANDARD);
cfdef.setKeyValidationClass(ComparatorType.BYTESTYPE.getClassName());
cfdef.setDefaultValidationClass(ComparatorType.BYTESTYPE.getClassName());
cfdef.setCompactionStrategy("LeveledCompactionStrategy");
cfdef.setCompressionOptions(_compressionOptions);
return new ThriftCfDef(cfdef);
}
开发者ID:cumulusrdf,项目名称:cumulusrdf,代码行数:17,代码来源:Cassandra12xTripleIndexDAO.java
示例5: createCF_SP_Ox
import me.prettyprint.cassandra.service.ThriftCfDef; //导入依赖的package包/类
/**
* Creates SPO? column family.
*
* @param cfName the column family name.
* @return the SPO? column family definition.
*/
protected ColumnFamilyDefinition createCF_SP_Ox(final String cfName) {
final BasicColumnFamilyDefinition cfdef = new BasicColumnFamilyDefinition();
cfdef.setKeyspaceName(_dataAccessLayerFactory.getKeyspaceName());
cfdef.setName(cfName);
cfdef.setColumnType(ColumnType.STANDARD);
cfdef.setComparatorType(ComparatorType.getByClassName("org.apache.cassandra.db.marshal.DoubleType"));
cfdef.setCompactionStrategy("LeveledCompactionStrategy");
cfdef.setKeyValidationClass(ComparatorType.BYTESTYPE.getClassName());
cfdef.setDefaultValidationClass(ComparatorType.BYTESTYPE.getClassName());
cfdef.setCompressionOptions(_compressionOptions);
return new ThriftCfDef(cfdef);
}
开发者ID:cumulusrdf,项目名称:cumulusrdf,代码行数:21,代码来源:Cassandra12xTripleIndexDAO.java
示例6: createRequiredSchemaEntities
import me.prettyprint.cassandra.service.ThriftCfDef; //导入依赖的package包/类
@Override
public void createRequiredSchemaEntities() throws DataAccessLayerException {
final String keyspace_name = _keyspace.getKeyspaceName();
final KeyspaceDefinition ksdef = _factory.getCluster().describeKeyspace(keyspace_name);
if (!hasColumnFamily(ksdef, _cf_name)) {
final ColumnFamilyDefinition cfDef = HFactory.createColumnFamilyDefinition(keyspace_name, _cf_name);
final Map<String, String> compressionOptions = new HashMap<String, String>();
compressionOptions.put("sstable_compression", "SnappyCompressor");
cfDef.setCompressionOptions(compressionOptions);
cfDef.setColumnType(ColumnType.STANDARD);
cfDef.setKeyValidationClass(ComparatorType.BYTESTYPE.getClassName());
cfDef.setDefaultValidationClass(ComparatorType.BYTESTYPE.getClassName());
cfDef.setCompactionStrategy("LeveledCompactionStrategy");
if (_isBidirectional) {
BasicColumnDefinition colDef = new BasicColumnDefinition();
colDef.setName(BytesArraySerializer.get().toByteBuffer(COLUMN_NAME));
colDef.setValidationClass(ComparatorType.BYTESTYPE.getClassName());
colDef.setIndexType(ColumnIndexType.KEYS);
colDef.setIndexName(_cf_name + "_val_idx");
cfDef.addColumnDefinition(colDef);
}
_factory.getCluster().addColumnFamily(new ThriftCfDef(cfDef), true);
}
}
开发者ID:cumulusrdf,项目名称:cumulusrdf,代码行数:32,代码来源:Cassandra12xMapDAO.java
示例7: getColumnFamilyDefinitions
import me.prettyprint.cassandra.service.ThriftCfDef; //导入依赖的package包/类
public List<ColumnFamilyDefinition> getColumnFamilyDefinitions() {
List<ColumnFamilyDefinition> list = new ArrayList<ColumnFamilyDefinition>();
for (String key: this.columnFamilyDefinitions.keySet()) {
ColumnFamilyDefinition columnFamilyDefinition = this.columnFamilyDefinitions.get(key);
ThriftCfDef thriftCfDef = new ThriftCfDef(columnFamilyDefinition);
list.add(thriftCfDef);
}
return list;
}
开发者ID:maestros,项目名称:gora-oraclenosql,代码行数:11,代码来源:CassandraMapping.java
示例8: createCF
import me.prettyprint.cassandra.service.ThriftCfDef; //导入依赖的package包/类
/**
* Creates a column family definition.
*
* @param cfName the column family name.
* @param indexedCols names of columns that will be indexed.
* @param keyComp the key comparator.
* @param valueValidationClass the value validation class.
* @param compositeCol a flag that indicates if columns are composite.
* @return the column family definition.
*/
protected ColumnFamilyDefinition createCF(
final String cfName,
final List<byte[]> indexedCols,
final ComparatorType keyComp,
final ComparatorType valueValidationClass,
final boolean compositeCol) {
final ColumnFamilyDefinition cfdef = HFactory.createColumnFamilyDefinition(
_dataAccessLayerFactory.getKeyspaceName(),
cfName,
compositeCol
? ComparatorType.COMPOSITETYPE
: ComparatorType.BYTESTYPE);
cfdef.setKeyspaceName(_dataAccessLayerFactory.getKeyspaceName());
cfdef.setColumnType(ColumnType.STANDARD);
cfdef.setCompactionStrategy("LeveledCompactionStrategy");
if (compositeCol) {
cfdef.setComparatorTypeAlias("(BytesType, BytesType, BytesType)");
}
for (byte[] col : indexedCols) {
final String indexColumnFamilyName = "index_" + cfName + "_" + Arrays.hashCode(col);
try {
_dataAccessLayerFactory.getCluster().dropColumnFamily(
_dataAccessLayerFactory.getKeyspaceName(),
indexColumnFamilyName,
true);
} catch (HInvalidRequestException ignore) {
// Nothing to be done here...
}
cfdef.addColumnDefinition(createCDef(col, valueValidationClass.getClassName(), indexColumnFamilyName));
}
cfdef.setKeyValidationClass(keyComp.getClassName());
cfdef.setDefaultValidationClass(valueValidationClass.getClassName());
cfdef.setCompressionOptions(_compressionOptions);
return new ThriftCfDef(cfdef);
}
开发者ID:cumulusrdf,项目名称:cumulusrdf,代码行数:51,代码来源:Cassandra12xTripleIndexDAO.java
示例9: createSchema
import me.prettyprint.cassandra.service.ThriftCfDef; //导入依赖的package包/类
private void createSchema() {
// ColumnFamily 1
BasicColumnDefinition columnDefinition1_1 = new BasicColumnDefinition();
columnDefinition1_1.setName(stringSerializer.toByteBuffer("name"));
columnDefinition1_1.setValidationClass(ComparatorType.LONGTYPE.getClassName());
BasicColumnDefinition columnDefinition1_2 = new BasicColumnDefinition();
columnDefinition1_2.setName(stringSerializer.toByteBuffer("column_A_B"));
columnDefinition1_2.setValidationClass(ComparatorType.UTF8TYPE.getClassName());
BasicColumnFamilyDefinition columnFamilyDefinition1 = new BasicColumnFamilyDefinition();
columnFamilyDefinition1.setKeyspaceName(KEYSPACE_NAME);
columnFamilyDefinition1.setName(COLUMN_FAMILY_NAME_1);
columnFamilyDefinition1.addColumnDefinition(columnDefinition1_1);
columnFamilyDefinition1.addColumnDefinition(columnDefinition1_2);
ColumnFamilyDefinition cfDef1 = new ThriftCfDef(columnFamilyDefinition1);
// ColumnFamily 2
BasicColumnDefinition columnDefinitionIndexed1 = new BasicColumnDefinition();
columnDefinitionIndexed1.setName(stringSerializer.toByteBuffer("column_test_1"));
columnDefinitionIndexed1.setIndexType(ColumnIndexType.KEYS);
columnDefinitionIndexed1.setIndexName("INDEX_COLUMN_TEST_1");
columnDefinitionIndexed1.setValidationClass(ComparatorType.UTF8TYPE.getClassName());
BasicColumnDefinition columnDefinitionIndexed2 = new BasicColumnDefinition();
columnDefinitionIndexed2.setName(stringSerializer.toByteBuffer("birthdate"));
columnDefinitionIndexed2.setIndexType(ColumnIndexType.KEYS);
columnDefinitionIndexed2.setIndexName("INDEX_BIRTH_DATE");
columnDefinitionIndexed2.setValidationClass(ComparatorType.LONGTYPE.getClassName());
BasicColumnFamilyDefinition columnFamilyDefinitionIndexed = new BasicColumnFamilyDefinition();
columnFamilyDefinitionIndexed.setKeyspaceName(KEYSPACE_NAME);
columnFamilyDefinitionIndexed.setName(COLUMN_FAMILY_INDEXED_1);
columnFamilyDefinitionIndexed.addColumnDefinition(columnDefinitionIndexed1);
columnFamilyDefinitionIndexed.addColumnDefinition(columnDefinitionIndexed2);
ColumnFamilyDefinition cfDef2 = new ThriftCfDef(columnFamilyDefinitionIndexed);
// ColumnFamilySuper
BasicColumnDefinition columnDefinitionSuper1 = new BasicColumnDefinition();
columnDefinitionSuper1.setName(stringSerializer.toByteBuffer("Super_Column_1"));
columnDefinitionSuper1.setValidationClass(ComparatorType.UTF8TYPE.getClassName());
BasicColumnFamilyDefinition columnFamilyDefinitionSuper2 = new BasicColumnFamilyDefinition();
columnFamilyDefinitionSuper2.setKeyspaceName(KEYSPACE_NAME);
columnFamilyDefinitionSuper2.setName(COLUMN_FAMILY_SUPER_1);
columnFamilyDefinitionSuper2.setColumnType(ColumnType.SUPER);
columnFamilyDefinitionSuper2.addColumnDefinition(columnDefinitionSuper1);
ColumnFamilyDefinition cfDefSuper = new ThriftCfDef(columnFamilyDefinitionSuper2);
KeyspaceDefinition keyspaceDefinition = HFactory.createKeyspaceDefinition(KEYSPACE_NAME,
SimpleStrategy.class.getName(), 1, Arrays.asList(cfDef1, cfDef2, cfDefSuper));
cluster.addKeyspace(keyspaceDefinition, true);
// cluster.updateKeyspace(keyspaceDefinition);
}
开发者ID:xuzhikethinker,项目名称:t4f-data,代码行数:64,代码来源:HectorCassandraTest.java
注:本文中的me.prettyprint.cassandra.service.ThriftCfDef类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论