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.setKeyspace(keySpace); cf.setKey_cache_size(0); cf.setRow_cache_size(0); cf.setComment("Stores term information with indexName/field/term as composite key"); cf.setKeyspace(keySpace); cf.setKey_cache_size(0); cf.setRow_cache_size(0); cf.setComment("Stores term per doc per field"); cf.setKeyspace(keySpace); 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.setKeyspace(keySpace); cf.setKey_cache_size(0); cf.setRow_cache_size(0); cf.setComment("Stores solr and index id information"); cf.setKeyspace(keySpace);
cfDef.setComment(comment);
/** * Provides a basic column family definition. This is a subset of #getCfDef, and does not * include compression options, but also does not require raw metadata to be passed in. * * Warning to developers: you must update CKVS.isMatchingCf if you update this method */ static CfDef getStandardCfDef(String keyspace, String internalTableName) { CfDef cf = new CfDef(keyspace, internalTableName); cf.setComparator_type("CompositeType(BytesType,LongType)"); cf.setCompaction_strategy(CassandraConstants.LEVELED_COMPACTION_STRATEGY); cf.setCompression_options(Maps.<String, String>newHashMap()); cf.setGc_grace_seconds(CassandraConstants.DEFAULT_GC_GRACE_SECONDS); // explicitly set fields to default values cf.setCaching("KEYS_ONLY"); cf.setDclocal_read_repair_chance(0.1); cf.setTriggers(ImmutableList.of()); cf.setCells_per_row_to_cache("0"); cf.setMin_index_interval(128); cf.setMax_index_interval(2048); cf.setComment(""); cf.setColumn_metadata(ImmutableList.of()); cf.setMin_compaction_threshold(4); cf.setMax_compaction_threshold(32); cf.setKey_validation_class("org.apache.cassandra.db.marshal.BytesType"); cf.setCompaction_strategy_options(ImmutableMap.of()); cf.setDefault_validation_class("org.apache.cassandra.db.marshal.BytesType"); return cf; }
@Override public ColumnFamilyDefinition setComment(String comment) { cfDef.setComment(comment); return this; }
@Override public ColumnFamilyDefinition setComment(String comment) { cfDef.setComment(comment); return this; }
private void onSetComment(CfDef cfDef, Properties cFProperties, StringBuilder builder) { String comment = cFProperties.getProperty(CassandraConstants.COMMENT); if (comment != null) { if (builder != null) { String comment_Str = CQLTranslator.getKeyword(CassandraConstants.COMMENT); builder.append(comment_Str); builder.append(CQLTranslator.EQ_CLAUSE); builder.append(CQLTranslator.QUOTE_STR); builder.append(comment); builder.append(CQLTranslator.QUOTE_STR); builder.append(CQLTranslator.AND_CLAUSE); } else { cfDef.setComment(comment); } } }
d.setColumn_metadata(ThriftColumnDef.toThriftList(columnMetadata)); d.setColumn_type(columnType.getValue()); d.setComment(comment); d.setComparator_type(comparatorType.getClassName() + comparatorTypeAlias); d.setDefault_validation_class(defaultValidationClass);
static CfDef getStandardCfDef(String keyspace, String internalTableName) { CfDef cf = new CfDef(keyspace, internalTableName); cf.setComparator_type("CompositeType(BytesType,LongType)"); cf.setCompaction_strategy("LeveledCompactionStrategy"); cf.setCompaction_strategy_options(ImmutableMap.of("sstable_size_in_mb", CassandraConstants.SSTABLE_SIZE_IN_MB)); cf.setCompression_options(Maps.<String, String>newHashMap()); cf.setGc_grace_seconds(GC_GRACE_SECONDS); // explicitly set fields to default values cf.setCaching("KEYS_ONLY"); cf.setDclocal_read_repair_chance(0.1); cf.setTriggers(new ArrayList<TriggerDef>()); cf.setCells_per_row_to_cache("0"); cf.setMin_index_interval(128); cf.setMax_index_interval(2048); cf.setComment(""); cf.setColumn_metadata(new ArrayList<ColumnDef>()); cf.setMin_compaction_threshold(4); cf.setMax_compaction_threshold(32); cf.setKey_validation_class("org.apache.cassandra.db.marshal.BytesType"); cf.setCompaction_strategy_options(new HashMap<String, String>()); cf.setDefault_validation_class("org.apache.cassandra.db.marshal.BytesType"); return cf; } }
/** * Provides a basic column family definition. This is a subset of #getCfDef, and does not * include compression options, but also does not require raw metadata to be passed in. * * Warning to developers: you must update CKVS.isMatchingCf if you update this method */ static CfDef getStandardCfDef(String keyspace, String internalTableName) { CfDef cf = new CfDef(keyspace, internalTableName); cf.setComparator_type("CompositeType(BytesType,LongType)"); cf.setCompaction_strategy(CassandraConstants.LEVELED_COMPACTION_STRATEGY); cf.setCompression_options(Maps.<String, String>newHashMap()); cf.setGc_grace_seconds(CassandraConstants.DEFAULT_GC_GRACE_SECONDS); // explicitly set fields to default values cf.setCaching("KEYS_ONLY"); cf.setDclocal_read_repair_chance(0.1); cf.setTriggers(ImmutableList.of()); cf.setCells_per_row_to_cache("0"); cf.setMin_index_interval(128); cf.setMax_index_interval(2048); cf.setComment(""); cf.setColumn_metadata(ImmutableList.of()); cf.setMin_compaction_threshold(4); cf.setMax_compaction_threshold(32); cf.setKey_validation_class("org.apache.cassandra.db.marshal.BytesType"); cf.setCompaction_strategy_options(ImmutableMap.of()); cf.setDefault_validation_class("org.apache.cassandra.db.marshal.BytesType"); return cf; }
cf_def.setComment(""); if (!cf_def.isSetMin_compaction_threshold()) cf_def.setMin_compaction_threshold(CompactionParams.DEFAULT_MIN_THRESHOLD);
/** * 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()); }
break; case COMMENT: cfDef.setComment(CliUtils.unescapeSQLString(mValue)); break; case READ_REPAIR_CHANCE:
cf_def.setComment(""); if (!cf_def.isSetMin_compaction_threshold()) cf_def.setMin_compaction_threshold(CompactionParams.DEFAULT_MIN_THRESHOLD);
cf_def.setComment(""); if (!cf_def.isSetMin_compaction_threshold()) cf_def.setMin_compaction_threshold(CFMetaData.DEFAULT_MIN_COMPACTION_THRESHOLD);
def.setComment(Strings.nullToEmpty(comment)); def.setRead_repair_chance(readRepairChance); def.setDclocal_read_repair_chance(dcLocalReadRepairChance);
def.setComment(cfm.params.comment); def.setRead_repair_chance(cfm.params.readRepairChance); def.setDclocal_read_repair_chance(cfm.params.dcLocalReadRepairChance);
def.setComment(cfm.params.comment); def.setRead_repair_chance(cfm.params.readRepairChance); def.setDclocal_read_repair_chance(cfm.params.dcLocalReadRepairChance);
d.setColumn_metadata(ThriftColumnDef.toThriftList(columnMetadata)); d.setColumn_type(columnType.getValue()); d.setComment(comment); d.setComparator_type(comparatorType.getClassName() + comparatorTypeAlias); d.setDefault_validation_class(defaultValidationClass);
d.setColumn_metadata(ThriftColumnDef.toThriftList(columnMetadata)); d.setColumn_type(columnType.getValue()); d.setComment(comment); d.setComparator_type(comparatorType.getClassName() + comparatorTypeAlias); d.setDefault_validation_class(defaultValidationClass);
unsetComment(); } else { setComment((String)value);