Search in sources :

Example 1 with AvroTableSchema

use of com.nearinfinity.honeycomb.mysql.gen.AvroTableSchema in project honeycomb by altamiracorp.

the class HandlerProxy method createTable.

/**
     * Create a table with the given specifications.  The table is not open when
     * this is called.
     *
     * @param tableName             Name of the table
     * @param serializedTableSchema Serialized {@link AvroTableSchema} avro object
     * @param autoInc               Initial auto increment value
     */
public void createTable(String tableName, byte[] serializedTableSchema, long autoInc) {
    Verify.isNotNullOrEmpty(tableName);
    checkNotNull(serializedTableSchema, "Schema cannot be null");
    store = storeFactory.createStore(tableName);
    TableSchema tableSchema = TableSchema.deserialize(serializedTableSchema);
    Verify.isValidTableSchema(tableSchema);
    store.createTable(tableName, tableSchema);
    store.incrementAutoInc(tableName, autoInc);
}
Also used : AvroTableSchema(com.nearinfinity.honeycomb.mysql.gen.AvroTableSchema) TableSchema(com.nearinfinity.honeycomb.mysql.schema.TableSchema)

Aggregations

AvroTableSchema (com.nearinfinity.honeycomb.mysql.gen.AvroTableSchema)1 TableSchema (com.nearinfinity.honeycomb.mysql.schema.TableSchema)1