Java Code Examples for org.apache.commons.text.TextStringBuilder#appendln()

The following examples show how to use org.apache.commons.text.TextStringBuilder#appendln() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: casquatch   File: TortureTable.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Generated: Returns DDL
* @return DDL for table
*/
public static String getDDL() {
    TextStringBuilder ddl = new TextStringBuilder();
    ddl.appendln(Udt.getDDL());
    ddl.appendln("CREATE TABLE \"torture_table\" ( \"id\" uuid, \"col_ascii\" ascii, \"col_bigint\" bigint, \"col_blob\" blob, \"col_boolean\" boolean, \"col_date\" date, \"col_decimal\" decimal, \"col_double\" double, \"col_float\" float, \"col_inet\" inet, \"col_int\" int, \"col_list\" list<text>, \"col_map\" map<text, text>, \"col_set\" set<text>, \"col_smallint\" smallint, \"col_text\" text, \"col_time\" time, \"col_timestamp\" timestamp, \"col_timeuuid\" timeuuid, \"col_tinyint\" tinyint, \"col_udt\" frozen<\"junittest\".\"udt\">, \"col_uuid\" uuid, \"col_varchar\" text, \"col_varint\" varint, PRIMARY KEY (\"id\") ) WITH bloom_filter_fp_chance = 0.01 AND caching = {'keys':'ALL','rows_per_partition':'NONE'} AND comment = '' AND compaction = {'class':'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy','max_threshold':'32','min_threshold':'4'} AND compression = {'chunk_length_in_kb':'64','class':'org.apache.cassandra.io.compress.LZ4Compressor'} AND crc_check_chance = 1.0 AND dclocal_read_repair_chance = 0.1 AND default_time_to_live = 0 AND extensions = {} AND gc_grace_seconds = 864000 AND max_index_interval = 2048 AND memtable_flush_period_in_ms = 0 AND min_index_interval = 128 AND read_repair_chance = 0.0 AND speculative_retry = '99PERCENTILE';");
    return ddl.toString();
}
 
Example 2
Source Project: casquatch   File: CasquatchGenerator.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Syntax helper
 * @return string containing help message
 */
public static String help() {
    TextStringBuilder output = new TextStringBuilder();
    output.appendln("Casquatch Code Generated");
    output.appendln("");
    output.appendln("Properties can be provided via the command line via -D parameters");
    output.appendln("Properties:");
    output.appendln("casquatch.generator.username=<string> -- Authentication Username");
    output.appendln("casquatch.generator.password=<string> -- Authentication Password");
    output.appendln("casquatch.generator.keyspace=<string> -- Keyspace to parse");
    output.appendln("casquatch.generator.datacenter=<string> -- LocalDC for connection");
    output.appendln("casquatch.generator.contactPoints.0=<ip0:port>...casquatch.generator.contactPoints.n=<ipn:port> -- List of contact points");
    output.appendln("casquatch.generator.tables.0=<table0>...casquatch.generator.tables.n=<tablen> -- Provide a list of tables. All tables are processed if not supplied");
    output.appendln("casquatch.generator.console=<boolean> -- Indicate if generated code should be printed to console");
    output.appendln("casquatch.generator.file=<boolean> -- Indicate if generated code should be printed to a file");
    output.appendln("casquatch.generator.outputFolder=<path> -- Required if file=true. Defines location to write generated files");
    output.appendln("casquatch.generator.overwrite=<boolean> -- Toggle overwriting of files in output folder");
    output.appendln("casquatch.generator.createPackage=<boolean> -- If createPackage=true then pom.xml and src folder structure will be added |");
    output.appendln("casquatch.generator.packageName=<string> -- Package name for source files");
    output.appendln("config.file=<path> -- Specify a path  to a config file to place parameters");
    output.appendln("");
    output.appendln("Examples: ");
    output.appendln("");
    output.appendln("Generate using properties file");
    output.appendln("java -Dconfig.file=/path/to/config.properties -jar CassandraGenerator.jar");
    output.appendln("");
    output.appendln("Generate all tables in a keyspace providing minimum information");
    output.appendln("java -Dcasquatch.generator.outputFolder=tmp -Dcasquatch.generator.keyspace=myKeyspace -Dcasquatch.generator.datacenter=datacenter1 -jar CassandraGenerator.jar");
    output.appendln("");
    output.appendln("Generate a package for all tables in a keyspace providing additional information");
    output.appendln("java -Dcasquatch.generator.outputFolder=tmp -Dcasquatch.generator.keyspace=myKeyspace -Dcasquatch.generator.datacenter=datacenter1 -Dcasquatch.generator.username=cassandra -Dcasquatch.generator.password=cassandra -Dcasquatch.generator.createPackage=true -Dcasquatch.generator.packageName=com.demo.mykeyspace -jar CassandraGenerator.jar");
    return output.toString();
}
 
