use of com.hazelcast.config.AttributeConfig in project hazelcast by hazelcast.
the class ExtractionWithExtractorsSpecTest method doWithConfig.
@Override
public void doWithConfig(Config config) {
MapConfig mapConfig = config.getMapConfig("map");
AttributeConfig tattoosCount = new AttributeConfig();
tattoosCount.setName("tattoosCount");
tattoosCount.setExtractorClassName("com.hazelcast.internal.serialization.impl.compact.extractor.ExtractionWithExtractorsSpecTest$LimbTattoosCountExtractor");
mapConfig.addAttributeConfig(tattoosCount);
config.getSerializationConfig().setCompactSerializationConfig(new CompactSerializationConfig().setEnabled(true));
}
use of com.hazelcast.config.AttributeConfig in project hazelcast by hazelcast.
the class NestedPredicateWithExtractorTest method extractor.
private static AttributeConfig extractor(String name, String extractor) {
AttributeConfig extractorConfig = new AttributeConfig();
extractorConfig.setName(name);
extractorConfig.setExtractorClassName(extractor);
return extractorConfig;
}
use of com.hazelcast.config.AttributeConfig in project hazelcast by hazelcast.
the class CollectionAllPredicatesExtractorTest method getInstanceConfigurator.
@Override
protected AbstractExtractionTest.Configurator getInstanceConfigurator() {
return new AbstractExtractionTest.Configurator() {
@Override
public void doWithConfig(Config config, Multivalue mv) {
MapConfig mapConfig = config.getMapConfig("map");
AttributeConfig reducedNameAttribute = new TestAttributeIndexConfig();
reducedNameAttribute.setName(AbstractExtractionTest.parametrize("limb_[any].name", mv));
reducedNameAttribute.setExtractorClassName("com.hazelcast.query.impl.extractor.predicates.CollectionAllPredicatesExtractorTest$ReducedLimbNameExtractor");
mapConfig.addAttributeConfig(reducedNameAttribute);
AttributeConfig indexOneNameAttribute = new TestAttributeIndexConfig();
indexOneNameAttribute.setName(AbstractExtractionTest.parametrize("limb_[1].name", mv));
indexOneNameAttribute.setExtractorClassName("com.hazelcast.query.impl.extractor.predicates.CollectionAllPredicatesExtractorTest$IndexOneLimbNameExtractor");
mapConfig.addAttributeConfig(indexOneNameAttribute);
AttributeConfig reducedPowerAttribute = new TestAttributeIndexConfig();
reducedPowerAttribute.setName(AbstractExtractionTest.parametrize("limb_[any].power", mv));
reducedPowerAttribute.setExtractorClassName("com.hazelcast.query.impl.extractor.predicates.CollectionAllPredicatesExtractorTest$ReducedLimbPowerExtractor");
mapConfig.addAttributeConfig(reducedPowerAttribute);
AttributeConfig indexOnePowerAttribute = new TestAttributeIndexConfig();
indexOnePowerAttribute.setName(AbstractExtractionTest.parametrize("limb_[1].power", mv));
indexOnePowerAttribute.setExtractorClassName("com.hazelcast.query.impl.extractor.predicates.CollectionAllPredicatesExtractorTest$IndexOneLimbPowerExtractor");
mapConfig.addAttributeConfig(indexOnePowerAttribute);
}
};
}
use of com.hazelcast.config.AttributeConfig in project hazelcast by hazelcast.
the class ExtractionWithExtractorsSpecTest method getInstanceConfigurator.
protected AbstractExtractionTest.Configurator getInstanceConfigurator() {
return new AbstractExtractionTest.Configurator() {
@Override
public void doWithConfig(Config config, AbstractExtractionTest.Multivalue mv) {
MapConfig mapConfig = config.getMapConfig("map");
AttributeConfig tattoosCount = new TestAttributeIndexConfig();
tattoosCount.setName("tattoosCount");
tattoosCount.setExtractorClassName("com.hazelcast.query.impl.extractor.specification.ExtractionWithExtractorsSpecTest$LimbTattoosCountExtractor");
mapConfig.addAttributeConfig(tattoosCount);
config.getSerializationConfig().addPortableFactory(ComplexTestDataStructure.PersonPortableFactory.ID, new ComplexTestDataStructure.PersonPortableFactory());
}
};
}
use of com.hazelcast.config.AttributeConfig in project hazelcast by hazelcast.
the class ExtractorsTest method extract_extractor_correctValue.
@Test
public void extract_extractor_correctValue() {
// GIVEN
AttributeConfig config = new AttributeConfig("gimmePower", "com.hazelcast.query.impl.getters.ExtractorsTest$PowerExtractor");
Extractors extractors = createExtractors(config);
// WHEN
Object power = extractors.extract(bond, "gimmePower", null);
// THEN
assertThat((Integer) power, equalTo(550));
}
Aggregations