@Override public String getApiName() { return apiName.asName(); }
@Override public String asName() { return EnumUtils.camelCase(name()); }
/** * Constructor. */ public TestRegisteredLookupDimensions() { super(); for (TestApiDimensionName apiName : TestApiDimensionName.values()) { DimensionConfig dimensionConfig = dimensionNameConfigs.get(apiName); RegisteredLookupDimensionConfig lookupDimensionConfig = new TestRegisteredLookupDimensionConfig( dimensionConfig, dimensionLookups(dimensionConfig.getApiName().toUpperCase(Locale.ENGLISH)) ); dimensionNameConfigs.put(apiName, lookupDimensionConfig); } }
/** * Constructor. * * @param dimensionConfig Configuration properties for dimensions * @param namespaces List of namespaces used for Lookup */ public TestLookupDimensionConfig(@NotNull DimensionConfig dimensionConfig, List<String> namespaces) { this( TestApiDimensionName.valueOf(dimensionConfig.getApiName().toUpperCase(Locale.ENGLISH)), dimensionConfig.getPhysicalName(), dimensionConfig.getKeyValueStore(), dimensionConfig.getSearchProvider(), dimensionConfig.getFields(), dimensionConfig.getDefaultDimensionFields(), namespaces ); }
/** * Constructor. */ public TestRegisteredLookupDimensions() { super(); for (TestApiDimensionName apiName : TestApiDimensionName.values()) { DimensionConfig dimensionConfig = dimensionNameConfigs.get(apiName); RegisteredLookupDimensionConfig lookupDimensionConfig = new TestRegisteredLookupDimensionConfig( dimensionConfig, dimensionLookups(dimensionConfig.getApiName().toUpperCase(Locale.ENGLISH)) ); dimensionNameConfigs.put(apiName, lookupDimensionConfig); } }
/** * Constructor. * * @param dimensionConfig Configuration properties for dimensions * @param registeredLookupExtractionFns A list of registered lookup extraction functions used to perform lookups. */ public TestRegisteredLookupDimensionConfig( @NotNull DimensionConfig dimensionConfig, List<ExtractionFunction> registeredLookupExtractionFns ) { this( TestApiDimensionName.valueOf(dimensionConfig.getApiName().toUpperCase(Locale.ENGLISH)), dimensionConfig.getPhysicalName(), dimensionConfig.getKeyValueStore(), dimensionConfig.getSearchProvider(), dimensionConfig.getFields(), dimensionConfig.getDefaultDimensionFields(), registeredLookupExtractionFns ); }
@Override public String getApiName() { return apiName.asName(); }
/** * Constructor. */ public TestLookupDimensions() { super(); for (TestApiDimensionName apiName : TestApiDimensionName.values()) { DimensionConfig dimensionConfig = dimensionNameConfigs.get(apiName); LookupDimensionConfig lookupDimensionConfig = new TestLookupDimensionConfig( dimensionConfig, dimensionNamespaces(dimensionConfig.getApiName().toUpperCase(Locale.ENGLISH)) ); dimensionNameConfigs.put(apiName, lookupDimensionConfig); } }
/** * Constructor. * * @param dimensionConfig Configuration properties for dimensions * @param namespaces List of namespaces used for Lookup */ public TestLookupDimensionConfig(@NotNull DimensionConfig dimensionConfig, List<String> namespaces) { this( TestApiDimensionName.valueOf(dimensionConfig.getApiName().toUpperCase(Locale.ENGLISH)), dimensionConfig.getPhysicalName(), dimensionConfig.getKeyValueStore(), dimensionConfig.getSearchProvider(), dimensionConfig.getFields(), dimensionConfig.getDefaultDimensionFields(), namespaces ); }
@Override public String asName() { return EnumUtils.camelCase(name()); }
@Override public String getLongName() { return apiName.asName(); }
/** * Constructor. */ public TestLookupDimensions() { super(); for (TestApiDimensionName apiName : TestApiDimensionName.values()) { DimensionConfig dimensionConfig = dimensionNameConfigs.get(apiName); LookupDimensionConfig lookupDimensionConfig = new TestLookupDimensionConfig( dimensionConfig, dimensionNamespaces(dimensionConfig.getApiName().toUpperCase(Locale.ENGLISH)) ); dimensionNameConfigs.put(apiName, lookupDimensionConfig); } }
/** * Constructor. * * @param dimensionConfig Configuration properties for dimensions * @param registeredLookupExtractionFns A list of registered lookup extraction functions used to perform lookups. */ public TestRegisteredLookupDimensionConfig( @NotNull DimensionConfig dimensionConfig, List<ExtractionFunction> registeredLookupExtractionFns ) { this( TestApiDimensionName.valueOf(dimensionConfig.getApiName().toUpperCase(Locale.ENGLISH)), dimensionConfig.getPhysicalName(), dimensionConfig.getKeyValueStore(), dimensionConfig.getSearchProvider(), dimensionConfig.getFields(), dimensionConfig.getDefaultDimensionFields(), registeredLookupExtractionFns ); }
@Override public String getLongName() { return apiName.asName(); }
/** * Constructor. * * @param apiName API Name of the dimension * @param physicalName Physical name of the dimension * @param keyValueStore KeyValueStore for the dimension * @param searchProvider SearchProvider for the dimension * @param fields Fields of the dimension * @param defaultFields Default fields of the dimension * @param storageStrategy Storage Strategy of the dimension */ public TestDimensionConfig( TestApiDimensionName apiName, String physicalName, KeyValueStore keyValueStore, SearchProvider searchProvider, LinkedHashSet<DimensionField> fields, LinkedHashSet<DimensionField> defaultFields, StorageStrategy storageStrategy ) { this.apiName = apiName; this.physicalName = physicalName; this.description = apiName.asName(); this.keyValueStore = keyValueStore; this.searchProvider = searchProvider; this.fields = fields; this.defaultFields = defaultFields; this.storageStrategy = storageStrategy; }
/** * Constructor. * * @param apiName API Name of the dimension * @param physicalName Physical name of the dimension * @param keyValueStore KeyValueStore for the dimension * @param searchProvider SearchProvider for the dimension * @param fields Fields of the dimension * @param defaultFields Default fields of the dimension * @param storageStrategy Storage Strategy of the dimension */ public TestDimensionConfig( TestApiDimensionName apiName, String physicalName, KeyValueStore keyValueStore, SearchProvider searchProvider, LinkedHashSet<DimensionField> fields, LinkedHashSet<DimensionField> defaultFields, StorageStrategy storageStrategy ) { this.apiName = apiName; this.physicalName = physicalName; this.description = apiName.asName(); this.keyValueStore = keyValueStore; this.searchProvider = searchProvider; this.fields = fields; this.defaultFields = defaultFields; this.storageStrategy = storageStrategy; }
/** * Constructor. * * @param apiName API Name of the dimension * @param physicalName Physical name of the dimension * @param keyValueStore KeyValueStore for the dimension * @param searchProvider SearchProvider for the dimension * @param fields Fields of the dimension * @param defaultFields Default fields of the dimension */ public TestDimensionConfig( TestApiDimensionName apiName, String physicalName, KeyValueStore keyValueStore, SearchProvider searchProvider, LinkedHashSet<DimensionField> fields, LinkedHashSet<DimensionField> defaultFields ) { this.apiName = apiName; this.physicalName = physicalName; this.description = apiName.asName(); this.keyValueStore = keyValueStore; this.searchProvider = searchProvider; this.fields = fields; this.defaultFields = defaultFields; this.storageStrategy = StorageStrategy.LOADED; }
/** * Constructor. * * @param apiName API Name of the dimension * @param physicalName Physical name of the dimension * @param keyValueStore KeyValueStore for the dimension * @param searchProvider SearchProvider for the dimension * @param fields Fields of the dimension * @param defaultFields Default fields of the dimension */ public TestDimensionConfig( TestApiDimensionName apiName, String physicalName, KeyValueStore keyValueStore, SearchProvider searchProvider, LinkedHashSet<DimensionField> fields, LinkedHashSet<DimensionField> defaultFields ) { this.apiName = apiName; this.physicalName = physicalName; this.description = apiName.asName(); this.keyValueStore = keyValueStore; this.searchProvider = searchProvider; this.fields = fields; this.defaultFields = defaultFields; this.storageStrategy = StorageStrategy.LOADED; }
/** * Get the default KeyValueStore for the given store name. * * @param storeName The store name for which to get the default key value store * * @return the default KeyValueStore */ public static KeyValueStore getDefaultKeyValueStore(TestApiDimensionName storeName) { switch (DimensionBackend.getBackend()) { case REDIS: RedisStore store = RedisStoreManager.getInstance(storeName.asName()); // Key/values stored in Redis persist between tests, so remove // them to give the test a clean environment. store.removeAllKeys(); return store; case MEMORY: default: return MapStoreManager.getInstance(storeName.asName()); } }
/** * Build a standard-config Lucene-backed dimension config. * * @param dimensionName Name of the dimension to build * * @return the standard lucene-backed dimension config */ public static TestDimensionConfig buildStandardLuceneDimensionConfig(TestApiDimensionName dimensionName) { return new TestDimensionConfig( dimensionName, dimensionName.asName(), getDefaultKeyValueStore(dimensionName), LuceneSearchProviderManager.getInstance(dimensionName.asName()), getDefaultFields(), getDefaultFields() ); }