cf.setName(docColumnFamily); cf.setComparator_type("BytesType"); cf.setKey_cache_size(0); cf.setRow_cache_size(0); cf.setComment("Stores the document and field data for each doc with docId as key"); cf.setName(termVecColumnFamily); cf.setComparator_type("lucandra.VIntType"); cf.setKey_cache_size(0); cf.setRow_cache_size(0); cf.setComment("Stores term information with indexName/field/term as composite key"); cf.setName(fieldCacheColumnFamily); cf.setComparator_type("lucandra.VIntType"); cf.setKey_cache_size(0); cf.setRow_cache_size(0); cf.setComment("Stores term per doc per field"); cf.setName(metaInfoColumnFamily); cf.setComparator_type("BytesType"); cf.setKey_cache_size(0); cf.setRow_cache_size(0); cf.setComment("Stores ordered list of terms for a given field with indexName/field as composite key"); cf.setColumn_type("Super"); cf.setComparator_type("BytesType"); cf.setKey_cache_size(0); cf.setRow_cache_size(0); cf.setComment("Stores solr and index id information");
@Override public ColumnFamilyDefinition setKeyCacheSize(Double keyCacheSize) { if (keyCacheSize != null) cfDef.setKey_cache_size(keyCacheSize); return this; }
@Override public ColumnFamilyDefinition setKeyCacheSize(Double keyCacheSize) { if (keyCacheSize != null) cfDef.setKey_cache_size(keyCacheSize); return this; }
.setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "TestBeanColumnFamily").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "TestBeanColumnFamily").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "PurpleColumnFamily").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "SimpleTestBeanColumnFamily").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "SimpleRelationshipBeanColumnFamily").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "NoAnonymousColumnFamily").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "ComplexColumnFamily").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "CompositeColumnFamily").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "Furniture").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "MyConvertedCollectionFamily").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "CustomIdColumnFamily").setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cluster = HFactory.getOrCreateCluster("TestPool", "localhost:9170"); createKeyspace(cluster, "TestKeyspace", "org.apache.cassandra.locator.SimpleStrategy", 1, cfDefList);
d.setId(id); d.setKey_cache_size(keyCacheSize); d.setKey_cache_save_period_in_seconds(keyCacheSavePeriodInSeconds); if(false || keyValidationClass != null) {
private CfDef columnFamilyDef(SchemaProperties prop) { CfDef cfd = new CfDef(ksName, prop.getColumn_family()); cfd.setKey_cache_size(Double.parseDouble(prop.getKeys_cached())); cfd.setComparator_type(prop.getComparator_type()); cfd.setKey_validation_class(prop.getKey_validation_class()); cfd.setDefault_validation_class(prop.getDefault_validation_class()); cfd.setRow_cache_provider(prop.getRow_cache_provider()); cfd.setRow_cache_size(Double.parseDouble(prop.getRows_cached())); return cfd; } }
/** * Private helper to initialize a column family definition */ protected void initializeColumnFamilyDefinition() throws ClassNotFoundException { columnFamilyDefinition = new CfDef(); columnFamilyDefinition.setName(columnFamily); columnFamilyDefinition.setKeyspace(getKeySpace()); ColumnFamily cfAnnotation = target.getAnnotation(ColumnFamily.class); String comparatorType = cfAnnotation.compareWith().getName(); if (cfAnnotation.reversed()) { comparatorType = String.format("%s(reversed=true)", comparatorType); } columnFamilyDefinition.setComparator_type(comparatorType); columnFamilyDefinition.setKey_cache_size(cfAnnotation.keysCached()); columnFamilyDefinition.setRow_cache_size(cfAnnotation.rowsCached()); columnFamilyDefinition.setComment(StringUtils.defaultIfEmpty(cfAnnotation.comment(), null)); columnFamilyDefinition.setComparator_type(cfAnnotation.compareWith().getName()); columnFamilyDefinition.setRead_repair_chance(cfAnnotation.readRepairChance()); columnFamilyDefinition.setGc_grace_seconds(cfAnnotation.gcGraceSeconds()); columnFamilyDefinition.setDefault_validation_class(StringUtils.defaultIfEmpty(cfAnnotation.defaultValidationClass().getName(), null)); columnFamilyDefinition.setKey_validation_class(StringUtils.defaultIfEmpty(cfAnnotation.defaultKeyValidationClass().getName(), null)); columnFamilyDefinition.setMin_compaction_threshold(cfAnnotation.minCompactionThreshold()); columnFamilyDefinition.setMax_compaction_threshold(cfAnnotation.maxCompactionThreshold()); columnFamilyDefinition.setReplicate_on_write(cfAnnotation.replicateOnWrite()); }
.setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "SimpleRelationshipBeanColumnFamily") .setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); cfDefList.add(new CfDef("TestKeyspace", "NoAnonymousColumnFamily") .setComparator_type(BytesType.class.getSimpleName()) .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400)); .setKey_cache_size(0).setRow_cache_size(0).setGc_grace_seconds(86400));
d.setId(id); d.setKey_cache_size(keyCacheSize); d.setKey_cache_save_period_in_seconds(keyCacheSavePeriodInSeconds); d.setKey_validation_class(keyValidationClass);
d.setId(id); d.setKey_cache_size(keyCacheSize); d.setKey_cache_save_period_in_seconds(keyCacheSavePeriodInSeconds); if(false || keyValidationClass != null) {
unsetKey_cache_size(); } else { setKey_cache_size((Double)value);
unsetKey_cache_size(); } else { setKey_cache_size((Double)value);
unsetKey_cache_size(); } else { setKey_cache_size((Double)value);