use of org.apache.asterix.common.context.CorrelatedPrefixMergePolicy in project asterixdb by apache.
the class CorrelatedPrefixMergePolicyTest method mockMergePolicy.
private ILSMMergePolicy mockMergePolicy(IndexInfo... indexes) {
Map<String, String> properties = new HashMap<>();
properties.put(CorrelatedPrefixMergePolicyFactory.KEY_MAX_COMPONENT_COUNT, String.valueOf(MAX_COMPONENT_COUNT));
properties.put(CorrelatedPrefixMergePolicyFactory.KEY_MAX_COMPONENT_SIZE, String.valueOf(MAX_COMPONENT_SIZE));
Set<IndexInfo> indexInfos = new HashSet<>();
for (IndexInfo info : indexes) {
indexInfos.add(info);
}
DatasetInfo dsInfo = Mockito.mock(DatasetInfo.class);
Mockito.when(dsInfo.getDatsetIndexInfos()).thenReturn(indexInfos);
IDatasetLifecycleManager manager = Mockito.mock(IDatasetLifecycleManager.class);
Mockito.when(manager.getDatasetInfo(DATASET_ID)).thenReturn(dsInfo);
ILSMMergePolicy policy = new CorrelatedPrefixMergePolicy(manager, DATASET_ID);
policy.configure(properties);
return policy;
}
Aggregations