Repository: oom-ai/oomstore
Pull request #887 (2022-01-04 01:36:05)

chore: rename FeatureList with Features
this PR does rename `FeatureList` with `Features`.


Patch:
diff --git a/internal/database/online/cassandra/get.go b/internal/database/online/cassandra/get.go
index 5edb080e..58da07ae 100644
--- a/internal/database/online/cassandra/get.go
+++ b/internal/database/online/cassandra/get.go
@@ -17,7 +17,7 @@ func (db *DB) Get(ctx context.Context, opt online.GetOpt) (dbutil.RowMap, error)
 	tableName := sqlutil.OnlineBatchTableName(opt.RevisionID)
 
 	query := fmt.Sprintf(`SELECT %s FROM %s WHERE %s = ?`,
-		strings.Join(opt.FeatureList.Names(), ","),
+		strings.Join(opt.Features.Names(), ","),
 		tableName,
 		opt.Entity.Name,
 	)
@@ -30,7 +30,7 @@ func (db *DB) Get(ctx context.Context, opt online.GetOpt) (dbutil.RowMap, error)
 		return nil, err
 	}
 
-	for _, feature := range opt.FeatureList {
+	for _, feature := range opt.Features {
 		rs[feature.FullName] = deserializeString(rs[feature.Name])
 	}
 	return rs, nil
@@ -45,7 +45,7 @@ func (db *DB) MultiGet(ctx context.Context, opt online.MultiGetOpt) (map[string]
 
 	query := fmt.Sprintf(`SELECT %s, %s FROM %s WHERE %s in (%s)`,
 		opt.Entity.Name,
-		strings.Join(opt.FeatureList.Names(), ","),
+		strings.Join(opt.Features.Names(), ","),
 		tableName,
 		opt.Entity.Name,
 		placeholders,
@@ -63,7 +63,7 @@ func (db *DB) MultiGet(ctx context.Context, opt online.MultiGetOpt) (map[string]
 	}
 
 	for _, s := range slice {
-		entityKey, value := deserializeIntoRowMap(s, opt.Entity.Name, opt.FeatureList)
+		entityKey, value := deserializeIntoRowMap(s, opt.Entity.Name, opt.Features)
 		rs[entityKey] = value
 
 	}
diff --git a/internal/database/online/cassandra/import.go b/internal/database/online/cassandra/import.go
index 2d3a63e5..3a1fe5a5 100644
--- a/internal/database/online/cassandra/import.go
+++ b/internal/database/online/cassandra/import.go
@@ -13,10 +13,10 @@ import (
 )
 
 func (db *DB) Import(ctx context.Context, opt online.ImportOpt) error {
-	columns := append([]string{opt.Entity.Name}, opt.FeatureList.Names()...)
+	columns := append([]string{opt.Entity.Name}, opt.Features.Names()...)
 	tableName := sqlutil.OnlineBatchTableName(opt.Revision.ID)
 
-	table := dbutil.BuildTableSchema(tableName, opt.Entity, false, opt.FeatureList, Backend)
+	table := dbutil.BuildTableSchema(tableName, opt.Entity, false, opt.Features, Backend)
 
 	// create table
 	if err := db.Query(table).Exec(); err != nil {
@@ -28,8 +28,8 @@ func (db *DB) Import(ctx context.Context, opt online.ImportOpt) error {
 		batch      = db.NewBatch(gocql.LoggedBatch)
 	)
 	for record := range opt.ExportStream {
-		if len(record) != len(opt.FeatureList)+1 {
-			return fmt.Errorf("field count not matched, expected %d, got %d", len(opt.FeatureList)+1, len(record))
+		if len(record) != len(opt.Features)+1 {
+			return fmt.Errorf("field count not matched, expected %d, got %d", len(opt.Features)+1, len(record))
 		}
 
 		if batch.Size() != BatchSize {
diff --git a/internal/database/online/dynamodb/get.go b/internal/database/online/dynamodb/get.go
index 72665b26..c2e06059 100644
--- a/internal/database/online/dynamodb/get.go
+++ b/internal/database/online/dynamodb/get.go
@@ -37,7 +37,7 @@ func (db *DB) Get(ctx context.Context, opt online.GetOpt) (dbutil.RowMap, error)
 		}
 		return nil, err
 	}
-	return deserializeFeatureValues(opt.FeatureList, result.Item)
+	return deserializeFeatureValues(opt.Features, result.Item)
 }
 
 // response: map[entity_key]map[feature_name]feature_value
@@ -54,13 +54,13 @@ func (db *DB) MultiGet(ctx context.Context, opt online.MultiGetOpt) (map[string]
 			opt.Entity.Name: entityKeyValue,
 		})
 		if len(keys) == BatchGetItemCapacity {
-			if err = batchGetItem(ctx, db, keys, tableName, opt.Entity.Name, opt.FeatureList, res); err != nil {
+			if err = batchGetItem(ctx, db, keys, tableName, opt.Entity.Name, opt.Features, res); err != nil {
 				return nil, err
 			}
 			keys = make([]map[string]types.AttributeValue, 0, BatchGetItemCapacity)
 		}
 	}
-	if err := batchGetItem(ctx, db, keys, tableName, opt.Entity.Name, opt.FeatureList, res); err != nil {
+	if err := batchGetItem(ctx, db, keys, tableName, opt.Entity.Name, opt.Features, res); err != nil {
 		return nil, err
 	}
 	return res, nil
diff --git a/internal/database/online/dynamodb/import.go b/internal/database/online/dynamodb/import.go
index 4649f55e..ff375028 100644
--- a/internal/database/online/dynamodb/import.go
+++ b/internal/database/online/dynamodb/import.go
@@ -91,7 +91,7 @@ func buildItem(record oomTypes.ExportRecord, opt online.ImportOpt) (map[string]t
 	}
 	item[opt.Entity.Name] = entityKeyValue
 
-	for i, feature := range opt.FeatureList {
+	for i, feature := range opt.Features {
 		value, err := serializeByTag(record.ValueAt(i), feature.ValueType)
 		if err != nil {
 			return nil, err
diff --git a/internal/database/online/redis/get.go b/internal/database/online/redis/get.go
index 399efcfc..08563d31 100644
--- a/internal/database/online/redis/get.go
+++ b/internal/database/online/redis/get.go
@@ -15,7 +15,7 @@ func (db *DB) Get(ctx context.Context, opt online.GetOpt) (dbutil.RowMap, error)
 	}
 
 	featureIDs := []string{}
-	for _, f := range opt.FeatureList {
+	for _, f := range opt.Features {
 		id, err := kvutil.SerializeByValue(f.ID)
 		if err != nil {
 			return nil, err
@@ -33,11 +33,11 @@ func (db *DB) Get(ctx context.Context, opt online.GetOpt) (dbutil.RowMap, error)
 		if v == nil {
 			continue
 		}
-		typedValue, err := kvutil.DeserializeByValueType(v, opt.FeatureList[i].ValueType)
+		typedValue, err := kvutil.DeserializeByValueType(v, opt.Features[i].ValueType)
 		if err != nil {
 			return nil, err
 		}
-		rowMap[opt.FeatureList[i].FullName] = typedValue
+		rowMap[opt.Features[i].FullName] = typedValue
 	}
 	return rowMap, nil
 }
@@ -47,10 +47,10 @@ func (db *DB) MultiGet(ctx context.Context, opt online.MultiGetOpt) (map[string]
 	res := make(map[string]dbutil.RowMap)
 	for _, entityKey := range opt.EntityKeys {
 		rowMap, err := db.Get(ctx, online.GetOpt{
-			Entity:      opt.Entity,
-			RevisionID:  opt.RevisionID,
-			EntityKey:   entityKey,
-			FeatureList: opt.FeatureList,
+			Entity:     opt.Entity,
+			RevisionID: opt.RevisionID,
+			EntityKey:  entityKey,
+			Features:   opt.Features,
 		})
 		if err != nil {
 			return res, err
diff --git a/internal/database/online/redis/import.go b/internal/database/online/redis/import.go
index 389e4ea9..ddac3450 100644
--- a/internal/database/online/redis/import.go
+++ b/internal/database/online/redis/import.go
@@ -14,8 +14,8 @@ func (db *DB) Import(ctx context.Context, opt online.ImportOpt) error {
 	defer pipe.Close()
 
 	for record := range opt.ExportStream {
-		if len(record) != len(opt.FeatureList)+1 {
-			return fmt.Errorf("field count not matched, expected %d, got %d", len(opt.FeatureList)+1, len(record))
+		if len(record) != len(opt.Features)+1 {
+			return fmt.Errorf("field count not matched, expected %d, got %d", len(opt.Features)+1, len(record))
 		}
 
 		entityKey, values := record[0], record[1:]
@@ -25,17 +25,17 @@ func (db *DB) Import(ctx context.Context, opt online.ImportOpt) error {
 		}
 
 		featureValues := make(map[string]string)
-		for i := range opt.FeatureList {
+		for i := range opt.Features {
 			// omit nil feature value
 			if values[i] == nil {
 				continue
 			}
-			featureValue, err := kvutil.SerializeByValueType(values[i], opt.FeatureList[i].ValueType)
+			featureValue, err := kvutil.SerializeByValueType(values[i], opt.Features[i].ValueType)
 			if err != nil {
 				return err
 			}
 
-			featureID, err := kvutil.SerializeByValue(opt.FeatureList[i].ID)
+			featureID, err := kvutil.SerializeByValue(opt.Features[i].ID)
 			if err != nil {
 				return err
 			}
diff --git a/internal/database/online/redis/push.go b/internal/database/online/redis/push.go
index 904e2fff..04b6f06c 100644
--- a/internal/database/online/redis/push.go
+++ b/internal/database/online/redis/push.go
@@ -20,12 +20,12 @@ func (db *DB) Push(ctx context.Context, opt online.PushOpt) error {
 			continue
 		}
 
-		featureValue, err := kvutil.SerializeByValueType(value, opt.FeatureList[i].ValueType)
+		featureValue, err := kvutil.SerializeByValueType(value, opt.Features[i].ValueType)
 		if err != nil {
 			return err
 		}
 
-		featureID, err := kvutil.SerializeByValue(opt.FeatureList[i].ID)
+		featureID, err := kvutil.SerializeByValue(opt.Features[i].ID)
 		if err != nil {
 			return err
 		}
diff --git a/internal/database/online/sqlutil/get.go b/internal/database/online/sqlutil/get.go
index 646e3b2c..009bdff9 100644
--- a/internal/database/online/sqlutil/get.go
+++ b/internal/database/online/sqlutil/get.go
@@ -14,7 +14,7 @@ import (
 )
 
 func Get(ctx context.Context, db *sqlx.DB, opt online.GetOpt, backend types.BackendType) (dbutil.RowMap, error) {
-	featureNames := opt.FeatureList.Names()
+	featureNames := opt.Features.Names()
 	tableName := OnlineBatchTableName(opt.RevisionID)
 	qt := dbutil.QuoteFn(backend)
 	query := fmt.Sprintf(`SELECT %s FROM %s WHERE %s = ?`, qt(featureNames...), qt(tableName), qt(opt.Entity.Name))
@@ -27,7 +27,7 @@ func Get(ctx context.Context, db *sqlx.DB, opt online.GetOpt, backend types.Back
 		return nil, err
 	}
 
-	rs, err := deserializeIntoRowMap(record, opt.FeatureList, backend)
+	rs, err := deserializeIntoRowMap(record, opt.Features, backend)
 	if err != nil {
 		return nil, err
 	}
@@ -36,7 +36,7 @@ func Get(ctx context.Context, db *sqlx.DB, opt online.GetOpt, backend types.Back
 
 // response: map[entity_key]map[feature_name]feature_value
 func MultiGet(ctx context.Context, db *sqlx.DB, opt online.MultiGetOpt, backend types.BackendType) (map[string]dbutil.RowMap, error) {
-	featureNames := opt.FeatureList.Names()
+	featureNames := opt.Features.Names()
 	tableName := OnlineBatchTableName(opt.RevisionID)
 	qt := dbutil.QuoteFn(backend)
 	query := fmt.Sprintf(`SELECT %s, %s FROM %s WHERE %s in (?);`, qt(opt.Entity.Name), qt(featureNames...), qt(tableName), qt(opt.Entity.Name))
@@ -51,7 +51,7 @@ func MultiGet(ctx context.Context, db *sqlx.DB, opt online.MultiGetOpt, backend
 	}
 	defer rows.Close()
 
-	return getFeatureValueMapFromRows(rows, opt.FeatureList, backend)
+	return getFeatureValueMapFromRows(rows, opt.Features, backend)
 }
 
 func getFeatureValueMapFromRows(rows *sqlx.Rows, features types.FeatureList, backend types.BackendType) (map[string]dbutil.RowMap, error) {
diff --git a/internal/database/online/sqlutil/import.go b/internal/database/online/sqlutil/import.go
index b48e4faa..80075eac 100644
--- a/internal/database/online/sqlutil/import.go
+++ b/internal/database/online/sqlutil/import.go
@@ -13,11 +13,11 @@ import (
 const importBatchSize = 10
 
 func Import(ctx context.Context, db *sqlx.DB, opt online.ImportOpt, backend types.BackendType) error {
-	columns := append([]string{opt.Entity.Name}, opt.FeatureList.Names()...)
+	columns := append([]string{opt.Entity.Name}, opt.Features.Names()...)
 	err := dbutil.WithTransaction(db, ctx, func(ctx context.Context, tx *sqlx.Tx) error {
 		// create the data table
 		tableName := OnlineBatchTableName(opt.Revision.ID)
-		schema := dbutil.BuildTableSchema(tableName, opt.Entity, false, opt.FeatureList, backend)
+		schema := dbutil.BuildTableSchema(tableName, opt.Entity, false, opt.Features, backend)
 		_, err := tx.ExecContext(ctx, schema)
 		if err != nil {
 			return err
@@ -26,8 +26,8 @@ func Import(ctx context.Context, db *sqlx.DB, opt online.ImportOpt, backend type
 		// populate the data table
 		records := make([]interface{}, 0, importBatchSize)
 		for record := range opt.ExportStream {
-			if len(record) != len(opt.FeatureList)+1 {
-				return fmt.Errorf("field count not matched, expected %d, got %d", len(opt.FeatureList)+1, len(record))
+			if len(record) != len(opt.Features)+1 {
+				return fmt.Errorf("field count not matched, expected %d, got %d", len(opt.Features)+1, len(record))
 			}
 			records = append(records, record)
 
diff --git a/internal/database/online/sqlutil/push.go b/internal/database/online/sqlutil/push.go
index 08b78aa8..6d2be354 100644
--- a/internal/database/online/sqlutil/push.go
+++ b/internal/database/online/sqlutil/push.go
@@ -21,12 +21,12 @@ func BuildPushCondition(opt online.PushOpt, backend types.BackendType) *PushCond
 	qt := dbutil.QuoteFn(backend)
 	cond := PushCondition{}
 
-	cond.Inserts = qt(append([]string{opt.Entity.Name}, opt.FeatureList.Names()...)...)
+	cond.Inserts = qt(append([]string{opt.Entity.Name}, opt.Features.Names()...)...)
 	cond.InsertValues = append([]interface{}{opt.EntityKey}, opt.FeatureValues...)
 	cond.InsertPlaceholders = dbutil.Fill(len(cond.InsertValues), "?", ",")
 
-	updatePlaceholders := make([]string, 0, opt.FeatureList.Len())
-	for _, name := range opt.FeatureList.Names() {
+	updatePlaceholders := make([]string, 0, opt.Features.Len())
+	for _, name := range opt.Features.Names() {
 		updatePlaceholders = append(updatePlaceholders, fmt.Sprintf("%s=?", qt(name)))
 	}
 	cond.UpdatePlaceholders = strings.Join(updatePlaceholders, ",")
diff --git a/internal/database/online/tikv/get.go b/internal/database/online/tikv/get.go
index 100459c8..45343a3c 100644
--- a/internal/database/online/tikv/get.go
+++ b/internal/database/online/tikv/get.go
@@ -17,10 +17,10 @@ type input struct {
 func (db *DB) Get(ctx context.Context, opt online.GetOpt) (dbutil.RowMap, error) {
 	// Proxy to MultiGet
 	res, err := db.MultiGet(ctx, online.MultiGetOpt{
-		Entity:      opt.Entity,
-		RevisionID:  opt.RevisionID,
-		EntityKeys:  []string{opt.EntityKey},
-		FeatureList: opt.FeatureList,
+		Entity:     opt.Entity,
+		RevisionID: opt.RevisionID,
+		EntityKeys: []string{opt.EntityKey},
+		Features:   opt.Features,
 	})
 	if err != nil {
 		return nil, err
@@ -48,7 +48,7 @@ func (db *DB) MultiGet(ctx context.Context, opt online.MultiGetOpt) (map[string]
 	}
 
 	var serializedFeatureIDs []string
-	for _, feature := range opt.FeatureList {
+	for _, feature := range opt.Features {
 		serializedFeatureID, err := kvutil.SerializeByValue(feature.ID)
 		if err != nil {
 			return nil, err
@@ -73,7 +73,7 @@ func (db *DB) MultiGet(ctx context.Context, opt online.MultiGetOpt) (map[string]
 	// What we need to align with the result
 	var inputs []input
 	for _, entityKey := range opt.EntityKeys {
-		for _, feature := range opt.FeatureList {
+		for _, feature := range opt.Features {
 			inputs = append(inputs, input{entityKey, *feature})
 		}
 	}
diff --git a/internal/database/online/tikv/import.go b/internal/database/online/tikv/import.go
index 835dde2c..51179700 100644
--- a/internal/database/online/tikv/import.go
+++ b/internal/database/online/tikv/import.go
@@ -19,7 +19,7 @@ func (db *DB) Import(ctx context.Context, opt online.ImportOpt) error {
 	}
 
 	var serializedFeatureIDs []string
-	for _, feature := range opt.FeatureList {
+	for _, feature := range opt.Features {
 		serializedFeatureID, err := kvutil.SerializeByValue(feature.ID)
 		if err != nil {
 			return err
@@ -32,8 +32,8 @@ func (db *DB) Import(ctx context.Context, opt online.ImportOpt) error {
 	var putVals [][]byte
 
 	for record := range opt.ExportStream {
-		if len(record) != len(opt.FeatureList)+1 {
-			return fmt.Errorf("field count not matched, expected %d, got %d", len(opt.FeatureList)+1, len(record))
+		if len(record) != len(opt.Features)+1 {
+			return fmt.Errorf("field count not matched, expected %d, got %d", len(opt.Features)+1, len(record))
 		}
 
 		entityKey, featureValues := record[0], record[1:]
@@ -43,13 +43,13 @@ func (db *DB) Import(ctx context.Context, opt online.ImportOpt) error {
 			return err
 		}
 
-		for i := range opt.FeatureList {
+		for i := range opt.Features {
 			// omit nil feature value
 			if featureValues[i] == nil {
 				continue
 			}
 
-			serializedFeatureValue, err := kvutil.SerializeByValueType(featureValues[i], opt.FeatureList[i].ValueType)
+			serializedFeatureValue, err := kvutil.SerializeByValueType(featureValues[i], opt.Features[i].ValueType)
 			if err != nil {
 				return err
 			}
diff --git a/internal/database/online/tikv/push.go b/internal/database/online/tikv/push.go
index 0fc1438d..31bb3622 100644
--- a/internal/database/online/tikv/push.go
+++ b/internal/database/online/tikv/push.go
@@ -27,12 +27,12 @@ func (db *DB) Push(ctx context.Context, opt online.PushOpt) error {
 			continue
 		}
 
-		serializedFeatureID, err := kvutil.SerializeByValue(opt.FeatureList[i].ID)
+		serializedFeatureID, err := kvutil.SerializeByValue(opt.Features[i].ID)
 		if err != nil {
 			return err
 		}
 
-		serializedFeatureValue, err := kvutil.SerializeByValueType(value, opt.FeatureList[i].ValueType)
+		serializedFeatureValue, err := kvutil.SerializeByValueType(value, opt.Features[i].ValueType)
 		if err != nil {
 			return err
 		}
diff --git a/internal/database/online/types.go b/internal/database/online/types.go
index 3ab84f10..c65e9f7e 100644
--- a/internal/database/online/types.go
+++ b/internal/database/online/types.go
@@ -5,17 +5,17 @@ import (
 )
 
 type GetOpt struct {
-	Entity      *types.Entity
-	RevisionID  int
-	EntityKey   string
-	FeatureList types.FeatureList
+	Entity     *types.Entity
+	RevisionID int
+	EntityKey  string
+	Features   types.FeatureList
 }
 
 type MultiGetOpt struct {
-	Entity      *types.Entity
-	RevisionID  int
-	EntityKeys  []string
-	FeatureList types.FeatureList
+	Entity     *types.Entity
+	RevisionID int
+	EntityKeys []string
+	Features   types.FeatureList
 }
 
 type ImportOpt struct {
@@ -23,14 +23,14 @@ type ImportOpt struct {
 	Entity       *types.Entity
 	ExportStream <-chan types.ExportRecord
 	ExportError  <-chan error
-	FeatureList  types.FeatureList
+	Features     types.FeatureList
 }
 
 type PushOpt struct {
 	Entity        *types.Entity
 	EntityKey     string
 	GroupID       int
-	FeatureList   types.FeatureList
+	Features      types.FeatureList
 	FeatureValues []interface{}
 }
 
diff --git a/pkg/oomstore/online_query.go b/pkg/oomstore/online_query.go
index b9646072..354efd2a 100644
--- a/pkg/oomstore/online_query.go
+++ b/pkg/oomstore/online_query.go
@@ -40,10 +40,10 @@ func (s *OomStore) OnlineGet(ctx context.Context, opt types.OnlineGetOpt) (*type
 			continue
 		}
 		featureValues, err := s.online.Get(ctx, online.GetOpt{
-			Entity:      entity,
-			RevisionID:  onlineRevisionID,
-			EntityKey:   opt.EntityKey,
-			FeatureList: features,
+			Entity:     entity,
+			RevisionID: onlineRevisionID,
+			EntityKey:  opt.EntityKey,
+			Features:   features,
 		})
 		if err != nil {
 			return nil, err
@@ -107,10 +107,10 @@ func (s *OomStore) getFeatureValueMap(ctx context.Context, entityKeys []string,
 			continue
 		}
 		featureValues, err := s.online.MultiGet(ctx, online.MultiGetOpt{
-			Entity:      entity,
-			RevisionID:  onlineRevisionID,
-			EntityKeys:  entityKeys,
-			FeatureList: features,
+			Entity:     entity,
+			RevisionID: onlineRevisionID,
+			EntityKeys: entityKeys,
+			Features:   features,
 		})
 		if err != nil {
 			return nil, err
diff --git a/pkg/oomstore/sync.go b/pkg/oomstore/sync.go
index 86066584..a69844ac 100644
--- a/pkg/oomstore/sync.go
+++ b/pkg/oomstore/sync.go
@@ -45,7 +45,7 @@ func (s *OomStore) Sync(ctx context.Context, opt types.SyncOpt) error {
 	})
 
 	if err = s.online.Import(ctx, online.ImportOpt{
-		FeatureList:  features,
+		Features:     features,
 		Revision:     revision,
 		Entity:       group.Entity,
 		ExportStream: exportStream,


Test patch:
diff --git a/internal/database/online/test_impl/get.go b/internal/database/online/test_impl/get.go
index 06cee5bf..43846ce2 100644
--- a/internal/database/online/test_impl/get.go
+++ b/internal/database/online/test_impl/get.go
@@ -17,10 +17,10 @@ func TestGetExisted(t *testing.T, prepareStore PrepareStoreFn, destroyStore Dest
 
 	for _, target := range s.Data {
 		opt := online.GetOpt{
-			Entity:      s.Entity,
-			RevisionID:  s.Revision.ID,
-			FeatureList: s.Features,
-			EntityKey:   target.EntityKey(),
+			Entity:     s.Entity,
+			RevisionID: s.Revision.ID,
+			Features:   s.Features,
+			EntityKey:  target.EntityKey(),
 		}
 		rs, err := store.Get(ctx, opt)
 		require.NoError(t, err)
@@ -40,10 +40,10 @@ func TestGetNotExistedEntityKey(t *testing.T, prepareStore PrepareStoreFn, destr
 	importSample(t, ctx, store, s)
 
 	rs, err := store.Get(ctx, online.GetOpt{
-		Entity:      s.Entity,
-		RevisionID:  s.Revision.ID,
-		FeatureList: s.Features,
-		EntityKey:   "not-existed-key",
+		Entity:     s.Entity,
+		RevisionID: s.Revision.ID,
+		Features:   s.Features,
+		EntityKey:  "not-existed-key",
 	})
 	require.NoError(t, err)
 	require.Equal(t, 0, len(rs), "actual: %+v", rs)
@@ -62,10 +62,10 @@ func TestMultiGet(t *testing.T, prepareStore PrepareStoreFn, destroystore Destro
 		keys = append(keys, r.EntityKey())
 	}
 	rs, err := store.MultiGet(ctx, online.MultiGetOpt{
-		Entity:      s.Entity,
-		RevisionID:  s.Revision.ID,
-		FeatureList: s.Features,
-		EntityKeys:  keys,
+		Entity:     s.Entity,
+		RevisionID: s.Revision.ID,
+		Features:   s.Features,
+		EntityKeys: keys,
 	})
 	require.NoError(t, err)
 	for _, record := range s.Data {
diff --git a/internal/database/online/test_impl/purge.go b/internal/database/online/test_impl/purge.go
index 5a30ff9d..9e4c44e9 100644
--- a/internal/database/online/test_impl/purge.go
+++ b/internal/database/online/test_impl/purge.go
@@ -19,10 +19,10 @@ func TestPurgeRemovesSpecifiedRevision(t *testing.T, prepareStore PrepareStoreFn
 
 	for _, record := range SampleMedium.Data {
 		rs, err := store.Get(ctx, online.GetOpt{
-			Entity:      SampleMedium.Entity,
-			RevisionID:  SampleMedium.Revision.ID,
-			EntityKey:   record.EntityKey(),
-			FeatureList: SampleMedium.Features,
+			Entity:     SampleMedium.Entity,
+			RevisionID: SampleMedium.Revision.ID,
+			EntityKey:  record.EntityKey(),
+			Features:   SampleMedium.Features,
 		})
 		require.NoError(t, err)
 		require.Equal(t, 0, len(rs))
@@ -41,10 +41,10 @@ func TestPurgeNotRemovesOtherRevisions(t *testing.T, prepareStore PrepareStoreFn
 
 	for _, record := range SampleSmall.Data {
 		rs, err := store.Get(ctx, online.GetOpt{
-			Entity:      SampleSmall.Entity,
-			RevisionID:  SampleSmall.Revision.ID,
-			EntityKey:   record.EntityKey(),
-			FeatureList: SampleSmall.Features,
+			Entity:     SampleSmall.Entity,
+			RevisionID: SampleSmall.Revision.ID,
+			EntityKey:  record.EntityKey(),
+			Features:   SampleSmall.Features,
 		})
 		require.NoError(t, err)
 		for i, f := range SampleSmall.Features {
diff --git a/internal/database/online/test_impl/stream.go b/internal/database/online/test_impl/stream.go
index f0681249..5206a25b 100644
--- a/internal/database/online/test_impl/stream.go
+++ b/internal/database/online/test_impl/stream.go
@@ -128,7 +128,7 @@ func TestPush(t *testing.T, prepareStore PrepareStoreFn, destoryStore DestroySto
 		Entity:        &entity,
 		EntityKey:     "user1",
 		GroupID:       group.ID,
-		FeatureList:   types.FeatureList{feature1},
+		Features:      types.FeatureList{feature1},
 		FeatureValues: []interface{}{"post1"},
 	}))
 
@@ -136,7 +136,7 @@ func TestPush(t *testing.T, prepareStore PrepareStoreFn, destoryStore DestroySto
 		Entity:        &entity,
 		EntityKey:     "user1",
 		GroupID:       group.ID,
-		FeatureList:   types.FeatureList{feature1},
+		Features:      types.FeatureList{feature1},
 		FeatureValues: []interface{}{"post2"},
 	}))
 
@@ -150,7 +150,7 @@ func TestPush(t *testing.T, prepareStore PrepareStoreFn, destoryStore DestroySto
 		Entity:        &entity,
 		EntityKey:     "user1",
 		GroupID:       group.ID,
-		FeatureList:   types.FeatureList{feature1, feature2},
+		Features:      types.FeatureList{feature1, feature2},
 		FeatureValues: []interface{}{"post1", "post2"},
 	}))
 }
diff --git a/internal/database/online/test_impl/util.go b/internal/database/online/test_impl/util.go
index b0144077..22ce2d71 100644
--- a/internal/database/online/test_impl/util.go
+++ b/internal/database/online/test_impl/util.go
@@ -115,7 +115,7 @@ func importSample(t *testing.T, ctx context.Context, store online.Store, samples
 		}(sample)
 
 		err := store.Import(ctx, online.ImportOpt{
-			FeatureList:  sample.Features,
+			Features:     sample.Features,
 			Revision:     sample.Revision,
 			Entity:       sample.Entity,
 			ExportStream: stream,
diff --git a/pkg/oomstore/sync_test.go b/pkg/oomstore/sync_test.go
index d414b072..0c78f316 100644
--- a/pkg/oomstore/sync_test.go
+++ b/pkg/oomstore/sync_test.go
@@ -81,8 +81,8 @@ func TestSync(t *testing.T) {
 				}).Return(stream, nil)
 
 				onlineStore.EXPECT().Import(ctx, online.ImportOpt{
-					FeatureList: features,
-					Revision:    revision,
+					Features: features,
+					Revision: revision,
 					Entity: &types.Entity{
 						Name: "device",
 					},
@@ -116,8 +116,8 @@ func TestSync(t *testing.T) {
 				}).Return(stream, nil)
 
 				onlineStore.EXPECT().Import(ctx, online.ImportOpt{
-					FeatureList: features,
-					Revision:    revision,
+					Features: features,
+					Revision: revision,
 					Entity: &types.Entity{
 						Name: "device",
 					},