org.apache.mahout.cf.taste.impl.model
Class MySQLJDBCIDMigrator

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator
      extended by org.apache.mahout.cf.taste.impl.model.AbstractJDBCIDMigrator
          extended by org.apache.mahout.cf.taste.impl.model.MySQLJDBCIDMigrator
All Implemented Interfaces:
Refreshable, IDMigrator, UpdatableIDMigrator

public final class MySQLJDBCIDMigrator
extends AbstractJDBCIDMigrator

An implementation for MySQL. The following statement would create a table suitable for use with this class:

 CREATE TABLE taste_id_migration (
   long_id BIGINT NOT NULL PRIMARY KEY,
   string_id VARCHAR(255) NOT NULL UNIQUE
 )
 

Separately, note that in a MySQL database, the following function calls will convert a string value into a numeric value in the same way that the standard implementations in this package do. This may be useful in writing SQL statements for use with AbstractJDBCDataModel subclasses which convert string column values to appropriate numeric values -- though this should be viewed as a temporary arrangement since it will impact performance:

cast(conv(substring(md5([column name]), 1, 16),16,10) as signed)


Field Summary
 
Fields inherited from class org.apache.mahout.cf.taste.impl.model.AbstractJDBCIDMigrator
DEFAULT_LONG_ID_COLUMN, DEFAULT_MAPPING_TABLE, DEFAULT_STRING_ID_COLUMN
 
Constructor Summary
MySQLJDBCIDMigrator(DataSource dataSource)
           
MySQLJDBCIDMigrator(DataSource dataSource, String mappingTable, String longIDColumn, String stringIDColumn)
           
 
Method Summary
 
Methods inherited from class org.apache.mahout.cf.taste.impl.model.AbstractJDBCIDMigrator
initialize, storeMapping, toStringID
 
Methods inherited from class org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator
hash, refresh, toLongID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.mahout.cf.taste.model.IDMigrator
toLongID
 
Methods inherited from interface org.apache.mahout.cf.taste.common.Refreshable
refresh
 

Constructor Detail

MySQLJDBCIDMigrator

public MySQLJDBCIDMigrator(DataSource dataSource)

MySQLJDBCIDMigrator

public MySQLJDBCIDMigrator(DataSource dataSource,
                           String mappingTable,
                           String longIDColumn,
                           String stringIDColumn)


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.