private void buildStringKeyedTable(TableManipulationConfigurationBuilder<?, ?> builder, OperationContext context, ModelNode table) throws OperationFailedException { String defaultTableNamePrefix = BaseJDBCStoreConfigurationResource.STRING_KEYED_TABLE_PREFIX.getDefaultValue().asString(); ModelNode tableNamePrefix = BaseJDBCStoreConfigurationResource.PREFIX.resolveModelAttribute(context, table); builder.batchSize(BaseJDBCStoreConfigurationResource.BATCH_SIZE.resolveModelAttribute(context, table).asInt()) .fetchSize(BaseJDBCStoreConfigurationResource.FETCH_SIZE.resolveModelAttribute(context, table).asInt()) .tableNamePrefix(tableNamePrefix.isDefined() ? tableNamePrefix.asString() : defaultTableNamePrefix) .createOnStart(BaseJDBCStoreConfigurationResource.CREATE_ON_START.resolveModelAttribute(context, table).asBoolean()) .dropOnExit(BaseJDBCStoreConfigurationResource.DROP_ON_EXIT.resolveModelAttribute(context, table).asBoolean()) .idColumnName(this.getColumnProperty(context, table, ModelKeys.ID_COLUMN, BaseJDBCStoreConfigurationResource.COLUMN_NAME, "id")) .idColumnType(this.getColumnProperty(context, table, ModelKeys.ID_COLUMN, BaseJDBCStoreConfigurationResource.COLUMN_TYPE, "VARCHAR")) .dataColumnName(this.getColumnProperty(context, table, ModelKeys.DATA_COLUMN, BaseJDBCStoreConfigurationResource.COLUMN_NAME, "datum")) .dataColumnType(this.getColumnProperty(context, table, ModelKeys.DATA_COLUMN, BaseJDBCStoreConfigurationResource.COLUMN_TYPE, "BINARY")) .timestampColumnName(this.getColumnProperty(context, table, ModelKeys.TIMESTAMP_COLUMN, BaseJDBCStoreConfigurationResource.COLUMN_NAME, "version")) .timestampColumnType(this.getColumnProperty(context, table, ModelKeys.TIMESTAMP_COLUMN, BaseJDBCStoreConfigurationResource.COLUMN_TYPE, "BIGINT")) .segmentColumnName(this.getColumnProperty(context, table, ModelKeys.SEGMENT_COLUMN, BaseJDBCStoreConfigurationResource.COLUMN_NAME, "segment")) .segmentColumnType(this.getColumnProperty(context, table, ModelKeys.SEGMENT_COLUMN, BaseJDBCStoreConfigurationResource.COLUMN_TYPE, "INTEGER")) ; }
public static void buildTableManipulation(TableManipulationConfigurationBuilder<?, ?> table) { table .tableNamePrefix("ISPN_STRING") .idColumnName("ID_COLUMN") .idColumnType("VARCHAR(255)") .dataColumnName("DATA_COLUMN") .dataColumnType("BLOB") .timestampColumnName("TIMESTAMP_COLUMN") .timestampColumnType("BIGINT") .segmentColumnName("SEGMENT_COLUMN") .segmentColumnType("INTEGER"); }
private void parseTableElements(XMLExtendedStreamReader reader, TableManipulationConfigurationBuilder<?, ?> builder) throws XMLStreamException { while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { Element element = Element.forName(reader.getLocalName()); switch (element) { case ID_COLUMN: { Column column = parseTableElementAttributes(reader); builder.idColumnName(column.name); builder.idColumnType(column.type); break; } case DATA_COLUMN: { Column column = parseTableElementAttributes(reader); builder.dataColumnName(column.name); builder.dataColumnType(column.type); break; } case TIMESTAMP_COLUMN: { Column column = parseTableElementAttributes(reader); builder.timestampColumnName(column.name); builder.timestampColumnType(column.type); break; } default: { throw ParseUtils.unexpectedElement(reader); } } } }
switch (attribute) { case BATCH_SIZE: { builder.batchSize(Integer.parseInt(value)); break; builder.createOnStart(Boolean.parseBoolean(value)); break; builder.dropOnExit(Boolean.parseBoolean(value)); break; builder.fetchSize(Integer.parseInt(value)); break; builder.tableNamePrefix(value); break;
case ID_COLUMN: { Column column = parseTableElementAttributes(reader); builder.idColumnName(column.name); builder.idColumnType(column.type); break; builder.dataColumnName(column.name); builder.dataColumnType(column.type); break; builder.timestampColumnName(column.name); builder.timestampColumnType(column.type); break; builder.segmentColumnName(column.name); builder.segmentColumnType(column.type); break;
switch (attribute) { case BATCH_SIZE: { builder.batchSize(Integer.parseInt(value)); break; builder.createOnStart(Boolean.parseBoolean(value)); break; builder.dropOnExit(Boolean.parseBoolean(value)); break; builder.fetchSize(Integer.parseInt(value)); break; builder.tableNamePrefix(value); break;