Example 3
Source Project: casquatch   File: TableName.java    License: Apache License 2.0 4 votes vote down vote up
/**
* Generated: Returns DDL
* @return DDL for table
*/
public static String getDDL() {
    TextStringBuilder ddl = new TextStringBuilder();
    ddl.appendln("CREATE TABLE \"table_name\" ( \"key_one\" int, \"key_two\" int, \"col_one\" text, \"col_two\" text, PRIMARY KEY (\"key_one\", \"key_two\") ) WITH bloom_filter_fp_chance = 0.01 AND caching = {'keys':'ALL','rows_per_partition':'NONE'} AND comment = '' AND compaction = {'class':'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy','max_threshold':'32','min_threshold':'4'} AND compression = {'chunk_length_in_kb':'64','class':'org.apache.cassandra.io.compress.LZ4Compressor'} AND crc_check_chance = 1.0 AND dclocal_read_repair_chance = 0.1 AND default_time_to_live = 0 AND extensions = {} AND gc_grace_seconds = 864000 AND max_index_interval = 2048 AND memtable_flush_period_in_ms = 0 AND min_index_interval = 128 AND read_repair_chance = 0.0 AND speculative_retry = '99PERCENTILE';");
    return ddl.toString();
}
 
Example 4
Source Project: casquatch   File: Configuration.java    License: Apache License 2.0 4 votes vote down vote up
/**
* Generated: Returns DDL
* @return DDL for table
*/
public static String getDDL() {
    TextStringBuilder ddl = new TextStringBuilder();
    ddl.appendln("CREATE TABLE \"configuration\" ( \"application\" text, \"profile\" text, \"label\" text, \"key\" text, \"value\" text, PRIMARY KEY ((\"application\", \"profile\"), \"label\", \"key\") ) WITH bloom_filter_fp_chance = 0.01 AND caching = {'keys':'ALL','rows_per_partition':'NONE'} AND comment = '' AND compaction = {'class':'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy','max_threshold':'32','min_threshold':'4'} AND compression = {'chunk_length_in_kb':'64','class':'org.apache.cassandra.io.compress.LZ4Compressor'} AND crc_check_chance = 1.0 AND dclocal_read_repair_chance = 0.1 AND default_time_to_live = 0 AND extensions = {} AND gc_grace_seconds = 864000 AND max_index_interval = 2048 AND memtable_flush_period_in_ms = 0 AND min_index_interval = 128 AND read_repair_chance = 0.0 AND speculative_retry = '99PERCENTILE';");
    return ddl.toString();
}
 
Example 5
Source Project: casquatch   File: SimpleTable.java    License: Apache License 2.0 4 votes vote down vote up
/**
* Generated: Returns DDL
* @return DDL for table
*/
public static String getDDL() {
    TextStringBuilder ddl = new TextStringBuilder();
    ddl.appendln("CREATE TABLE \"simple_table\" ( \"key_one\" int, \"key_two\" int, \"col_one\" text, \"col_two\" text, \"solr_query\" text, PRIMARY KEY (\"key_one\", \"key_two\") ) WITH bloom_filter_fp_chance = 0.01 AND caching = {'keys':'ALL','rows_per_partition':'NONE'} AND comment = '' AND compaction = {'class':'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy','max_threshold':'32','min_threshold':'4'} AND compression = {'chunk_length_in_kb':'64','class':'org.apache.cassandra.io.compress.LZ4Compressor'} AND crc_check_chance = 1.0 AND dclocal_read_repair_chance = 0.1 AND default_time_to_live = 0 AND extensions = {} AND gc_grace_seconds = 864000 AND max_index_interval = 2048 AND memtable_flush_period_in_ms = 0 AND min_index_interval = 128 AND read_repair_chance = 0.0 AND speculative_retry = '99PERCENTILE';");
    return ddl.toString();
}
 
Example 6
Source Project: casquatch   File: NodeMetaData.java    License: Apache License 2.0 4 votes vote down vote up
/**
* Generated: Returns DDL
* @return DDL for table
*/
public static String getDDL() {
    TextStringBuilder ddl = new TextStringBuilder();
    ddl.appendln("CREATE TABLE \"local\" ( \"key\" text, \"bootstrapped\" text, \"broadcast_address\" inet, \"cluster_name\" text, \"cql_version\" text, \"data_center\" text, \"dse_version\" text, \"gossip_generation\" int, \"graph\" boolean, \"host_id\" uuid, \"listen_address\" inet, \"native_protocol_version\" text, \"partitioner\" text, \"rack\" text, \"release_version\" text, \"rpc_address\" inet, \"schema_version\" uuid, \"server_id\" text, \"thrift_version\" text, \"tokens\" set<text>, \"truncated_at\" map<uuid, blob>, \"workload\" text, \"workloads\" frozen<set<text>>, PRIMARY KEY (\"key\") ) WITH bloom_filter_fp_chance = 0.01 AND caching = {'keys':'ALL','rows_per_partition':'NONE'} AND comment = 'information about the local node' AND compaction = {'class':'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy','max_threshold':'32','min_threshold':'4'} AND compression = {'chunk_length_in_kb':'64','class':'org.apache.cassandra.io.compress.LZ4Compressor'} AND crc_check_chance = 1.0 AND dclocal_read_repair_chance = 0.0 AND default_time_to_live = 0 AND extensions = {} AND gc_grace_seconds = 0 AND max_index_interval = 2048 AND memtable_flush_period_in_ms = 3600000 AND min_index_interval = 128 AND read_repair_chance = 0.0 AND speculative_retry = '99PERCENTILE';");
    return ddl.toString();
}